Repository navigation
Replies: 1 comment
|
Enabling |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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