Oxfmt
Oxfmt is a high-performance formatter for the JavaScript ecosystem. It is Prettier-compatible (matching 100% of Prettier’s JS/TS conformance tests) and supports a wide range of languages out of the box — including TypeScript, JSX, JSON, CSS, SCSS, Less, Markdown, MDX, HTML, Vue, and Astro.
Oxfmt is a drop-in replacement for Prettier (and the formatting part of Biome) that is ≈30× faster. Its CLI behaves similarly to Prettier, so adoption requires minimal changes to scripts and tooling.
Installation
Section titled “Installation”npm i oxfmtyarn add oxfmtpnpm add oxfmtbun add oxfmtConfiguration
Section titled “Configuration”Oxfmt options live in an oxfmt.config.ts file (Prettier-style keys):
import { defineConfig } from 'oxfmt'
export default defineConfig({ printWidth: 80, useTabs: false, tabWidth: 2, semi: false, singleQuote: true, arrowParens: 'avoid', trailingComma: 'all',})Key options
Section titled “Key options”| Option | Type | Default | Notes |
|---|---|---|---|
printWidth | integer | 100 | Max line length before wrapping |
tabWidth | integer | 2 | Spaces per indentation level |
useTabs | boolean | false | Use tabs instead of spaces |
semi | boolean | true | Print semicolons at end of statements |
singleQuote | boolean | false | Use single quotes |
arrowParens | "always" | "avoid" | "always" | Parens around sole arrow function parameter |
trailingComma | "all" | "es5" | "none" | "all" | Trailing commas in multi-line structures |
endOfLine | "lf" | "crlf" | "cr" | "lf" | Line ending style |
sortImports | object | disabled | Sort import statements (built-in) |
Built-in import sorting
Section titled “Built-in import sorting”Unlike Prettier, Oxfmt ships with import sorting baked in — no extra plugin needed:
{ sortImports: { internalPattern: ['~/', '@/'] }}Scripts
Section titled “Scripts”Add to package.json:
{ "scripts": { "format": "oxfmt --write", "format:check": "oxfmt --check" }}VS Code integration
Section titled “VS Code integration”Install the Oxc extension and configure it as the default formatter:
{ "editor.formatOnSave": true, "editor.defaultFormatter": "oxc.oxc-vscode", "[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, "[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, "[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, "[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, "[json]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, "[css]": { "editor.codeActionsOnSave": { "source.fixAll.stylelint": "explicit" } }}