Skip to content

Commit

Permalink
fix(tslint): enhance applyWithWalker to track failures
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jan 5, 2025
1 parent a529510 commit 08ac17e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/tslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ export function convertRule<T extends Partial<TSLintRule> | TSLintRule>(
walkFn(ctx, programOrChecker);
return ctx.failures;
};
const applyWithWalker = rule.applyWithWalker.bind(rule);
rule.applyWithWalker = function (walker) {
const failures = applyWithWalker(walker);
for (const failure of failures) {
onAddFailure(failure);
}
return failures;
}
if ('applyWithProgram' in rule) {
rule.applyWithProgram(sourceFile, languageService.getProgram()!);
} else {
Expand Down

0 comments on commit 08ac17e

Please sign in to comment.