Skip to content

Commit f19d2e5

Browse files
devversiontinayuangao
authored andcommitted
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/
1 parent 2364cfe commit f19d2e5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tools/tslint-rules/noExposedTodoRule.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class NoExposedTodoWalker extends Lint.RuleWalker {
2828
this.addFailureAt(commentRange.pos, commentRange.end - commentRange.pos, ERROR_MESSAGE);
2929
}
3030
});
31+
32+
super.visitSourceFile(sourceFile);
3133
}
3234
}
3335

34-
exports.Rule = Rule;
36+
exports.Rule = Rule;

tools/tslint-rules/requireLicenseBannerRule.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class RequireLicenseBannerWalker extends Lint.RuleWalker {
5050
if (licenseCommentPos !== 0) {
5151
return this.addFailureAt(0, 0, ERROR_MESSAGE, tslintFix);
5252
}
53+
54+
super.visitSourceFile(sourceFile);
5355
}
5456
}
5557

0 commit comments

Comments
 (0)