Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-plugin): [no-unnec-cond] array predicate callbacks (#1206)
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
- Loading branch information
1 parent
1898bdf
commit f7ad716
Showing
4 changed files
with
230 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { TypeChecker, Type } from '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): boolean; | ||
/** | ||
* @returns `true` if the given type is a tuple type: | ||
* - [foo] | ||
*/ | ||
isTupleType(type: Type): boolean; | ||
} | ||
} |