forked from typescript-eslint/typescript-eslint
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experimental-utils): move some util function files from eslint-p…
…lugin to experimental-utils files moved: - isTypeReadonly - nullThrows - propertyTypes fix typescript-eslint#3657
- Loading branch information
1 parent
d358785
commit ffd668a
Showing
8 changed files
with
62 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'typescript'; | ||
|
||
declare module 'typescript' { | ||
interface TypeChecker { | ||
// internal TS APIs | ||
|
||
/** | ||
* @returns `true` if the given type is an array type: | ||
* - `Array<foo>` | ||
* - `ReadonlyArray<foo>` | ||
* - `foo[]` | ||
* - `readonly foo[]` | ||
*/ | ||
isArrayType(type: Type): type is TypeReference; | ||
/** | ||
* @returns `true` if the given type is a tuple type: | ||
* - `[foo]` | ||
* - `readonly [foo]` | ||
*/ | ||
isTupleType(type: Type): type is TupleTypeReference; | ||
/** | ||
* Return the type of the given property in the given type, or undefined if no such property exists | ||
*/ | ||
getTypeOfPropertyOfType(type: Type, propertyName: string): Type | undefined; | ||
} | ||
|
||
interface Type { | ||
/** | ||
* If the type is `any`, and this is set to "error", then TS was unable to resolve the type | ||
*/ | ||
intrinsicName?: string; | ||
} | ||
} |