* fix(preact-query): retry on mount for falsy errors when throwOnError returns false
`ensurePreventErrorBoundaryRetry` only evaluated a function-valued
`throwOnError` when `query.state.error` was truthy. For a query that
rejected with a falsy value (e.g. `undefined`), the callback was skipped
and the function itself was treated as truthy, so `retryOnMount` was
disabled even though `throwOnError` would have returned `false`.
Check `query.state.status === 'error'` instead so the callback runs for
every failed query. Ports #11328 to preact-query.
* refactor(preact-query): keep throwOnError constant
---------
Co-authored-by: TkDodo <office@dorfmeister.cc>
* fix({preact,solid,svelte,angular-query-experimental}): switch to 'export type *' for type-only re-exports
* chore(.changeset/export-type-star-adapters): trim redundant PR cross-reference from changeset body
* feat(preact-query*): support Preact v11
* fix(preact-query*): pass an initial value to 'useRef' and flush deferred unmount effect cleanups in tests for Preact v11
* chore(preact-query*): develop and test against Preact 11
Bump the preact catalog and the preact example to ^11.0.1, and
preact-render-to-string to ^6.8.0 (Preact 11 peers on >=6.7.0).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replace prettier with oxfmt
The options and ignores have been ported to the `.oxfmtrc.json` file (oxfmt `printWidth` default is 100 characters, so preserving 80 for now). While the configuration with Prettier is the same, oxfmt seems to modify some things slightly differently, apparently due to the use of a pre-3.9 Prettier layout for union types that break onto their own line so we still end up with about 30 files changed.
Files with actual changes are:
- `.prettierignore`.`prettier.config.js`: Deleted. Replaced with `.oxfmtrc.json`
- `package.json`: `format` script changed to `oxfmt`. Added `oxfmt` and `svelte` as `devDependencies`; removed `prettier` and `prettier-plugin-svelte`.
- `pnpm-lock.yaml`: Lockfile update for the dependency changes above.
- `scripts/generate-labeler-config.ts`: Formats with oxfmt's `format()` API instead of Prettier's. It reads `.oxfmtrc.json` itself, because the API doesn't find config files on its own, and throws if formatting reports errors. Its output is identical to what Prettier produced.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore: replace eslint with oxlint
Migrates to oxlint as the replacement linter for eslint.
Keeps the existing ruleset, runs js plugins for non-native oxlint rules and the local no-restricted-syntax plugin
Svelte packages keep a slim ESLint config for the svelte/* rules, which need the component template.
React examples that use the query eslint plugin also still use eslint for now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: use oxlint disable directives
ESLint no longer lints these files, so switch eslint-disable comments to
oxlint-disable and the @typescript-eslint/ prefix to typescript/. Remove
directives that oxlint reports as unused, and name the rule in the
cspell oxlint-enable comments, which oxlint does not match to a
rule-specific disable otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: lint expectTypeOf with vitest valid-expect
Oxlint's native vitest/valid-expect only checks `expect` calls, so load
@vitest/eslint-plugin as a JS plugin for this rule to keep flagging
`expectTypeOf` calls without a matcher, and restore the directives for
the intentional ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* docs(preact-query): add JSDoc to the exported classes, methods, and arrow functions
* docs(preact-query-persist-client/PersistQueryClientProvider): describe what is deferred while restoring and when the callbacks run
* docs(*): note that 'throwOnError' makes the hook rethrow the errors of 'mutate'
* docs(angular-query-experimental/types): mention that 'injectMutation' emits the error on 'ngZone.onError' before rethrowing it
* docs(*): fix JSDoc '@param' names that don't match the parameters
* chore(eslint.config): raise 'jsdoc/check-param-names' to error without requiring destructured properties
* test(*): start test titles with 'should'
* test(*): start the remaining test titles with 'should'
* test(eslint-plugin-query): start 'it.each' titles with 'should'
* test({react,preact}-query/useSuspenseQueries): fix title to match the assertion that 'TData' excludes 'undefined'
* refactor(preact-query*): rename local 'useRef' variables with the 'Ref' suffix
* test(preact-query): name 'useState' value and setter pairs and use stable keys
* chore(*): replace 'typescript-eslint' with '@typescript-eslint/parser' in preact packages and remove redundant eslint options
* style(*): add a blank line after '@ts-check' and remove the blank line between imports in preact eslint configs
* test({react-query,preact-query}): keep each action, wait and assertion together and separate each new user action
* test({react-query,preact-query}): remove remaining blank lines around a commented assertion and 'act' wait blocks
* test(react-query/useSuspenseQueries): remove blank line between the 'fireEvent' wrapped in 'expect' and its wait
* test({react-query,preact-query}): add blank lines after setup such as 'renderWithClient', 'rerender' and 'queryClient' calls
* test({react-query,preact-query}-persist-client): remove blank lines between assertions, waits and their assertions
* test(react-query/transition): remove blank lines between 'act' wrapped 'fireEvent' and its assertions
* test({react-query,preact-query}): add blank lines before 'fireEvent' after multi-line assertions and keep prefetch with its wait
* test(query-core/utils): restore the previous 'isServer' value in 'setIsServer' instead of the deprecated 'isServer' constant
* test(react-query/utils): restore the previous 'isServer' value in 'setIsServer' instead of the deprecated 'isServer' constant
* test(preact-query/utils): restore the previous 'isServer' value in 'setIsServer' instead of the deprecated 'isServer' constant
* test({query-core,react-query,preact-query}/utils): rename 'original' to 'originalIsServer' in 'setIsServer'
* docs({react-query,preact-query,solid-query,svelte-query}/README): point the CI badge at the 'release.yml' workflow on 'main'
* docs({react-query,preact-query,solid-query,svelte-query}/README): add alt text to the release badge