Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix(eslint-plugin): [no-unused-vars] handle TSCallSignature (#2336)
- Loading branch information
|
@@ -84,8 +84,9 @@ export default util.createRule<Options, MessageIds>({ |
|
|
|
|
|
return { |
|
|
...rules, |
|
|
'TSConstructorType, TSConstructSignatureDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature'( |
|
|
'TSCallSignatureDeclaration, TSConstructorType, TSConstructSignatureDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature'( |
|
|
node: |
|
|
| TSESTree.TSCallSignatureDeclaration |
|
|
| TSESTree.TSConstructorType |
|
|
| TSESTree.TSConstructSignatureDeclaration |
|
|
| TSESTree.TSDeclareFunction |
|
|
|
@@ -729,6 +729,26 @@ export function foo() { |
|
|
return new Promise<Foo>(); |
|
|
} |
|
|
`, |
|
|
// https://github.com/typescript-eslint/typescript-eslint/issues/2331 |
|
|
{ |
|
|
code: ` |
|
|
export interface Event<T> { |
|
|
( |
|
|
listener: (e: T) => any, |
|
|
thisArgs?: any, |
|
|
disposables?: Disposable[], |
|
|
): Disposable; |
|
|
} |
|
|
`, |
|
|
options: [ |
|
|
{ |
|
|
args: 'after-used', |
|
|
argsIgnorePattern: '^_', |
|
|
ignoreRestSiblings: true, |
|
|
varsIgnorePattern: '^_$', |
|
|
}, |
|
|
], |
|
|
}, |
|
|
], |
|
|
|
|
|
invalid: [ |
|
|