Conversation
📝 WalkthroughWalkthroughThis pull request adds a new ESLint rule Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 2e012f1
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/angular-query-experimental/src/__tests__/inject-infinite-query.test.ts (1)
26-64:⚠️ Potential issue | 🟠 Major
vitest/expect-expectmay fail this test despite helper assertionsThis case relies on
expectSignals(...)only, so ESLint can flag it as “no assertions.” Please either add a directexpect(...)in this test or configurevitest/expect-expectto recognizeexpectSignalsas an assertion function.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-query-experimental/src/__tests__/inject-infinite-query.test.ts` around lines 26 - 64, The test uses only the custom helper expectSignals(...) so the vitest rule vitest/expect-expect may complain about missing direct assertions; add a direct expect(...) assertion (for example checking query.data or query.status or that query is defined) somewhere in the test (e.g., after the initial wait and/or after fetchNextPage) so that the linter recognizes an assertion, referencing the existing symbols query and expectSignals and keeping the existing helper assertions intact.
🧹 Nitpick comments (1)
packages/query-core/src/__tests__/mutations.test.tsx (1)
1087-1087: Optional: fix grammar in test title for readability.Line 1087 reads “where it are reported”; consider “where they are reported”.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/query-core/src/__tests__/mutations.test.tsx` at line 1087, Update the test title string in the it(...) call (the description starting "errors by onError and consecutive onSettled callbacks are transferred to different execution context where it are reported") to fix the grammar by replacing "it are reported" with "they are reported" so the description reads "...where they are reported".
🤖 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/preact-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx`:
- Line 14: The named imports from 'vitest' are out of order causing the linter
error; update the import list in the import statement that currently includes
afterEach, beforeEach, describe, expect, vi, it to a lint-sorted order (e.g.,
afterEach, beforeEach, describe, expect, it, vi) so that vi comes after it and
satisfies the sort-imports rule.
In `@packages/preact-query/src/__tests__/HydrationBoundary.test.tsx`:
- Line 6: The import specifiers from vitest are out of the configured
sort-imports order; reorder the named imports on the line importing from
'vitest' so they follow the project's sort order (e.g., ensure the sequence
matches afterEach, beforeEach, describe, expect, it, vi or whatever the linter
expects). Update the import statement that currently lists "afterEach,
beforeEach, describe, expect, vi, it" to the correct ordering containing the
same symbols (for example "afterEach, beforeEach, describe, expect, it, vi") so
the linter rule sort-imports is satisfied.
In `@packages/preact-query/src/__tests__/QueryClientProvider.test.tsx`:
- Line 3: The named imports from 'vitest' are not alphabetized (the `it` and
`vi` order is swapped); update the import statement that lists afterEach,
beforeEach, describe, expect, vi, it so the named imports are sorted
alphabetically (afterEach, beforeEach, describe, expect, it, vi) to satisfy the
`sort-imports` lint rule.
---
Outside diff comments:
In
`@packages/angular-query-experimental/src/__tests__/inject-infinite-query.test.ts`:
- Around line 26-64: The test uses only the custom helper expectSignals(...) so
the vitest rule vitest/expect-expect may complain about missing direct
assertions; add a direct expect(...) assertion (for example checking query.data
or query.status or that query is defined) somewhere in the test (e.g., after the
initial wait and/or after fetchNextPage) so that the linter recognizes an
assertion, referencing the existing symbols query and expectSignals and keeping
the existing helper assertions intact.
---
Nitpick comments:
In `@packages/query-core/src/__tests__/mutations.test.tsx`:
- Line 1087: Update the test title string in the it(...) call (the description
starting "errors by onError and consecutive onSettled callbacks are transferred
to different execution context where it are reported") to fix the grammar by
replacing "it are reported" with "they are reported" so the description reads
"...where they are reported".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5c910514-eab3-4d16-bd33-82493b6c9d1e
📒 Files selected for processing (77)
eslint.config.jspackages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.tspackages/angular-query-experimental/src/__tests__/inject-infinite-query.test-d.tspackages/angular-query-experimental/src/__tests__/inject-infinite-query.test.tspackages/angular-query-experimental/src/__tests__/inject-is-fetching.test.tspackages/angular-query-experimental/src/__tests__/inject-is-mutating.test.tspackages/angular-query-experimental/src/__tests__/inject-is-restoring.test.tspackages/angular-query-experimental/src/__tests__/inject-mutation-state.test.tspackages/angular-query-experimental/src/__tests__/inject-mutation.test-d.tspackages/angular-query-experimental/src/__tests__/inject-mutation.test.tspackages/angular-query-experimental/src/__tests__/inject-query.test-d.tspackages/angular-query-experimental/src/__tests__/inject-query.test.tspackages/angular-query-experimental/src/__tests__/pending-tasks.test.tspackages/angular-query-experimental/src/__tests__/provide-query-client.test.tspackages/angular-query-experimental/src/__tests__/provide-tanstack-query.test.tspackages/angular-query-experimental/src/__tests__/query-options.test-d.tspackages/angular-query-experimental/src/__tests__/signal-proxy.test.tspackages/angular-query-experimental/src/__tests__/with-devtools.test.tspackages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.tspackages/eslint-plugin-query/src/__tests__/sort-data-by-order.utils.test.tspackages/eslint-plugin-query/src/__tests__/test-utils.test.tspackages/preact-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsxpackages/preact-query/src/HydrationBoundary.tsxpackages/preact-query/src/__tests__/HydrationBoundary.test.tsxpackages/preact-query/src/__tests__/QueryClientProvider.test.tsxpackages/preact-query/src/__tests__/infiniteQueryOptions.test-d.tsxpackages/preact-query/src/__tests__/useQuery.test.tsxpackages/preact-query/src/utils.tspackages/query-async-storage-persister/src/__tests__/asyncThrottle.test.tspackages/query-core/src/__tests__/environmentManager.test.tsxpackages/query-core/src/__tests__/focusManager.test.tsxpackages/query-core/src/__tests__/hydration.test.tsxpackages/query-core/src/__tests__/infiniteQueryBehavior.test.tsxpackages/query-core/src/__tests__/infiniteQueryObserver.test.tsxpackages/query-core/src/__tests__/mutationCache.test.tsxpackages/query-core/src/__tests__/mutationObserver.test.tsxpackages/query-core/src/__tests__/mutations.test.tsxpackages/query-core/src/__tests__/onlineManager.test.tsxpackages/query-core/src/__tests__/queriesObserver.test.tsxpackages/query-core/src/__tests__/query.test.tsxpackages/query-core/src/__tests__/queryCache.test.tsxpackages/query-core/src/__tests__/queryClient.test.tsxpackages/query-core/src/__tests__/queryObserver.test.tsxpackages/query-core/src/__tests__/streamedQuery.test.tsxpackages/query-persist-client-core/src/__tests__/createPersister.test.tspackages/query-persist-client-core/src/__tests__/persist.test.tspackages/query-sync-storage-persister/src/__tests__/storageIsFull.test.tspackages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsxpackages/react-query/src/__tests__/HydrationBoundary.test.tsxpackages/react-query/src/__tests__/QueryClientProvider.test.tsxpackages/react-query/src/__tests__/infiniteQueryOptions.test-d.tsxpackages/react-query/src/__tests__/useQuery.test.tsxpackages/solid-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsxpackages/svelte-query-persist-client/tests/PersistQueryClientProvider.svelte.test.tspackages/svelte-query/tests/QueryClientProvider/QueryClientProvider.svelte.test.tspackages/svelte-query/tests/context/context.svelte.test.tspackages/svelte-query/tests/createMutation/createMutation.svelte.test.tspackages/svelte-query/tests/infiniteQueryOptions.test-d.tspackages/svelte-query/tests/mutationOptions/mutationOptions.test-d.tspackages/svelte-query/tests/queryOptions.test-d.tspackages/svelte-query/tests/useIsFetching/useIsFetching.svelte.test.tspackages/svelte-query/tests/useIsMutating/useIsMutating.svelte.test.tspackages/svelte-query/tests/useMutationState/useMutationState.svelte.test.tspackages/vue-query/src/__tests__/mutationCache.test.tspackages/vue-query/src/__tests__/queryCache.test.tspackages/vue-query/src/__tests__/queryClient.test.tspackages/vue-query/src/__tests__/useInfiniteQuery.test.tspackages/vue-query/src/__tests__/useIsFetching.test.tspackages/vue-query/src/__tests__/useIsMutating.test.tspackages/vue-query/src/__tests__/useMutation.test.tspackages/vue-query/src/__tests__/usePrefetchInfiniteQuery.test.tspackages/vue-query/src/__tests__/usePrefetchQuery.test.tspackages/vue-query/src/__tests__/useQueries.test.tspackages/vue-query/src/__tests__/useQuery.test.tspackages/vue-query/src/__tests__/useQueryClient.test.tspackages/vue-query/src/__tests__/utils.test.tspackages/vue-query/src/__tests__/vueQueryPlugin.test.ts
💤 Files with no reviewable changes (1)
- packages/preact-query/src/utils.ts
| import type { UseQueryResult } from '../../../preact-query/src' | ||
| import { QueryClient, useQuery } from '../../../preact-query/src' | ||
| import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' | ||
| import { afterEach, beforeEach, describe, expect, vi, it } from 'vitest' |
There was a problem hiding this comment.
Fix named import member order to satisfy lint.
Line 14 has vi before it, which violates the active sort-imports rule and can fail CI.
🔧 Proposed fix
-import { afterEach, beforeEach, describe, expect, vi, it } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { afterEach, beforeEach, describe, expect, vi, it } from 'vitest' | |
| import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' |
🧰 Tools
🪛 ESLint
[error] 14-14: Member 'it' of the import declaration should be sorted alphabetically.
(sort-imports)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@packages/preact-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx`
at line 14, The named imports from 'vitest' are out of order causing the linter
error; update the import list in the import statement that currently includes
afterEach, beforeEach, describe, expect, vi, it to a lint-sorted order (e.g.,
afterEach, beforeEach, describe, expect, it, vi) so that vi comes after it and
satisfies the sort-imports rule.
| import { render } from '@testing-library/preact' | ||
| import { Suspense, startTransition } from 'preact/compat' | ||
| import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' | ||
| import { afterEach, beforeEach, describe, expect, vi, it } from 'vitest' |
There was a problem hiding this comment.
Fix vitest import member order to satisfy sort-imports.
it and vi are out of configured order on this line.
Proposed fix
-import { afterEach, beforeEach, describe, expect, vi, it } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { afterEach, beforeEach, describe, expect, vi, it } from 'vitest' | |
| import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' |
🧰 Tools
🪛 ESLint
[error] 6-6: Member 'it' of the import declaration should be sorted alphabetically.
(sort-imports)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/preact-query/src/__tests__/HydrationBoundary.test.tsx` at line 6,
The import specifiers from vitest are out of the configured sort-imports order;
reorder the named imports on the line importing from 'vitest' so they follow the
project's sort order (e.g., ensure the sequence matches afterEach, beforeEach,
describe, expect, it, vi or whatever the linter expects). Update the import
statement that currently lists "afterEach, beforeEach, describe, expect, vi, it"
to the correct ordering containing the same symbols (for example "afterEach,
beforeEach, describe, expect, it, vi") so the linter rule sort-imports is
satisfied.
| import { queryKey, sleep } from '@tanstack/query-test-utils' | ||
| import { render } from '@testing-library/preact' | ||
| import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' | ||
| import { afterEach, beforeEach, describe, expect, vi, it } from 'vitest' |
There was a problem hiding this comment.
Fix import member order to satisfy sort-imports
it is out of the expected alphabetical order in the Vitest named import. Please reorder this import to clear the lint error.
🧰 Tools
🪛 ESLint
[error] 3-3: Member 'it' of the import declaration should be sorted alphabetically.
(sort-imports)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/preact-query/src/__tests__/QueryClientProvider.test.tsx` at line 3,
The named imports from 'vitest' are not alphabetized (the `it` and `vi` order is
swapped); update the import statement that lists afterEach, beforeEach,
describe, expect, vi, it so the named imports are sorted alphabetically
(afterEach, beforeEach, describe, expect, it, vi) to satisfy the `sort-imports`
lint rule.
…mments from 'src' files
🎯 Changes
Enforces a single test keyword convention across the repo by adding
vitest/consistent-test-itrule and migrating alltest()calls toit().Current state
Test files were split between
it()andtest()with no lint rule enforcing consistency:it: ~1,729 calls (66%)test: ~875 calls (34%)Per adapter:
itmajority: react-query, preact-query, solid-query, vue-query, svelte-query, query-devtoolstestmajority: angular-query-experimental, query-core, persist-client packagesWhat this PR does
'vitest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }]toeslint.config.js(same configzustand/jotaiuse).eslint --fixacross all test files — 77 files auto-migrated, 884 insertions / 884 deletions.testIfhelper invueQueryPlugin.test.tsto referenceitinstead oftest.Why
it?itis already the majority (66%) in this repo, so migrating toitis the lower-cost direction.describe/itphrasing that most of our test files already follow.Verification
All 7 major adapters pass locally:
@tanstack/query-core: 511 passed@tanstack/react-query: 535 passed, 1 skipped@tanstack/preact-query: 500 passed@tanstack/solid-query: 309 passed@tanstack/vue-query: 289 passed, 6 skipped@tanstack/svelte-query: 163 passed@tanstack/angular-query-experimental: 207 passedLint: 0
consistent-test-itviolations. Prettier: clean.Follow-up (not in this PR)
svelte-queryandsvelte-query-persist-clienthavetest:eslintscoped to./srconly, so theirtests/directories aren't lint-covered. Will fix in a separate PR.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
Release Notes
Tests
Chores