Oxfmt
Use this skill when work touches Oxfmt or Oxc formatting: install/config, day-to-day usage, Prettier/Biome migration, sorting extras, language support, editors, or CI --check gates.
Workflow
- Inspect the local Oxfmt surface before changing code:
- Package version for
oxfmt (still 0.x / beta until 1.0).
- Config: prefer
oxfmt.config.ts / .mts with defineConfig; also accept .oxfmtrc.json(c) (one type per directory); Vite+ may use fmt in vite.config.ts instead.
- Remaining Prettier/Biome setup,
.prettierignore, scripts (fmt / fmt:check), editor default formatter.
- For setup, how-to, style choices, sorting, monorepos, pairing with Oxlint, or troubleshooting, follow the full guide first: usage-guide.md.
- Refresh current official docs when versions differ from the snapshot or the work touches language support, sorting, or migration. Start from source-map.md.
- Route deeper detail to the focused references:
- Install, CLI, config options, editorconfig: setup-cli-config.md.
- Languages, sorting (including Tailwind
sortTailwindcss), ignores, inline comments: languages-sorting-ignores.md.
- Prettier/Biome migration, coexistence, CI, and
.vscode settings (format / sort imports / remove unused): prettier-migration-ci.md.
- Preserve the project's print width and quote/semi style unless migrating or the user asks to change them.
- Verify with
bunx oxfmt --check (CI) or bunx oxfmt (write) on the touched paths.
Core Judgment
- Oxfmt is Prettier-compatible for JS/TS (aim: match Prettier output; diffs vs recent Prettier are bugs). It is not 1.0 yet — pin lockfiles.
- Default mode is write. CI gate is
oxfmt --check (exit 1 on drift).
- No Prettier-style CLI style flags (
--no-semi, etc.) — style lives in the config file only.
- Default
printWidth is 100, not Prettier's 80. Set printWidth: 80 when migrating to minimize diffs.
- Prefer
oxfmt.config.ts + defineConfig for new configs. Keep or use .oxfmtrc.json only when the project already has it. --init / --migrate may still write JSON — convert to TS when adding a new config.
- Prefer
ignorePatterns for new projects; .prettierignore still works during migration.
- Built-in sorting (
sortImports, sortTailwindcss, sortPackageJson, jsdoc) replaces Prettier plugins — Prettier plugins are unsupported.
- Tailwind: enable
sortTailwindcss; set stylesheet (v4) or config (v3); list helpers in functions (cn/clsx/…). Paths are relative to the Oxfmt config.
sortPackageJson defaults on — expect package.json diffs; disable if unwanted.
- Editor: Oxfmt owns format + import/Tailwind sort on save; Oxlint owns unused removal via
source.fixAll.oxc. Disable TS organizeImports / removeUnusedImports to avoid fighting Oxc.
- Do not run Oxfmt alongside Prettier or Biome as formatters in the same pipeline.
- Oxfmt formats; it does not replace a linter. Drop
eslint-plugin-prettier; keep eslint-config-prettier only if ESLint remains.
- Astro and formats that need Prettier plugins may be blockers until Oxfmt supports them.
Verification
Prefer repository-owned commands. For meaningful Oxfmt work, cover the relevant subset:
bunx oxfmt --check on changed paths or the whole repo for CI parity.
bunx oxfmt locally / lint-staged when applying format.
- After Prettier migration: spot-check JS/TS diffs; confirm
printWidth intent; remove Prettier scripts/deps when ready.
- Sorting: confirm
sortImports / Tailwind (stylesheet or config + functions) / package.json behavior matches team expectations.
- Editor format-on-save +
source.fixAll.oxc smoke when changing the Oxc extension settings; confirm TS organize-imports is off.
Report which checks ran, which did not, and any 0.x maturity or language-support assumptions that remain.
1---2name: oxfmt3description: Build, review, debug, configure, migrate, teach, or plan Oxfmt JavaScript/TypeScript formatting with current Oxc docs and a full usage guide. Use for oxfmt how-to, oxfmt.config.ts, defineConfig, .oxfmtrc.json, Prettier migration, --check/--write, printWidth, sortImports, sortTailwindcss Tailwind class sorting (stylesheet/config/functions), sortPackageJson, ignorePatterns, oxfmt-ignore, language support, Biome migration, Vite+ fmt, VS Code/Cursor .vscode/settings.json format-on-save, auto sort imports, remove unused via Oxlint source.fixAll.oxc, editors, CI format gates, and day-to-day format workflows.4---56# Oxfmt78Use this skill when work touches Oxfmt or Oxc formatting: install/config, day-to-day usage, Prettier/Biome migration, sorting extras, language support, editors, or CI `--check` gates.910## Workflow11121. Inspect the local Oxfmt surface before changing code:13 - Package version for `oxfmt` (still **0.x / beta** until 1.0).14 - Config: prefer `oxfmt.config.ts` / `.mts` with `defineConfig`; also accept `.oxfmtrc.json(c)` (one type per directory); Vite+ may use `fmt` in `vite.config.ts` instead.15 - Remaining Prettier/Biome setup, `.prettierignore`, scripts (`fmt` / `fmt:check`), editor default formatter.162. For setup, how-to, style choices, sorting, monorepos, pairing with Oxlint, or troubleshooting, follow the full guide first: [usage-guide.md](references/usage-guide.md).173. Refresh current official docs when versions differ from the snapshot or the work touches language support, sorting, or migration. Start from [source-map.md](references/source-map.md).184. Route deeper detail to the focused references:19 - Install, CLI, config options, editorconfig: [setup-cli-config.md](references/setup-cli-config.md).20 - Languages, sorting (including Tailwind `sortTailwindcss`), ignores, inline comments: [languages-sorting-ignores.md](references/languages-sorting-ignores.md).21 - Prettier/Biome migration, coexistence, CI, and `.vscode` settings (format / sort imports / remove unused): [prettier-migration-ci.md](references/prettier-migration-ci.md).225. Preserve the project's print width and quote/semi style unless migrating or the user asks to change them.236. Verify with `bunx oxfmt --check` (CI) or `bunx oxfmt` (write) on the touched paths.2425## Core Judgment2627- Oxfmt is **Prettier-compatible** for JS/TS (aim: match Prettier output; diffs vs recent Prettier are bugs). It is **not** 1.0 yet — pin lockfiles.28- Default mode is **write**. CI gate is `oxfmt --check` (exit 1 on drift).29- **No Prettier-style CLI style flags** (`--no-semi`, etc.) — style lives in the config file only.30- Default `printWidth` is **100**, not Prettier's 80. Set `printWidth: 80` when migrating to minimize diffs.31- Prefer **`oxfmt.config.ts`** + `defineConfig` for new configs. Keep or use `.oxfmtrc.json` only when the project already has it. `--init` / `--migrate` may still write JSON — convert to TS when adding a new config.32- Prefer `ignorePatterns` for new projects; `.prettierignore` still works during migration.33- Built-in sorting (`sortImports`, `sortTailwindcss`, `sortPackageJson`, `jsdoc`) replaces Prettier plugins — Prettier plugins are **unsupported**.34- Tailwind: enable `sortTailwindcss`; set `stylesheet` (v4) or `config` (v3); list helpers in `functions` (`cn`/`clsx`/…). Paths are relative to the Oxfmt config.35- `sortPackageJson` defaults **on** — expect `package.json` diffs; disable if unwanted.36- Editor: Oxfmt owns format + import/Tailwind sort on save; Oxlint owns unused removal via `source.fixAll.oxc`. Disable TS `organizeImports` / `removeUnusedImports` to avoid fighting Oxc.37- Do not run Oxfmt alongside Prettier or Biome as formatters in the same pipeline.38- Oxfmt formats; it does not replace a linter. Drop `eslint-plugin-prettier`; keep `eslint-config-prettier` only if ESLint remains.39- Astro and formats that need Prettier plugins may be blockers until Oxfmt supports them.4041## Verification4243Prefer repository-owned commands. For meaningful Oxfmt work, cover the relevant subset:4445- `bunx oxfmt --check` on changed paths or the whole repo for CI parity.46- `bunx oxfmt` locally / lint-staged when applying format.47- After Prettier migration: spot-check JS/TS diffs; confirm `printWidth` intent; remove Prettier scripts/deps when ready.48- Sorting: confirm `sortImports` / Tailwind (`stylesheet` or `config` + `functions`) / `package.json` behavior matches team expectations.49- Editor format-on-save + `source.fixAll.oxc` smoke when changing the Oxc extension settings; confirm TS organize-imports is off.5051Report which checks ran, which did not, and any 0.x maturity or language-support assumptions that remain.