Skip to content

test(react-query/useQuery): rename 'throwOnError' callback parameter to 'err' to avoid 'no-shadow' with outer 'error'#10550

Merged
sukvvon merged 1 commit intomainfrom
test/react-query-useQuery-rename-throwOnError-param
Apr 21, 2026
Merged

test(react-query/useQuery): rename 'throwOnError' callback parameter to 'err' to avoid 'no-shadow' with outer 'error'#10550
sukvvon merged 1 commit intomainfrom
test/react-query-useQuery-rename-throwOnError-param

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 21, 2026

🎯 Changes

Renames the throwOnError callback parameter on line 6849 from error to err so it no longer shadows the outer error returned by useQuery on line 6846. This resolves the no-shadow warning and matches the convention already used elsewhere in this file:

  • throwOnError: (err) => err.message !== 'Local Error' (line 2832, 2868)
  • retry: (_failureCount, err) => err.message !== 'NoRetry' (line 3290)

After this change, every error-callback parameter in useQuery.test.tsx is named err.

✅ 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

  • Tests
    • Updated test callback parameter naming for improved code clarity.

…to 'err' to avoid 'no-shadow' with outer 'error'
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 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: e8f530fb-bb7e-4fc8-8900-f30bf5a155f8

📥 Commits

Reviewing files that changed from the base of the PR and between a652526 and ac790a1.

📒 Files selected for processing (1)
  • packages/react-query/src/__tests__/useQuery.test.tsx

📝 Walkthrough

Walkthrough

A callback parameter name in a useQuery test case was renamed from error to err to match the parameter used in error message validation. No functional logic, test assertions, or setup were modified.

Changes

Cohort / File(s) Summary
Test Parameter Rename
packages/react-query/src/__tests__/useQuery.test.tsx
Parameter name changed from error to err in a throwOnError callback within a test case that checks error message content.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A parameter renamed with care,
From error to err everywhere,
The test still hops along just fine,
With matching names that now align! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: renaming a callback parameter to resolve a no-shadow linter warning in a test file.
Description check ✅ Passed The description follows the template structure, includes all required sections with complete information, and clearly explains the motivation and scope of the change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/react-query-useQuery-rename-throwOnError-param

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 21, 2026

View your CI Pipeline Execution ↗ for commit ac790a1

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 19s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

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

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 21, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: ac790a1

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon merged commit cf8a765 into main Apr 21, 2026
10 checks passed
@sukvvon sukvvon deleted the test/react-query-useQuery-rename-throwOnError-param branch April 21, 2026 17:32
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.

1 participant