PluginBench
Skill
Review
Audit score 70

migrate-oxfmt

oxc-project/oxc

Migrate your JavaScript/TypeScript project from Prettier or Biome to Oxfmt with automated config conversion.

What is migrate-oxfmt?

This skill guides you through migrating a project from Prettier or Biome to Oxfmt, a high-performance Prettier-compatible formatter. Use it when you need to switch formatters and want to preserve your existing formatting preferences.

  • Automatically migrate Prettier or Biome configuration to `.oxfmtrc.json`
  • Convert ignore patterns from `.prettierignore` or Biome's `files.includes`
  • Map formatter options between source and target tools with a detailed conversion table
  • Handle Prettier plugins like `prettier-plugin-tailwindcss` and `prettier-plugin-packagejson`
  • Identify unsupported options and provide guidance on manual conversion
  • Update CI/build scripts to use oxfmt commands

How to install migrate-oxfmt

npx skills add null --skill migrate-oxfmt
Prerequisites
  • Node.js and npm installed
  • Existing Prettier or Biome configuration in your project
  • `.oxfmtrc.json` should not already exist (delete it first if re-running migration)
Claude Code
Cursor
Windsurf
Cline

How to use migrate-oxfmt

  1. 1.Run the automated migration: `npx oxfmt@latest --migrate prettier` (for Prettier) or `npx oxfmt@latest --migrate biome` (for Biome)
  2. 2.Review the generated `.oxfmtrc.json` for key differences like `printWidth` (oxfmt defaults to 100 vs Prettier's 80)
  3. 3.Check for unsupported options: `endOfLine: "auto"`, `experimentalTernaries`, `experimentalOperatorPosition`, and manually convert `overrides` if present
  4. 4.Configure optional Oxfmt extensions like `sortImports` or `sortTailwindcss` if needed
  5. 5.Update your CI scripts and package.json to replace formatter commands with oxfmt equivalents

Use cases

Good for
  • Switching a Prettier-based project to Oxfmt for faster formatting performance
  • Converting a Biome formatter setup to Oxfmt while keeping configuration intact
  • Migrating monorepo formatting from Prettier to Oxfmt with minimal manual work
  • Consolidating per-directory formatter configs into a single Oxfmt setup using overrides
  • Updating CI pipelines to use oxfmt instead of Prettier or Biome commands
Who it's for
  • JavaScript/TypeScript developers switching formatters
  • DevOps engineers updating CI/CD pipelines
  • Teams migrating from Prettier or Biome to Oxfmt
  • Maintainers of projects with complex formatting requirements

migrate-oxfmt FAQ

What if my `.oxfmtrc.json` already exists?

Delete the existing `.oxfmtrc.json` file first, then re-run the migration command.

Can Oxfmt migrate the `overrides` field automatically?

No, `overrides` cannot be auto-migrated from either Prettier or Biome and must be converted manually using glob patterns.

Does Oxfmt support nested configuration files like Prettier?

No, Oxfmt does not support nested configuration files. Consolidate per-directory configs using `overrides` with file glob patterns or run oxfmt separately per directory.

What happens if no source config is found?

The migration tool creates a blank `.oxfmtrc.json` instead of failing.

How do I update my CI/CD pipeline?

Replace `prettier --write .` with `oxfmt`, `prettier --check .` with `oxfmt --check`, and similar for Biome commands. See the CLI options table for full mappings.

Full instructions (SKILL.md)

Source of truth, from oxc-project/oxc.


name: migrate-oxfmt description: Guide for migrating a project from Prettier or Biome to Oxfmt. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's formatter from Prettier or Biome to Oxfmt.

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

npx oxfmt@latest --migrate prettier

This will:

  • Find and read your Prettier config (any format Prettier supports)
  • Create .oxfmtrc.json with migrated options
  • Migrate .prettierignore patterns to ignorePatterns
  • Migrate prettier-plugin-tailwindcss options to sortTailwindcss
  • Detect prettier-plugin-packagejson and enable sortPackageJson

From Biome

npx oxfmt@latest --migrate biome

This will:

  • Find and read biome.json or biome.jsonc
  • Create .oxfmtrc.json with migrated options
  • Migrate negated patterns from files.includes to ignorePatterns
  • Map Biome's two-level config (formatter.* and javascript.formatter.*) to oxfmt options

Biome option mapping:

Biomeoxfmt
formatter.indentStyle ("tab"/"space")useTabs (true/false)
formatter.indentWidthtabWidth
formatter.lineWidthprintWidth
javascript.formatter.quoteStylesingleQuote
javascript.formatter.jsxQuoteStylejsxSingleQuote
javascript.formatter.quoteProperties ("asNeeded")quoteProps ("as-needed")
javascript.formatter.trailingCommastrailingComma
javascript.formatter.semicolons ("always"/"asNeeded")semi (true/false)
javascript.formatter.arrowParentheses ("asNeeded")arrowParens ("avoid")
formatter.bracketSameLinebracketSameLine
formatter.bracketSpacingbracketSpacing
formatter.attributePosition ("multiline")singleAttributePerLine (true)

Notes (both sources):

  • Fails if .oxfmtrc.json already exists. Delete it first if you want to re-run.
  • If no source config is found, creates a blank .oxfmtrc.json instead.
  • overrides cannot be auto-migrated for either source and must be converted manually.

Step 2: Review Generated Config

After migration, review the generated .oxfmtrc.json for these key differences:

printWidth

Prettier and Biome default is 80, oxfmt default is 100. The migration tool sets printWidth: 80 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:

OptionStatus
endOfLine: "auto"Not supported. Use "lf" or "crlf" explicitly
experimentalTernariesNot supported in JS/TS files yet
experimentalOperatorPositionNot 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 overrides field cannot be auto-migrated from either Prettier or Biome. Convert manually:

{
  "overrides": [
    {
      "files": ["*.md"],
      "options": { "tabWidth": 4 }
    }
  ]
}

Nested Config

Oxfmt does not support nested configuration files (e.g., a separate .oxfmtrc.json in a subdirectory). If your project used per-directory Prettier or Biome configs, consolidate them using overrides 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: tabWidth, useTabs, semi, singleQuote, jsxSingleQuote, quoteProps, trailingComma, arrowParens, bracketSpacing, bracketSameLine, endOfLine, proseWrap, htmlWhitespaceSensitivity, singleAttributePerLine, vueIndentScriptAndStyle

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):

{
  "sortImports": {
    "partitionByNewline": true,
    "newlinesBetween": false
  }
}

sortTailwindcss

Replaces prettier-plugin-tailwindcss. Auto-migrated with renamed options:

Prettier (top-level)oxfmt (sortTailwindcss.*)
tailwindConfigconfig
tailwindStylesheetstylesheet
tailwindFunctionsfunctions
tailwindAttributesattributes
tailwindPreserveWhitespacepreserveWhitespace
tailwindPreserveDuplicatespreserveDuplicates

Other Extensions

OptionDefaultDescription
insertFinalNewlinetrueWhether to add a final newline at end of file
sortPackageJsontrueSort package.json keys. Set { "sortScripts": true } to also sort scripts

Step 4: Update CI and Scripts

Replace formatter commands with oxfmt:

# 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 / Biomeoxfmt
prettier --write . / biome format --write .oxfmt (default: cwd, --write mode)
prettier --check . / biome check .oxfmt --check
prettier --list-different .oxfmt --list-different
prettier --config pathoxfmt --config path
prettier --ignore-path .prettierignoreoxfmt --ignore-path .prettierignore
cat file | prettier --stdin-filepath=file.tscat 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 npx oxfmt)

Tips

  • EditorConfig: Oxfmt reads .editorconfig automatically for useTabs, tabWidth, endOfLine, insertFinalNewline, and printWidth. Options in .oxfmtrc.json take precedence.
  • CI: Use npx oxfmt@latest --check to enforce formatting in CI.
  • LSP: Run oxfmt --lsp for editor integration via Language Server Protocol.
  • Schema support: Add "$schema": "./node_modules/oxfmt/configuration_schema.json" to .oxfmtrc.json for editor autocompletion.
  • Init: Run npx oxfmt@latest --init to create a default .oxfmtrc.json without migration.

References