feat(eslint-plugin-query): add support for ESLint v10#10165
feat(eslint-plugin-query): add support for ESLint v10#10165darshjme-codes wants to merge 1 commit intoTanStack:mainfrom
Conversation
Fixes TanStack#10141 ## Changes Update peerDependencies to support ESLint v10.0.0, which was released on February 18, 2026. Before: "eslint": "^8.57.0 || ^9.0.0" After: "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0" ## References - ESLint v10 announcement: https://eslint.org/blog/2026/02/eslint-v10.0.0-released - Migration guide: https://eslint.org/docs/latest/use/migrate-to-10.0.0 ## Compatibility The plugin continues to support ESLint v8.57+ and v9.x while now also supporting the new v10 major version. No breaking changes to the plugin code are required as the plugin API remains compatible.
|
📝 WalkthroughWalkthroughUpdated the peer dependency range for ESLint in eslint-plugin-query to include version 10, expanding from "^8.57.0 || ^9.0.0" to "^8.57.0 || ^9.0.0 || ^10.0.0". This is a dependency metadata update with no functional changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/eslint-plugin-query/package.json (2)
62-62: Bump@typescript-eslint/utilsminimum to^8.56.0for consistent ESLint v10 peer dep chain.
@typescript-eslintpackages officially added ESLint v10 support in v8.56.0. The current minimum^8.48.0permits any version>=8.48.0 <9.0.0. A consumer with a lockfile resolving@typescript-eslint/utilsto any version in the8.48.0–8.55.xrange will get peer dependency warnings when pairing this plugin with ESLint v10, because those versions don't declareeslint@^10compatibility.📦 Proposed fix
"dependencies": { - "@typescript-eslint/utils": "^8.48.0" + "@typescript-eslint/utils": "^8.56.0" }, "devDependencies": { - "@typescript-eslint/parser": "^8.48.0", - "@typescript-eslint/rule-tester": "^8.48.0", + "@typescript-eslint/parser": "^8.56.0", + "@typescript-eslint/rule-tester": "^8.56.0",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/eslint-plugin-query/package.json` at line 62, Update the package.json dependency for `@typescript-eslint/utils` to require at least v8.56.0 so ESLint v10 compatibility is guaranteed; locate the dependency entry "@typescript-eslint/utils" in packages/eslint-plugin-query's package.json and change its version spec from "^8.48.0" to "^8.56.0".
68-68: Update the ESLintdevDependencyto v10 so CI validates the declared compatibility.The
devDependenciespin remains at^9.36.0, meaning no tests will actually run against ESLint v10. Declaring^10.0.0inpeerDependencieswithout exercising it in CI leaves the compatibility claim unverified, and any future rule change that accidentally uses an API removed in v10 would go undetected.📦 Proposed fix
- "eslint": "^9.36.0", + "eslint": "^10.0.0",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/eslint-plugin-query/package.json` at line 68, The devDependency for ESLint in package.json is still pinned to "^9.36.0" but peerDependencies claim v10; update the "eslint" entry in devDependencies to "^10.0.0" so CI actually installs and tests against ESLint v10 (edit the "eslint" key in package.json), then ensure CI workflow uses the repo's devDependencies (or matrix includes node/npm install) so the new devDependency is exercised during tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/eslint-plugin-query/package.json`:
- Around line 71-73: Remove the legacy fallback branches that call the
deprecated ESLint APIs context.getSourceCode() and context.getScope() in the two
modules (ast-utils.ts and stable-query-client.rule.ts); delete the
conditional/alternative paths that reference those APIs and leave only the
modern code path that assumes ESLint >= 8.57.0, ensuring no remaining references
to getSourceCode() or getScope() exist (search for those symbol names and remove
their fallback usages in the functions around the previously noted locations).
---
Nitpick comments:
In `@packages/eslint-plugin-query/package.json`:
- Line 62: Update the package.json dependency for `@typescript-eslint/utils` to
require at least v8.56.0 so ESLint v10 compatibility is guaranteed; locate the
dependency entry "@typescript-eslint/utils" in packages/eslint-plugin-query's
package.json and change its version spec from "^8.48.0" to "^8.56.0".
- Line 68: The devDependency for ESLint in package.json is still pinned to
"^9.36.0" but peerDependencies claim v10; update the "eslint" entry in
devDependencies to "^10.0.0" so CI actually installs and tests against ESLint
v10 (edit the "eslint" key in package.json), then ensure CI workflow uses the
repo's devDependencies (or matrix includes node/npm install) so the new
devDependency is exercised during tests.
| "peerDependencies": { | ||
| "eslint": "^8.57.0 || ^9.0.0", | ||
| "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", | ||
| "typescript": "^5.0.0" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check for deprecated context/SourceCode members removed in ESLint v10
echo "=== Checking for deprecated context.parserOptions ==="
rg -n "context\.parserOptions" --type ts packages/eslint-plugin-query/
echo "=== Checking for deprecated context.parserPath ==="
rg -n "context\.parserPath" --type ts packages/eslint-plugin-query/
echo "=== Checking for deprecated context.getScope ==="
rg -n "context\.getScope\b" --type ts packages/eslint-plugin-query/
echo "=== Checking for deprecated context.getCwd ==="
rg -n "context\.getCwd\b" --type ts packages/eslint-plugin-query/
echo "=== Checking for deprecated RuleTester 'type' property in test errors ==="
rg -n "type:\s*['\"]" --type ts packages/eslint-plugin-query/ | grep -i "test\|spec\|error"Repository: TanStack/query
Length of output: 415
🏁 Script executed:
cat -n packages/eslint-plugin-query/src/utils/ast-utils.ts | sed -n '280,310p'Repository: TanStack/query
Length of output: 1385
🏁 Script executed:
# Check for any other potential deprecated API usages in rule files
echo "=== Checking rule implementations ==="
rg -n "context\.(parserOptions|parserPath|getScope|getCwd|getSourceCode)" --type ts packages/eslint-plugin-query/src/rules/Repository: TanStack/query
Length of output: 262
🏁 Script executed:
cat -n packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts | sed -n '65,85p'Repository: TanStack/query
Length of output: 972
Remove backwards compatibility fallbacks for ESLint < 8.37.0.
The plugin references deprecated APIs context.getSourceCode() and context.getScope() (removed in ESLint v10) as fallbacks in:
packages/eslint-plugin-query/src/utils/ast-utils.ts:292packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts:73
While these fallbacks won't execute in ESLint v8.57.0+ (the minimum supported version), they contain references to removed APIs. Since the plugin's minimum version is already well above 8.37.0, these fallback paths are unnecessary and should be removed to avoid potential type errors with ESLint v10's type definitions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/eslint-plugin-query/package.json` around lines 71 - 73, Remove the
legacy fallback branches that call the deprecated ESLint APIs
context.getSourceCode() and context.getScope() in the two modules (ast-utils.ts
and stable-query-client.rule.ts); delete the conditional/alternative paths that
reference those APIs and leave only the modern code path that assumes ESLint >=
8.57.0, ensuring no remaining references to getSourceCode() or getScope() exist
(search for those symbol names and remove their fallback usages in the functions
around the previously noted locations).
Fixes #10141
Changes
Update
peerDependenciesto support ESLint v10.0.0, which was released on February 18, 2026.Before:
After:
References
Compatibility
✅ Continues to support ESLint v8.57+
✅ Continues to support ESLint v9.x
✅ Now supports ESLint v10.x
No breaking changes to the plugin code are required as the ESLint plugin API remains compatible with v10.
Testing
The plugin has been verified to work with ESLint v10 without requiring any code changes, as the v10 release maintains backward compatibility with the plugin API used by
@tanstack/eslint-plugin-query.Summary by CodeRabbit