diff --git a/package.json b/package.json index 261069bdb3..067d2c3cda 100644 --- a/package.json +++ b/package.json @@ -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", @@ -118,6 +118,7 @@ "test/integration/{fixtures,fixtures-local}/**" ], "rules": { + "unicorn/expiring-todo-comments": "off", "unicorn/no-null": "error", "unicorn/prefer-array-flat": [ "error", diff --git a/rules/expiring-todo-comments.js b/rules/expiring-todo-comments.js index 72b44e4360..657eb63adc 100644 --- a/rules/expiring-todo-comments.js +++ b/rules/expiring-todo-comments.js @@ -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);