From ea3fddf53127a032c7412380ce0aa92b8310605e Mon Sep 17 00:00:00 2001 From: Jason Killian Date: Thu, 10 Sep 2015 14:38:39 -0400 Subject: [PATCH] Don't check parameters in call signatures --- lib/tslint.d.ts | 1 + src/language/walker/syntaxWalker.ts | 8 ++++++++ src/rules/noShadowedVariableRule.ts | 4 ++++ test/files/rules/no-shadowed-variable.test.ts | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/lib/tslint.d.ts b/lib/tslint.d.ts index a1c460059af..a4075eda50c 100644 --- a/lib/tslint.d.ts +++ b/lib/tslint.d.ts @@ -8,6 +8,7 @@ declare module Lint { protected visitBlock(node: ts.Block): void; protected visitBreakStatement(node: ts.BreakOrContinueStatement): void; protected visitCallExpression(node: ts.CallExpression): void; + protected visitCallSignature(node: ts.SignatureDeclaration): void; protected visitCaseClause(node: ts.CaseClause): void; protected visitClassDeclaration(node: ts.ClassDeclaration): void; protected visitCatchClause(node: ts.CatchClause): void; diff --git a/src/language/walker/syntaxWalker.ts b/src/language/walker/syntaxWalker.ts index 20fe515ce46..bfb51072ef1 100644 --- a/src/language/walker/syntaxWalker.ts +++ b/src/language/walker/syntaxWalker.ts @@ -48,6 +48,10 @@ module Lint { this.walkChildren(node); } + protected visitCallSignature(node: ts.SignatureDeclaration) { + this.walkChildren(node); + } + protected visitCaseClause(node: ts.CaseClause) { this.walkChildren(node); } @@ -310,6 +314,10 @@ module Lint { this.visitCallExpression( node); break; + case ts.SyntaxKind.CallSignature: + this.visitCallSignature( node); + break; + case ts.SyntaxKind.CaseClause: this.visitCaseClause( node); break; diff --git a/src/rules/noShadowedVariableRule.ts b/src/rules/noShadowedVariableRule.ts index 8fe02139a36..03fc1d6e28c 100644 --- a/src/rules/noShadowedVariableRule.ts +++ b/src/rules/noShadowedVariableRule.ts @@ -48,6 +48,10 @@ class NoShadowedVariableWalker extends Lint.BlockScopeAwareRuleWalker number; pos: number; } + +interface FalsePositive4 { + (parameters: T, runSynchonous: boolean): TResult; + (parameters: T, callback: (error: Error, result: TResult) => void): void; +}