From f19d2e52ee58939663e58f7a8d0050c2faeaca1b Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 2 Aug 2017 23:33:56 +0200 Subject: [PATCH] chore(tslint): custom rules invoke superclass methods (#6215) A few rules are not implemented properly because their associated walker is overwriting hooks from the `SyntaxWalker` superclass. Those custom hooks need to invoke the method on the superclass as well. See https://palantir.github.io/tslint/develop/custom-rules/ --- tools/tslint-rules/noExposedTodoRule.js | 4 +++- tools/tslint-rules/requireLicenseBannerRule.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/tslint-rules/noExposedTodoRule.js b/tools/tslint-rules/noExposedTodoRule.js index c92eb9a4adb..01e96b593f3 100644 --- a/tools/tslint-rules/noExposedTodoRule.js +++ b/tools/tslint-rules/noExposedTodoRule.js @@ -28,7 +28,9 @@ class NoExposedTodoWalker extends Lint.RuleWalker { this.addFailureAt(commentRange.pos, commentRange.end - commentRange.pos, ERROR_MESSAGE); } }); + + super.visitSourceFile(sourceFile); } } -exports.Rule = Rule; \ No newline at end of file +exports.Rule = Rule; diff --git a/tools/tslint-rules/requireLicenseBannerRule.js b/tools/tslint-rules/requireLicenseBannerRule.js index 4f710e88905..d7ac19e7eb9 100644 --- a/tools/tslint-rules/requireLicenseBannerRule.js +++ b/tools/tslint-rules/requireLicenseBannerRule.js @@ -50,6 +50,8 @@ class RequireLicenseBannerWalker extends Lint.RuleWalker { if (licenseCommentPos !== 0) { return this.addFailureAt(0, 0, ERROR_MESSAGE, tslintFix); } + + super.visitSourceFile(sourceFile); } }