Skip to content

test(vue-query/queryClient): rename local 'queryKey' to 'key' to avoid 'no-shadow' with the 'queryKey' import#10549

Merged
sukvvon merged 1 commit intomainfrom
test/vue-query-queryClient-rename-local-queryKey
Apr 21, 2026
Merged

test(vue-query/queryClient): rename local 'queryKey' to 'key' to avoid 'no-shadow' with the 'queryKey' import#10549
sukvvon merged 1 commit intomainfrom
test/vue-query-queryClient-rename-local-queryKey

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 21, 2026

🎯 Changes

Renames local queryKey variables inside the type-level tests to key, matching the convention used elsewhere in this file (const key = queryKey()) and across the rest of the test suite. This resolves the 10 no-shadow warnings previously triggered because the queryKey imported from @tanstack/query-test-utils was shadowed by these local declarations.

Scope

Only describe('getQueryData', ...) and describe('setQueryData', ...) are affected — 10 local const queryKey = [...] declarations become const key = [...]. The existing const key = queryKey() usages in describe('fetchInfiniteQuery', ...) are already correct and are left untouched.

✅ 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 cases to improve code consistency and maintainability in type-checking tests.

@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: 0c046041-8c41-42eb-9532-5f95f15f2c3a

📥 Commits

Reviewing files that changed from the base of the PR and between eec2abe and 9a550a1.

📒 Files selected for processing (1)
  • packages/vue-query/src/__tests__/queryClient.test-d.ts

📝 Walkthrough

Walkthrough

Local variable queryKey was renamed to key throughout type-test cases in the QueryClient test-d file, with corresponding updates to getQueryData, setQueryData calls, and related assertions.

Changes

Cohort / File(s) Summary
Variable Rename in QueryClient Type Tests
packages/vue-query/src/__tests__/queryClient.test-d.ts
Renamed local constant queryKey to key across getQueryData and setQueryData type-test cases, including updater callbacks and @ts-expect-error assertions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A key by any other name would work the same,
From queryKey to key—a simple rename game,
Types still align, assertions still pass through,
The test suite celebrates consistency anew! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: renaming local 'queryKey' variables to 'key' to resolve ESLint 'no-shadow' warnings in a test file.
Description check ✅ Passed The description follows the template with all required sections completed: Changes section explains the motivation and scope, Checklist items are checked/unchecked appropriately, and Release Impact is clearly marked as dev-only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/vue-query-queryClient-rename-local-queryKey

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

@sukvvon sukvvon self-assigned this Apr 21, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 21, 2026

View your CI Pipeline Execution ↗ for commit 9a550a1

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

☁️ Nx Cloud last updated this comment at 2026-04-21 17:25:18 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@10549

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 9a550a1

@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 a652526 into main Apr 21, 2026
10 checks passed
@sukvvon sukvvon deleted the test/vue-query-queryClient-rename-local-queryKey branch April 21, 2026 17:26
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