Skip to content
Permalink
Browse files

fix(eslint-plugin): [no-unused-vars] handle TSCallSignature (#2336)

  • Loading branch information
bradzacher committed Aug 29, 2020
1 parent 3be125d commit c70f54fd3a46a12060ae3aec0faae872c431dd88
@@ -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: [

0 comments on commit c70f54f

Please sign in to comment.