diff --git a/src/rules/noUnusedExpressionRule.ts b/src/rules/noUnusedExpressionRule.ts index dc9168ab1f4..95d11fee57f 100644 --- a/src/rules/noUnusedExpressionRule.ts +++ b/src/rules/noUnusedExpressionRule.ts @@ -198,7 +198,7 @@ export class NoUnusedExpressionWalker extends Lint.RuleWalker { } function hasCallExpression(node: ts.Node): boolean { - const nodeToCheck = skipParenthesis(node); + const nodeToCheck = skipParentheses(node); if (nodeToCheck.kind === ts.SyntaxKind.CallExpression) { return true; @@ -226,7 +226,7 @@ function isTopLevelExpression(node: ts.BinaryExpression): boolean { return nodeToCheck.kind === ts.SyntaxKind.ExpressionStatement; } -function skipParenthesis(node: ts.Node): ts.Node { +function skipParentheses(node: ts.Node): ts.Node { let nodeToReturn = node; while (nodeToReturn.kind === ts.SyntaxKind.ParenthesizedExpression) { diff --git a/test/rules/no-unused-expression/allow-fast-null-checks/test.ts.lint b/test/rules/no-unused-expression/allow-fast-null-checks/test.ts.lint index bf5426970a3..c72dcbf6ad3 100644 --- a/test/rules/no-unused-expression/allow-fast-null-checks/test.ts.lint +++ b/test/rules/no-unused-expression/allow-fast-null-checks/test.ts.lint @@ -134,4 +134,3 @@ function interactionHandler(e) { } [0]: expected an assignment or function call -