* 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
* fix(streamedQuery): maintain error state on reset refetch with initialData defined
* ref: changeset
* fix: isRefetch computation
* test: add refetch behavior for reset mode after initial error
* test: add reset behavior for refetch after initial error with initialData
* ref: re-use isFetched in queryObserver.ts
* ref: function instead of getter