oxfmt
Fast JavaScript formatter from the Oxc compiler project.
3. Used by agents' projects
Dependency in 168 public GitHub projects set up for AI coding agents that we scanned (2.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
oxc.rs/llms.txtFrom the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What oxfmt does
Oxfmt is the Oxc project's Rust formatter. Its maintainers say it passes 100% of Prettier's JavaScript and TypeScript conformance tests, and it builds in Tailwind class sorting, import sorting and package.json field sorting.
oxfmt popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How oxfmt is used
- oxfmt is a dependency in 168 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (3.5% of the 4,867 JavaScript/TypeScript ones), #5 of 83 in linting and formatting.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 287; those are left out of every share on this page.
- The most used alternative in our scan is Prettier (1,320 projects).
- Projects that use it most often also use oxlint (92.9%), oxlint-tsgolint (44.6%), Vitest (56.5%).
- It is more common in projects set up for OpenClaw (10.5%) than for Devin Desktop (1.8%).
By coding agent
Often used with
oxfmt in practice
Strengths
The maintainers say Oxfmt passes 100% of Prettier's JavaScript and TypeScript conformance tests. They write that you can migrate "with confidence that your code will be formatted identically." They report the few remaining inconsistencies to the Prettier team.
The beta lists JSON variants, YAML, TOML, HTML, Vue, Angular, CSS, SCSS, Less, Markdown, MDX, GraphQL, Ember and Handlebars. It also formats CSS-in-JS and Angular templates embedded in template literals.
The beta post says the functionality of <code>prettier-plugin-tailwindcss</code> is built in, for both JS/TS and other files. Import sorting is built in too, with options such as <code>ignoreCase</code>, <code>sortSideEffects</code> and <code>newlinesBetween</code>.
<code>oxfmt --migrate prettier</code> and <code>oxfmt --migrate biome</code> convert an existing config. The blog chains install, migrate and reformat into one command.
Watch out for
The project announced Oxfmt as beta, and the website still labels it that way. The roadmap to a stable release lists stability and performance work.
As of the beta announcement, Prettier plugin support was listed as roadmap work toward stable, along with better xxx-in-js formatting. Check its current status if you rely on a Prettier plugin.
Ching writes that Oxfmt replaces Prettier's native rules but that some plugins need trade-offs. In Ching's case, that meant dropping Pangu spacing formatting for Markdown for now.
Migrate from Prettier in one command
pnpm add -D oxfmt && pnpm oxfmt --migrate prettier && pnpm oxfmtMore about oxfmt
Funding
- Open Collective: https://opencollective.com/oxc
- GitHub Sponsors: https://github.com/sponsors/oxc-project
- 5 GitHub sponsors
Packages around it
- oxlint: Oxc's linter, same project
- oxlint-tsgolint: Type-aware lint add-on for Oxlint
- vitest: Test runner
- typescript: Type checker and compiler
- zod: Schema validation
- dotenv: Env file loader
More in Linting and formatting
Alternatives
oxfmt This page
Opinionated code formatter for JavaScript, TypeScript, and related languages.
Fast web toolchain providing linting, formatting and code quality all in one.
Get started
Install it.
npm install oxfmtRules for your agent
## oxfmt
- Install as a dev dependency (`pnpm add -D oxfmt`). Add `"fmt": "oxfmt"` and `"fmt:check": "oxfmt --check"` scripts.
- In CI, run `oxfmt --check`, not the write mode.
- In lint-staged, use `oxfmt --no-error-on-unmatched-pattern`.
- When replacing Prettier or Biome, run `oxfmt --migrate prettier` or `oxfmt --migrate biome` first. Then reformat with `oxfmt` and uninstall the old packages.
- Do not add `prettier-plugin-tailwindcss`: Tailwind class sorting is built in.
- For a typed config, use `oxfmt.config.ts` with `defineConfig` from `oxfmt`. `oxfmt .` discovers it automatically, so no config path flag is needed.
- After migrating, update CONTRIBUTING.md, AGENTS.md or CLAUDE.md if they still mention prettier.