Skip to content

Comments

feat(eslint-plugin-query): add support for ESLint v10#10165

Open
darshjme-codes wants to merge 1 commit intoTanStack:mainfrom
darshjme-codes:fix/eslint-plugin-support-eslint-v10
Open

feat(eslint-plugin-query): add support for ESLint v10#10165
darshjme-codes wants to merge 1 commit intoTanStack:mainfrom
darshjme-codes:fix/eslint-plugin-support-eslint-v10

Conversation

@darshjme-codes
Copy link

@darshjme-codes darshjme-codes commented Feb 22, 2026

Fixes #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

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

  • Chores
    • Extended ESLint peer dependency support to include version 10, enabling compatibility with the latest ESLint releases alongside versions 8.57.0 and 9.0.0.

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.
@changeset-bot
Copy link

changeset-bot bot commented Feb 22, 2026

⚠️ No Changeset found

Latest commit: 854aa3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

Updated 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

Cohort / File(s) Summary
Dependency Update
packages/eslint-plugin-query/package.json
Extended ESLint peer dependency to include v10 alongside existing v8 and v9 support.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

package: eslint-plugin-query

Suggested reviewers

  • lachlancollins
  • TkDodo

Poem

🐰 A version bump, so clean and neat,
ESLint ten now joins the fleet!
From eight to nine, and now to ten,
Our plugin's ready once again! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(eslint-plugin-query): add support for ESLint v10' clearly and concisely describes the main change—expanding ESLint peer dependency support to v10.
Description check ✅ Passed The description includes the issue reference, clear before/after changes, relevant links, compatibility information, and testing verification, meeting the template requirements.
Linked Issues check ✅ Passed The PR successfully addresses issue #10141 by updating peerDependencies to declare ESLint v10 compatibility, exactly as requested.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to updating the eslint peer dependency version range, directly addressing the linked issue with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/eslint-plugin-query/package.json (2)

62-62: Bump @typescript-eslint/utils minimum to ^8.56.0 for consistent ESLint v10 peer dep chain.

@typescript-eslint packages officially added ESLint v10 support in v8.56.0. The current minimum ^8.48.0 permits any version >=8.48.0 <9.0.0. A consumer with a lockfile resolving @typescript-eslint/utils to any version in the 8.48.08.55.x range will get peer dependency warnings when pairing this plugin with ESLint v10, because those versions don't declare eslint@^10 compatibility.

📦 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 ESLint devDependency to v10 so CI validates the declared compatibility.

The devDependencies pin remains at ^9.36.0, meaning no tests will actually run against ESLint v10. Declaring ^10.0.0 in peerDependencies without 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.

Comment on lines 71 to 73
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": "^5.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 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:292
  • packages/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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eslint-plugin-query: support eslint v10

1 participant