Skip to content

fix(eslint-plugin-query): detect unstable clients in arrow functions and JSX - #12409

Draft
TkDodo wants to merge 2 commits into
mainfrom
tkdodo/fix/stable-query-client-detection
Draft

TkDodo wants to merge 2 commits into
mainfrom
tkdodo/fix/stable-query-client-detection

Conversation

@TkDodo

@TkDodo TkDodo commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

🎯 Changes

Fix stable-query-client missing unstable clients in arrow components, arrow hooks, function expressions, and inline JSX. Check the nearest function so state initializers and nested helper functions remain valid. Keep automatic fixes limited to variable declarations.

Add 17 regression cases, update the rule documentation, and include a patch changeset.

Related discussion: #8303 (reply in thread)

Validation: the new tests produced 10 failures before the fix; all 32 rule tests pass after the fix. NX_BASE=origin/main pnpm run test:pr passed all 232 tasks. Formatting checks passed.

Draft prepared with Codex. Maintainer review is pending.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@changeset-bot

changeset-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ba8a792

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@tanstack/eslint-plugin-query Patch
@tanstack/angular-query-experimental Patch
@tanstack/preact-query-devtools Patch
@tanstack/preact-query-persist-client Patch
@tanstack/preact-query Patch
@tanstack/query-async-storage-persister Patch
@tanstack/query-broadcast-client-experimental Patch
@tanstack/query-core Patch
@tanstack/query-devtools Patch
@tanstack/query-persist-client-core Patch
@tanstack/query-sync-storage-persister Patch
@tanstack/react-query-devtools Patch
@tanstack/react-query-next-experimental Patch
@tanstack/react-query-persist-client Patch
@tanstack/react-query Patch
@tanstack/solid-query-devtools Patch
@tanstack/solid-query-persist-client Patch
@tanstack/solid-query Patch
@tanstack/vue-query Patch
@tanstack/lit-query Patch
@tanstack/svelte-query Patch
@tanstack/svelte-query-devtools Patch
@tanstack/vue-query-devtools Patch
@tanstack/svelte-query-persist-client Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@nx-cloud

nx-cloud Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ba8a792

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ⛔ Cancelled 43m 9s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-26 21:04:17 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

9 package(s) bumped directly, 15 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/angular-query-experimental 5.105.0 → 5.105.1 Changeset
@tanstack/eslint-plugin-query 5.105.0 → 5.105.1 Changeset
@tanstack/lit-query 0.2.31 → 0.2.32 Changeset
@tanstack/preact-query 5.105.0 → 5.105.1 Changeset
@tanstack/query-core 5.105.0 → 5.105.1 Changeset
@tanstack/react-query 5.105.0 → 5.105.1 Changeset
@tanstack/solid-query 5.105.0 → 5.105.1 Changeset
@tanstack/svelte-query 6.3.6 → 6.3.7 Changeset
@tanstack/vue-query 5.105.0 → 5.105.1 Changeset
@tanstack/preact-query-devtools 5.105.0 → 5.105.1 Dependent
@tanstack/preact-query-persist-client 5.105.0 → 5.105.1 Dependent
@tanstack/query-async-storage-persister 5.105.0 → 5.105.1 Dependent
@tanstack/query-broadcast-client-experimental 5.105.0 → 5.105.1 Dependent
@tanstack/query-devtools 5.105.0 → 5.105.1 Dependent
@tanstack/query-persist-client-core 5.105.0 → 5.105.1 Dependent
@tanstack/query-sync-storage-persister 5.105.0 → 5.105.1 Dependent
@tanstack/react-query-devtools 5.105.0 → 5.105.1 Dependent
@tanstack/react-query-next-experimental 5.105.0 → 5.105.1 Dependent
@tanstack/react-query-persist-client 5.105.0 → 5.105.1 Dependent
@tanstack/solid-query-devtools 5.105.0 → 5.105.1 Dependent
@tanstack/solid-query-persist-client 5.105.0 → 5.105.1 Dependent
@tanstack/svelte-query-devtools 6.3.6 → 6.3.7 Dependent
@tanstack/svelte-query-persist-client 6.3.6 → 6.3.7 Dependent
@tanstack/vue-query-devtools 6.3.6 → 6.3.7 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@12409

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@12409

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@12409

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@12409

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@12409

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@12409

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@12409

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@12409

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@12409

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@12409

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@12409

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@12409

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@12409

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@12409

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@12409

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@12409

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@12409

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@12409

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@12409

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@12409

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@12409

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@12409

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@12409

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@12409

commit: ba8a792

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.75 KB (0%)
react minimal 8.6 KB (0%)

@TkDodo TkDodo closed this Oct 26, 2026
@TkDodo TkDodo reopened this Oct 26, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant