Skip to content

chore: replace prettier with oxfmt - #11939

Merged
DogPawHat merged 1 commit into
mainfrom
chore/prettier-to-oxfmt
Oct 9, 2026
Merged

DogPawHat merged 1 commit into
mainfrom
chore/prettier-to-oxfmt

Conversation

@DogPawHat

@DogPawHat DogPawHat commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

Stacked on #11938

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.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 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

  • Chores
    • Switched the project’s code formatting to a new formatter and updated its configuration.
    • Reformatted source code, examples, and documentation; application behavior and accepted types remain unchanged.

@DogPawHat
DogPawHat requested a review from a team as a code owner October 9, 2026 15:06
@DogPawHat DogPawHat mentioned this pull request Oct 9, 2026
4 of 5 tasks
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

⚙️ Run configuration
  • Configuration used: Repository: TanStack/query/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb0bac7c-b1c0-4c18-8fa9-1b327c50f2ec

📥 Commits

Reviewing files that changed from the base of the PR and between 32b77a3 and 385242d.


⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TanStack/query/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2e25ac6c-5c06-451a-a633-b6064e41212b

📥 Commits

Reviewing files that changed from the base of the PR and between 23260ab and 32b77a3.


⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

📒 Files selected for processing (36)
  • .oxfmtrc.json
  • .prettierignore
  • docs/framework/lit/guides/ssr.md
  • examples/lit/ssr/src/app.ts
  • package.json
  • packages/angular-query-experimental/src/pending-tasks-compat.ts
  • packages/angular-query-experimental/src/query-options.ts
  • packages/lit-query/src/QueryClientProvider.ts
  • packages/lit-query/src/__tests__/createQueryController.test-d.ts
  • packages/lit-query/src/controllers/BaseController.ts
  • packages/lit-query/src/createMutationController.ts
  • packages/lit-query/src/queryOptions.ts
  • packages/preact-query/src/__tests__/useQuery.test-d.tsx
  • packages/preact-query/src/queryOptions.ts
  • packages/preact-query/src/suspense.ts
  • packages/query-core/src/__tests__/infiniteQueryBehavior.test.tsx
  • packages/query-core/src/__tests__/utils.test-d.tsx
  • packages/query-core/src/query.ts
  • packages/query-core/src/queryCache.ts
  • packages/query-core/src/queryObserver.ts
  • packages/query-core/src/types.ts
  • packages/query-devtools/src/utils.tsx
  • packages/react-query/src/__tests__/useQuery.test-d.tsx
  • packages/react-query/src/queryOptions.ts
  • packages/react-query/src/suspense.ts
  • packages/solid-query/src/QueryClient.ts
  • packages/solid-query/src/useBaseQuery.ts
  • packages/svelte-query/src/queryOptions.ts
  • packages/vue-query/src/__tests__/useMutation.test.ts
  • packages/vue-query/src/queryOptions.ts
  • packages/vue-query/src/useBaseQuery.ts
  • packages/vue-query/src/useIsFetching.ts
  • packages/vue-query/src/useMutationState.ts
  • packages/vue-query/src/useQuery.ts
  • prettier.config.js
  • scripts/generate-labeler-config.ts

💤 Files with no reviewable changes (2)
  • .prettierignore
  • prettier.config.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The repository replaces Prettier with Oxfmt for formatting commands and labeler YAML generation. It adds Oxfmt configuration and reformats existing source, test, and documentation code without changing the described types or runtime behavior.

Changes

Formatting toolchain and migration

Layer / File(s) Summary
Configure Oxfmt and update formatting scripts
.oxfmtrc.json, package.json, scripts/generate-labeler-config.ts, .prettierignore, prettier.config.js
The format script and labeler-config generator use Oxfmt. The new root configuration supplies formatter options and ignore patterns. The Prettier configuration and ignore file are removed.
Reformat existing code and documentation
docs/framework/lit/guides/ssr.md, examples/lit/ssr/src/app.ts, packages/angular-query-experimental/src/*, packages/lit-query/src/*, packages/preact-query/src/*, packages/query-core/src/*, packages/query-devtools/src/utils.tsx, packages/react-query/src/*, packages/solid-query/src/*, packages/svelte-query/src/*, packages/vue-query/src/*
Existing type declarations, tests, and formatting are reformatted. The summaries report no changes to accepted types or runtime behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other


Merge Risk: ⚪ Minimal · up to 32b77

No actionable regression is established in this formatting-tool migration; it is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 31 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the primary change: replacing Prettier with oxfmt.
Description check Passed The description explains the migration, configuration changes, affected tooling, testing status, and release impact. All required template sections are present and completed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 31 files. (3 skipped: 3 unsupported.)



✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@DogPawHat DogPawHat mentioned this pull request Oct 9, 2026
4 of 5 tasks
@changeset-bot

changeset-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 385242d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud

nx-cloud Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 385242d

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

☁️ Nx Cloud last updated this comment at 2026-10-09 15:39:11 UTC

@socket-security

socket-security Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedoxfmt@​0.72.0941008896100

View full report

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

2 package(s) bumped directly, 23 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/query-core 5.104.1 → 5.104.2 Changeset
@tanstack/vue-query 5.104.1 → 5.104.2 Changeset
@tanstack/angular-query-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/angular-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/eslint-plugin-query 5.104.1 → 5.104.2 Dependent
@tanstack/lit-query 0.2.26 → 0.2.27 Dependent
@tanstack/preact-query 5.104.1 → 5.104.2 Dependent
@tanstack/preact-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/preact-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/query-async-storage-persister 5.104.1 → 5.104.2 Dependent
@tanstack/query-broadcast-client-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/query-persist-client-core 5.104.1 → 5.104.2 Dependent
@tanstack/query-sync-storage-persister 5.104.1 → 5.104.2 Dependent
@tanstack/react-query 5.104.1 → 5.104.2 Dependent
@tanstack/react-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/react-query-next-experimental 5.104.1 → 5.104.2 Dependent
@tanstack/react-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query-devtools 5.104.1 → 5.104.2 Dependent
@tanstack/solid-query-persist-client 5.104.1 → 5.104.2 Dependent
@tanstack/svelte-query 6.3.1 → 6.3.2 Dependent
@tanstack/svelte-query-devtools 6.3.1 → 6.3.2 Dependent
@tanstack/svelte-query-persist-client 6.3.1 → 6.3.2 Dependent
@tanstack/vue-query-devtools 6.3.1 → 6.3.2 Dependent

@DogPawHat
DogPawHat added this pull request to stack #11940 October 9, 2026 15:07
@pkg-pr-new

pkg-pr-new Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11939

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11939

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 385242d

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.73 KB (0%)
react minimal 8.58 KB (0%)

@DogPawHat
DogPawHat force-pushed the chore/prettier-to-oxfmt branch from ad252f3 to 32b77a3 Compare October 9, 2026 15:13
@sukvvon

sukvvon commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

@DogPawHat I verified the switch locally:

  • Running oxfmt --check with this .oxfmtrc.json against main (formatted by Prettier), md, json, js/cjs/mjs/jsx, html, vue, css and yml/yaml all match, except docs/framework/lit/guides/ssr.md, which this PR already includes.
  • All 86 .svelte files match too. oxfmt 0.72.0 bundles prettier-plugin-svelte@4.1.1 and prettier@3.9.9, the same versions as on main, and the root svelte devDependency is required for it. Without it, formatting .svelte files fails.

I don't think this needs to be stacked on #11938, though. Cherry-picking this commit onto main only conflicts in package.json (adjacent devDependencies), pnpm-lock.yaml, and the mutationKey cast in vue-query/src/__tests__/useMutation.test.ts. None of these is a real dependency between the two. Keeping both PRs on main would let the formatter switch land without waiting for the larger oxlint migration, and whichever merges second just needs pnpm install and pnpm format.

Base automatically changed from chore/eslint-to-oxlint to main October 9, 2026 15:35
Swap the root formatter from Prettier to oxfmt, keeping the existing style
(no semicolons, single quotes, trailing commas, 80 columns). The config and
ignore patterns were migrated with `oxfmt --migrate=prettier`.

- Pin `oxfmt` and declare `svelte` at the root, since oxfmt needs
  `svelte/compiler` to format `.svelte` files and only lists it as an
  optional peer
- Port `scripts/generate-labeler-config.ts` to oxfmt's `format()` API
  (output is identical to Prettier's)
- Reformat 31 files where oxfmt still uses the pre-3.9 Prettier layout for
  union types that break onto their own line, plus one CSS-in-JS value

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DogPawHat
DogPawHat force-pushed the chore/prettier-to-oxfmt branch from 32b77a3 to 385242d Compare October 9, 2026 15:35
@DogPawHat

Copy link
Copy Markdown
Collaborator Author

Yeah I stacked them initially because #11938 had bundled in a fix for the JSDoc issue before #11937 merged in.

@DogPawHat
DogPawHat merged commit 833062c into main Oct 9, 2026
9 checks passed
@DogPawHat
DogPawHat deleted the chore/prettier-to-oxfmt branch October 9, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants