Skip to content

Commit

Permalink
Fix expiring-todo-comments (#2077)
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
  • Loading branch information
fisker authored and sindresorhus committed May 6, 2023
1 parent 5fcdf0f commit 7a6861a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -73,7 +73,7 @@
"c8": "^7.12.0",
"chalk": "^5.1.2",
"enquirer": "^2.3.6",
"eslint": "^8.28.0",
"eslint": "^8.40.0",
"eslint-ava-rule-tester": "^4.0.0",
"eslint-doc-generator": "^1.0.0",
"eslint-plugin-eslint-plugin": "^5.0.6",
Expand Down Expand Up @@ -118,6 +118,7 @@
"test/integration/{fixtures,fixtures-local}/**"
],
"rules": {
"unicorn/expiring-todo-comments": "off",
"unicorn/no-null": "error",
"unicorn/prefer-array-flat": [
"error",
Expand Down
11 changes: 4 additions & 7 deletions rules/expiring-todo-comments.js
Expand Up @@ -286,14 +286,11 @@ const create = context => {
// Since we have priority, we leave only the comments that we didn't use.
const fakeContext = {
...context,
getSourceCode() {
return {
...sourceCode,
getAllComments() {
return options.allowWarningComments ? [] : unusedComments;
},
};
sourceCode: {
...sourceCode,
getAllComments: () => options.allowWarningComments ? [] : unusedComments,
},
getSourceCode: () => fakeContext.sourceCode,
};
const rules = baseRule.create(fakeContext);

Expand Down

0 comments on commit 7a6861a

Please sign in to comment.