Skip to content

Commit

Permalink
Minor tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 6, 2023
1 parent f54afb8 commit e6cbdd3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions rules/expiring-todo-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,13 @@ const create = context => {
// This is highly dependable on ESLint's `no-warning-comments` implementation.
// What we do is patch the parts we know the rule will use, `getAllComments`.
// Since we have priority, we leave only the comments that we didn't use.
const fakeSourceCode = {
...sourceCode,
getAllComments: () => options.allowWarningComments ? [] : unusedComments,
};
const fakeContext = {
...context,
sourceCode: fakeSourceCode,
getSourceCode() {
return fakeSourceCode;
sourceCode: {
...sourceCode,
getAllComments: () => options.allowWarningComments ? [] : unusedComments,
},
getSourceCode: () => fakeContext.sourceCode,
};
const rules = baseRule.create(fakeContext);

Expand Down

0 comments on commit e6cbdd3

Please sign in to comment.