Skip to content

Commit 16b09d3

Browse files
marcalexieifisker
andauthored
expiring-todo-comments: Fix compatibility with ESLint 9.15 (#2497)
Co-authored-by: fisker <[email protected]>
1 parent 4d47285 commit 16b09d3

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@
176176
],
177177
"eslint-plugin/require-meta-docs-url": "off",
178178
"eslint-plugin/require-meta-has-suggestions": "off",
179-
"eslint-plugin/require-meta-schema": "off"
179+
"eslint-plugin/require-meta-schema": "off",
180+
"eslint-plugin/require-meta-schema-description": "off"
180181
}
181182
}
182183
]

rules/expiring-todo-comments.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,17 @@ function semverComparisonForOperator(operator) {
271271
}[operator];
272272
}
273273

274+
const DEFAULT_OPTIONS = {
275+
terms: ['todo', 'fixme', 'xxx'],
276+
ignore: [],
277+
ignoreDatesOnPullRequests: true,
278+
allowWarningComments: true,
279+
};
280+
274281
/** @param {import('eslint').Rule.RuleContext} context */
275282
const create = context => {
276283
const options = {
277-
terms: ['todo', 'fixme', 'xxx'],
278-
ignore: [],
279-
ignoreDatesOnPullRequests: true,
280-
allowWarningComments: true,
284+
...DEFAULT_OPTIONS,
281285
date: new Date().toISOString().slice(0, 10),
282286
...context.options[0],
283287
};
@@ -564,7 +568,7 @@ const schema = [
564568
},
565569
allowWarningComments: {
566570
type: 'boolean',
567-
default: false,
571+
default: true,
568572
},
569573
date: {
570574
type: 'string',
@@ -584,6 +588,7 @@ module.exports = {
584588
recommended: true,
585589
},
586590
schema,
591+
defaultOptions: [{...DEFAULT_OPTIONS}],
587592
messages,
588593
},
589594
};

test/integration/projects.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export default [
223223
// Invalid syntax
224224
'src/vs/platform/files/test/node/fixtures/**',
225225
'src/vs/workbench/services/search/test/node/fixtures/examples/**',
226+
'extensions/vscode-colorize-perf-tests/test/**',
226227
],
227228
},
228229
].flatMap((projectOrProjects, index) =>

test/package.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ function getCompactConfig(config) {
168168
// `Intl` was added to ESLint https://github.com/eslint/eslint/pull/18318
169169
// But `@eslint/eslintrc` choose not to update `globals` https://github.com/eslint/eslintrc/pull/164
170170
Intl: false,
171+
Iterator: false,
171172
};
172173
result[key] = languageOptions;
173174
} else if (key === 'plugins') {

0 commit comments

Comments
 (0)