You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tanstack/eslint-plugin-query is an ESLint plugin, but its own eslint config doesn't appear to lint the plugin's rule files with eslint-plugin-eslint-plugin.
Concretely, its recommended config catches things that are easy to miss by hand and that silently break for end users:
no-deprecated-context-methods / no-deprecated-report-api (autofixable) — flags calls like context.getSourceCode() or the old multi-arg context.report(node, message). ESLint has been removing these across major versions, so a rule using them keeps working until a user upgrades ESLint and the rule crashes at runtime with no warning beforehand.
fixer-return — catches a fixer function with a code path that doesn't return a fix, i.e. a silently broken --fix.
no-missing-placeholders / no-unused-placeholders — catches a mismatch between {{placeholder}} tokens in a report message and the data actually passed, i.e. a broken or garbled error message shown to users.
require-meta-schema / require-meta-type / require-meta-fixable — catches rules missing meta fields that editors, eslint --init, and the ESLint config inspector rely on to show correct docs and fixability.
no-identical-tests / prefer-output-null — catches copy-pasted or no-op cases in the rule's own test suite that aren't actually asserting anything.
None of this needs manual review — it's exactly what a linter is good at, pointed at the plugin's own source.
Suggestion: add it as a devDependency and apply its recommended config to the rules directory:
importeslintPluginfrom'eslint-plugin-eslint-plugin';exportdefault[// ...existing config{
...eslintPlugin.configs.recommended,files: ['**/rules/**/*.js'],// adjust to your rules path},];
(For context, this exact recommended setup is already running in eslint-stylistic, eslint-plugin-import-x, eslint-plugin-perfectionist, eslint-plugin-unicorn, eslint-plugin-jsx-a11y-x, and facebook/react's own eslint-plugin-react-hooks — so it's a well-trodden config, not a novel ask.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
@tanstack/eslint-plugin-queryis an ESLint plugin, but its own eslint config doesn't appear to lint the plugin's rule files witheslint-plugin-eslint-plugin.Concretely, its
recommendedconfig catches things that are easy to miss by hand and that silently break for end users:no-deprecated-context-methods/no-deprecated-report-api(autofixable) — flags calls likecontext.getSourceCode()or the old multi-argcontext.report(node, message). ESLint has been removing these across major versions, so a rule using them keeps working until a user upgrades ESLint and the rule crashes at runtime with no warning beforehand.fixer-return— catches a fixer function with a code path that doesn't return a fix, i.e. a silently broken--fix.no-missing-placeholders/no-unused-placeholders— catches a mismatch between{{placeholder}}tokens in a report message and the data actually passed, i.e. a broken or garbled error message shown to users.require-meta-schema/require-meta-type/require-meta-fixable— catches rules missingmetafields that editors,eslint --init, and the ESLint config inspector rely on to show correct docs and fixability.no-identical-tests/prefer-output-null— catches copy-pasted or no-op cases in the rule's own test suite that aren't actually asserting anything.None of this needs manual review — it's exactly what a linter is good at, pointed at the plugin's own source.
Suggestion: add it as a devDependency and apply its
recommendedconfig to the rules directory:(For context, this exact
recommendedsetup is already running in eslint-stylistic, eslint-plugin-import-x, eslint-plugin-perfectionist, eslint-plugin-unicorn, eslint-plugin-jsx-a11y-x, and facebook/react's own eslint-plugin-react-hooks — so it's a well-trodden config, not a novel ask.)Happy to open a PR if this is a welcome change.
All reactions