This skill guides you through migrating a JavaScript/TypeScript project from Prettier or Biome to
Oxfmt.
Overview
Oxfmt is a high-performance, Prettier-compatible code formatter. Most Prettier options are supported directly.
An automated migration tool is built into oxfmt, supporting both Prettier and Biome as migration sources.
Step 1: Run Automated Migration
From Prettier
bash
npx oxfmt@latest --migrate prettier
This will:
- Find and read your Prettier config (any format Prettier supports)
- Create with migrated options
- Migrate patterns to
- Migrate
prettier-plugin-tailwindcss
options to
- Detect
prettier-plugin-packagejson
and enable
From Biome
bash
npx oxfmt@latest --migrate biome
This will:
- Find and read or
- Create with migrated options
- Migrate negated patterns from to
- Map Biome's two-level config ( and ) to oxfmt options
Biome option mapping:
| Biome | oxfmt |
|---|
| (/) | (/) |
| |
| |
javascript.formatter.quoteStyle
| |
javascript.formatter.jsxQuoteStyle
| |
javascript.formatter.quoteProperties
() | () |
javascript.formatter.trailingCommas
| |
javascript.formatter.semicolons
(/) | (/) |
javascript.formatter.arrowParentheses
() | () |
formatter.bracketSameLine
| |
| |
formatter.attributePosition
() | () |
Notes (both sources):
- Fails if already exists. Delete it first if you want to re-run.
- If no source config is found, creates a blank instead.
- cannot be auto-migrated for either source and must be converted manually.
Step 2: Review Generated Config
After migration, review the generated
for these key differences:
printWidth
Prettier and Biome default is 80, oxfmt default is 100. The migration tool sets
if not specified in your source config. Decide whether to keep 80 or adopt 100.
Unsupported Options (Prettier only)
These Prettier options are skipped during migration:
| Option | Status |
|---|
| Not supported. Use or explicitly |
| Not supported in JS/TS files yet |
experimentalOperatorPosition
| Not supported in JS/TS files yet |
sortPackageJson (Prettier only)
Enabled by default in oxfmt, but the migration tool disables it unless
prettier-plugin-packagejson
was detected. Review whether you want this enabled.
Note: Oxfmt's sorting algorithm differs from
prettier-plugin-packagejson
.
embeddedLanguageFormatting (Prettier only)
Embedded language formatting (e.g., CSS-in-JS) generally works, but some formatting may differ from Prettier.
overrides
The
field cannot be auto-migrated from either Prettier or Biome. Convert manually:
json
{
"overrides": [
{
"files": ["*.md"],
"options": { "tabWidth": 4 }
}
]
}
Nested Config
Oxfmt does not support nested configuration files (e.g., a separate
in a subdirectory). If your project used per-directory Prettier or Biome configs, consolidate them using
with file glob patterns, or run oxfmt separately per directory with different working directories.
Prettier-Compatible Options
These options transfer directly with the same behavior:
,
,
,
,
,
,
,
,
,
,
,
,
htmlWhitespaceSensitivity
,
,
Step 3: Configure Oxfmt Extensions
Oxfmt offers features not available in Prettier:
sortImports
Sort import statements, inspired by
eslint-plugin-perfectionist/sort-imports
(disabled by default):
json
{
"sortImports": {
"partitionByNewline": true,
"newlinesBetween": false
}
}
sortTailwindcss
Replaces
prettier-plugin-tailwindcss
. Auto-migrated with renamed options:
| Prettier (top-level) | oxfmt () |
|---|
| |
| |
| |
| |
tailwindPreserveWhitespace
| |
tailwindPreserveDuplicates
| |
Other Extensions
| Option | Default | Description |
|---|
| | Whether to add a final newline at end of file |
| | Sort keys. Set to also sort scripts |
Step 4: Update CI and Scripts
Replace formatter commands with oxfmt:
bash
# Before (Prettier)
npx prettier --write .
npx prettier --check .
# Before (Biome)
npx biome format --write .
npx biome check .
# After
npx oxfmt@latest
npx oxfmt@latest --check
Common CLI Options
| Prettier / Biome | oxfmt |
|---|
| / | (default: cwd, mode) |
| / | |
prettier --list-different .
| |
| |
prettier --ignore-path .prettierignore
| oxfmt --ignore-path .prettierignore
|
cat file | prettier --stdin-filepath=file.ts
| cat file | oxfmt --stdin-filepath=file.ts
|
File Type Coverage
- JS/TS: Formatted natively by oxfmt
- TOML: Formatted natively (via taplo)
- CSS, HTML, YAML, Markdown, GraphQL, etc.: Delegated to Prettier internally (when using )
Tips
- EditorConfig: Oxfmt reads automatically for , , , , and . Options in take precedence.
- CI: Use to enforce formatting in CI.
- LSP: Run for editor integration via Language Server Protocol.
- Schema support: Add
"$schema": "./node_modules/oxfmt/configuration_schema.json"
to for editor autocompletion.
- Init: Run to create a default without migration.
References