Skip to content

fix(eslint-plugin-query): allow suspense queries combine deps#10642

Open
cyphercodes wants to merge 1 commit intoTanStack:mainfrom
cyphercodes:fix/no-unstable-deps-suspense-combine
Open

fix(eslint-plugin-query): allow suspense queries combine deps#10642
cyphercodes wants to merge 1 commit intoTanStack:mainfrom
cyphercodes:fix/no-unstable-deps-suspense-combine

Conversation

@cyphercodes
Copy link
Copy Markdown

@cyphercodes cyphercodes commented May 5, 2026

🎯 Changes

Fixes #10641.

  • Extend the no-unstable-deps combine exemption from useQueries to useSuspenseQueries.
  • Add regression coverage so combined useSuspenseQueries results can be used in React hook dependency arrays without a false positive.

Local validation:

  • pnpm exec vitest run src/__tests__/no-unstable-deps.test.ts (from packages/eslint-plugin-query)
  • pnpm --filter @tanstack/eslint-plugin-query test:eslint
  • pnpm --filter @tanstack/eslint-plugin-query test:types
  • pnpm --filter @tanstack/eslint-plugin-query build
  • pnpm exec prettier --check packages/eslint-plugin-query/src/rules/no-unstable-deps/no-unstable-deps.rule.ts packages/eslint-plugin-query/src/__tests__/no-unstable-deps.test.ts .changeset/fuzzy-bobcats-remember.md
  • git diff --check

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

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

Summary by CodeRabbit

  • Bug Fixes

    • Fixed false positive warnings in the no-unstable-deps ESLint rule when using combined query results as dependencies.
  • Tests

    • Added test coverage for the corrected behavior with combined queries.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7c2deb6e-7ebe-401b-b40a-a5448c811c5c

📥 Commits

Reviewing files that changed from the base of the PR and between 0d8d64b and d19016c.

📒 Files selected for processing (3)
  • .changeset/fuzzy-bobcats-remember.md
  • packages/eslint-plugin-query/src/__tests__/no-unstable-deps.test.ts
  • packages/eslint-plugin-query/src/rules/no-unstable-deps/no-unstable-deps.rule.ts

📝 Walkthrough

Walkthrough

A patch version bump adds a changeset fixing false positives in the no-unstable-deps ESLint rule when using useSuspenseQueries with combine. The rule now recognizes such combined results as stable dependencies, consistent with existing useQueries handling.

Changes

ESLint Rule Fix for useSuspenseQueries + combine

Layer / File(s) Summary
Rule Logic
packages/eslint-plugin-query/src/rules/no-unstable-deps/no-unstable-deps.rule.ts
Extended VariableDeclarator handler to treat useSuspenseQueries with a combine property as stable, preventing false positives when combined query results are used in dependency arrays.
Test Coverage
packages/eslint-plugin-query/src/__tests__/no-unstable-deps.test.ts
Added valid test case verifying useSuspenseQueries with combine and its queries.data result pass the rule when used as dependencies in React hooks.
Changeset Documentation
.changeset/fuzzy-bobcats-remember.md
Changeset metadata documents the patch-level fix for @tanstack/eslint-plugin-query.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A whisker of wisdom, a rule now refined,
useSuspenseQueries with combine aligned,
False warnings once flagged, now let safely through,
Stable dependencies—the fix smells fresh and true! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(eslint-plugin-query): allow suspense queries combine deps' clearly and concisely summarizes the main change—extending the combine exemption to useSuspenseQueries in the ESLint rule.
Description check ✅ Passed The description includes all key sections from the template with clear explanation of changes, references the linked issue, lists local validation steps, and completes both checklist items appropriately.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #10641: extends the combine exemption from useQueries to useSuspenseQueries, adds test coverage, and includes the changeset.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the false positive: modifications to the rule logic, test case additions, and a changeset entry; no unrelated changes present.
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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

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.

@tanstack/query/no-unstable-deps - false positive with useSuspenseQueries() + combine

1 participant