Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expiring-todo-comments: Fix compatibility with ESLint 9.15 #2497

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
],
"eslint-plugin/require-meta-docs-url": "off",
"eslint-plugin/require-meta-has-suggestions": "off",
"eslint-plugin/require-meta-schema": "off"
"eslint-plugin/require-meta-schema": "off",
"eslint-plugin/require-meta-schema-description": "off"
}
}
]
Expand Down
15 changes: 10 additions & 5 deletions rules/expiring-todo-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,17 @@ function semverComparisonForOperator(operator) {
}[operator];
}

const DEFAULT_OPTIONS = {
terms: ['todo', 'fixme', 'xxx'],
ignore: [],
ignoreDatesOnPullRequests: true,
allowWarningComments: true,
};

/** @param {import('eslint').Rule.RuleContext} context */
const create = context => {
const options = {
terms: ['todo', 'fixme', 'xxx'],
ignore: [],
ignoreDatesOnPullRequests: true,
allowWarningComments: true,
...DEFAULT_OPTIONS,
date: new Date().toISOString().slice(0, 10),
...context.options[0],
};
Expand Down Expand Up @@ -564,7 +568,7 @@ const schema = [
},
allowWarningComments: {
type: 'boolean',
default: false,
default: true,
},
date: {
type: 'string',
Expand All @@ -584,6 +588,7 @@ module.exports = {
recommended: true,
},
schema,
defaultOptions: [{...DEFAULT_OPTIONS}],
messages,
},
};
1 change: 1 addition & 0 deletions test/package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ function getCompactConfig(config) {
// `Intl` was added to ESLint https://github.com/eslint/eslint/pull/18318
// But `@eslint/eslintrc` choose not to update `globals` https://github.com/eslint/eslintrc/pull/164
Intl: false,
Iterator: false,
};
result[key] = languageOptions;
} else if (key === 'plugins') {
Expand Down
Loading