* test(svelte-query/createQuery): fix 'it.todo' for different stale times by advancing timer before query creation
* ci: apply automated fixes
* test(svelte-query/createQuery): reduce 'advanceTimersByTimeAsync' from 11 to 10 to match 'staleTime: 10'
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* test(svelte-query/createQuery): switch to fake timers, replace 'vi.waitFor' with 'vi.advanceTimersByTimeAsync', and move 'queryClient' to 'beforeEach'
* test(svelte-query/createQuery): use 'QueryCache' type instead of 'ReturnType' for 'queryCache'
* ci: apply automated fixes
* test(svelte-query/createQuery): reduce 'advanceTimersByTimeAsync' from 100 to 11 for staleTime test
* test(svelte-query/createQuery): fix 'advanceTimersByTimeAsync' to 101 to match 'staleTime: 100'
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
tests: use proxy instead of query core
infiniteQueryOptions.test-d.ts for Vue Query was incorrectly using the
bare query client from core instead of the vue proxy query client.
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
* test(svelte-query/createQueries): add test for not fetching when 'isRestoring' is true
* test(svelte-query/createQueries): remove '(isRestoring)' from describe block
* test(svelte-query/createQueries): move 'queryClient' inside 'IsRestoringExample' component
* fix(eslint-plugin): normalize whitespace in allowList variable matching
When a member expression spans multiple lines (e.g. `ignored\n .run()`),
`sourceCode.getText()` preserves the newline. The root segment extracted
by splitting on `.'` then becomes `'ignored\n '`, which never matches
the allowlisted variable name `'ignored'`.
Fix: extend `normalizeChain` to also collapse all whitespace, so
multi-line chains produce the same identifier path as single-line ones.
Fixes#10334
* changeset
---------
Co-authored-by: Maks Pikov <mixelburg@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* docs(react): add polling guide
Adds a dedicated guide for refetchInterval-based polling. The option was
only mentioned in passing in important-defaults.md with no explanation of
how it works, how to adapt it dynamically, or how it interacts with window
focus, networkMode, and the enabled flag.
Covers:
- Basic setup and independence from staleTime
- Dynamic intervals via function form
- refetchIntervalInBackground for dashboards / always-on UIs
- Disabling window-focus refetching for fullscreen game and kiosk UIs
- Pausing polling with the enabled flag
- networkMode: 'always' for unreliable navigator.onLine environments
- Deduplication behavior across multiple observers
Updates config.json to add the guide to the React sidebar between
Window Focus Refetching and Disabling/Pausing Queries.
Adds a cross-reference in important-defaults.md.
* docs(react/polling): add example markers for framework portability
* docs(react): fix deduplication note — timers are per observer, not per query
* docs(react): address review feedback on polling guide
- Remove staleTime enumeration; link to Important Defaults instead
- Remove game/kiosk focus management examples (scope creep)
- Rewrite pausing polling to use refetchInterval function instead of enabled: false
- Fix offline support section: connectivity uses online/offline events, not navigator.onLine
- Fix deduplication note: remove queuing implication and em dash
- Add non-browser environments note pointing to React Native guide
* docs(solid,vue): add polling guide framework ports
* docs: wrap React Native section in markers for framework port exclusion
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(build): exclude config files from production DTS rollup
The `experimentalDts` option in tsup respects the tsconfig `include`
array to determine which files are in scope for DTS generation. Each
package's `tsconfig.json` includes `*.config.*` for IDE support, and
`tsconfig.prod.json` inherited this without overriding it. This caused
`vite.config.ts` and `tsup.config.ts` to be swept into the DTS rollup,
leaking `import { UserConfig } from 'vite'` into published types. Since
vite references `@types/node`, this globally overrides the DOM
`setTimeout` return type from `number` to `NodeJS.Timeout` for all
consumers.
Add `"include": ["src"]` (and `"exclude": ["src/__tests__"]` where
applicable) to all `tsconfig.prod.json` files that were missing it,
matching the pattern already used by query-core, react-query,
preact-query, and solid-query.
* chore: add changeset for DTS type pollution fix
* test(build): add regression test for build tool type leaks in .d.ts files
Adds scripts/verify-dts-imports.ts that scans all published .d.ts files
for forbidden imports from build tools (vite, tsup, vitest) and
`/// <reference types="node" />`. Wired into test:pr and test:ci to
run after the build completes.
* fix(build): fail fast when no .d.ts files found in verify-dts-imports
* chore: add exclude for consistency in react-query-next-experimental
* chore: fix log message to mention both .d.ts and .d.cts files
* ci: apply automated fixes
* chore: remove verify-dts-imports script and related package.json changes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* docs(react): clarify staleTime 'static' vs Infinity with 'always' triggers
* docs(react): lead with invalidateQueries() distinction for staleTime: 'static' vs Infinity
* test({react,preact}-query): move 'queryClient' and 'queryCache' to 'beforeEach' for per-test isolation
* test(solid-query): move 'queryClient' and 'queryCache' to 'beforeEach' for per-test isolation
* test({react,preact}-query): add 'queryClient.clear()' to 'afterEach' in 'useQuery' and 'useMutation'
* test({react,preact}-query): add 'queryClient.clear()' to 'afterEach' in 'ssr' and 'suspense'
* test({react,preact}-query/ssr): remove redundant 'queryCache.clear()' calls in individual tests
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* test({react,preact}-query/useSuspenseQueries): inline test helpers, remove shared 'queryClient', and use 'beforeEach'/'afterEach' for setup and teardown
* ci: apply automated fixes
* test({react,preact}-query/useSuspenseQueries): replace '[1] as const' with 'queryKey()' util and fix 'act' callback type in preact-query
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
The existing tests only exercised useQuery. The rule checks any object
property named queryFn, so it applies equally to useInfiniteQuery,
useSuspenseQuery, queryOptions(), and queryClient.fetchQuery(). Add
valid + invalid cases for each to document and lock in that behavior.
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
* test(eslint-plugin-query/stable-query-client): add tests for uncovered branches
Add 3 test cases to improve branch coverage of 'stable-query-client' rule from 78.57% to 92.85%.
- add valid case for arrow function component where fnAncestor has no id
- add valid case for async server component with @tanstack/react-query import
- add invalid case for destructuring pattern where autofix is not applicable
The existing valid tests for line 58 (non-component function, async component)
used @tanstack/solid-query imports, causing early return at the import check (line 44) and never reaching the target branch.
* test(eslint-plugin-query/stable-query-client): remove arrow function component valid case
Remove the arrow function component test case from valid cases.
The current rule does not detect `new QueryClient()` inside arrow function
components because `fnAncestor.id` is undefined for arrow functions.
This is a false negative (known limitation), not intended behavior.
Adding it as a valid case would bake that bug into the test suite and cause failures when the rule is fixed in the future.
---------
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
* feat(eslint-plugin): add allowlist option to exhaustive-deps rule
Introduce an `allowlist` option with `variables` and `types` arrays so
stable variables and types can be excluded from dependency enforcement.
Also report member expression dependencies more granularly for call
expressions (e.g. `a.b.foo()` suggests `a.b` instead of only `a`).
BREAKING CHANGE: exhaustive-deps now reports member expression deps more
granularly, so some previously passing code may now report missing deps.
Use the allowlist option to exclude stable variables/types as needed.
* fix
* ci: apply automated fixes
* increase coverage
* address false positives
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* chore: update changeset configuration to include fixed dependencies for various TanStack packages
* chore: update package versions across multiple examples and packages to 5.92.9, including Angular, React, Solid, Svelte, and Vue integrations
* chore: add changeset for version patches across multiple TanStack packages
* chore: update changeset configuration to include @tanstack/vue-query-devtools as a dependency
* feat: add support for Preact query packages in changeset configuration
* chore: update changeset configuration to include Preact query packages