From routine
Runs and configures oxfmt, a Prettier-compatible JS/TS formatter ~30x faster, in projects with oxfmt installed. Supports formatting, Prettier/Biome migration, editor integration (VS Code, Neovim), and CI checks.
npx claudepluginhub delexw/claude-code-miscThis skill uses the workspace's default tool permissions.
Oxfmt is a Prettier-compatible formatter for the JavaScript ecosystem. It currently passes ~95% of Prettier's JS/TS test suite. It formats JavaScript, JSX, TypeScript, TSX, JSON, JSONC, JSON5, YAML, TOML, HTML, Angular, Vue, CSS, SCSS, Less, Markdown, MDX, GraphQL, Ember, and Handlebars.
Runs oxlint to lint and auto-fix JavaScript/TypeScript code, configures rules/plugins in .oxlintrc.json, and migrates from ESLint in detected projects.
Guides formatting JavaScript/TypeScript/JSON code with Biome formatter using CLI commands, config options for indents, quotes, semicolons, trailing commas, and style enforcement.
Provides Biome commands for formatting, linting, and organizing imports in JavaScript, TypeScript, JSX/TSX, JSON, CSS projects. Use for zero-config setup, fast CI checks, or ESLint/Prettier migration.
Share bugs, ideas, or general feedback.
Oxfmt is a Prettier-compatible formatter for the JavaScript ecosystem. It currently passes ~95% of Prettier's JS/TS test suite. It formats JavaScript, JSX, TypeScript, TSX, JSON, JSONC, JSON5, YAML, TOML, HTML, Angular, Vue, CSS, SCSS, Less, Markdown, MDX, GraphQL, Ember, and Handlebars.
# Pick your package manager
npm add -D oxfmt
pnpm add -D oxfmt
yarn add -D oxfmt
bun add -D oxfmt
Add scripts to package.json:
{
"scripts": {
"fmt": "oxfmt",
"fmt:check": "oxfmt --check"
}
}
Running oxfmt with no arguments formats the current directory (like prettier --write .).
| Flag | Purpose |
|---|---|
--check | Check formatting without writing (exit 1 if unformatted) |
--list-different | List files that would change |
--write | Format and write in place (default) |
--init | Create .oxfmtrc.json with defaults |
--migrate=prettier | Convert .prettierrc to .oxfmtrc.json |
--migrate=biome | Convert Biome config to .oxfmtrc.json |
-c PATH | Use a specific config file |
--ignore-path PATH | Custom ignore file (repeatable) |
--with-node-modules | Include node_modules/ (skipped by default) |
--no-error-on-unmatched-pattern | Don't fail on unmatched globs |
--stdin-filepath PATH | Format stdin, using PATH to infer parser |
--threads N | Thread count (set to 1 for single core) |
--lsp | Start the LSP server (used by editors) |
CLI does not support formatting options as flags (e.g., no --no-semi). Use the config file instead — this keeps formatting consistent across CLI, editors, and CI.
Oxfmt looks for .oxfmtrc.json or .oxfmtrc.jsonc starting from the current directory, walking up.
Generate a starter config:
oxfmt --init
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100, // Line width limit (default: 100, Prettier default is 80)
"tabWidth": 2, // Spaces per indent level
"useTabs": false, // Tabs vs spaces
"semi": true, // Semicolons
"singleQuote": false, // Quote style
"trailingComma": "all", // Trailing commas in multi-line
"insertFinalNewline": true
}
Note: oxfmt defaults printWidth to 100, while Prettier defaults to 80. If migrating, decide which you prefer.
{
"printWidth": 100,
"overrides": [
{
"files": ["*.test.js", "*.spec.ts"],
"options": { "printWidth": 120 }
},
{
"files": ["*.json"],
"excludeFiles": ["package.json"],
"options": { "tabWidth": 4 }
}
]
}
These are disabled by default but can be enabled in the config:
sortImports — Sorts import statementssortTailwindcss — Sorts Tailwind CSS classessortPackageJson — Sorts package.json fields (enabled by default)Add ignorePatterns in the config file, or use a .oxfmtignore / .prettierignore file:
{
"ignorePatterns": ["dist/", "coverage/", "*.min.js"]
}
Oxfmt reads these .editorconfig properties (nearest file only, no merging):
end_of_line → endOfLineindent_style → useTabsindent_size → tabWidthmax_line_length → printWidthinsert_final_newline → insertFinalNewline# Install oxfmt
pnpm add -D oxfmt
# Auto-convert .prettierrc → .oxfmtrc.json
oxfmt --migrate=prettier
# Format everything so the diff is clean
pnpm oxfmt
# Replace Prettier scripts in package.json
# "prettier --write ." → "oxfmt"
# "prettier --check ." → "oxfmt --check"
After migration, review the generated .oxfmtrc.json — especially printWidth since the default changed from 80 to 100.
Editor extensions use the local oxfmt --lsp, so oxfmt must be installed in the project.
VS Code / Cursor: Install the "Oxc" extension from the VS Code Marketplace. Recommended team setup:
.vscode/extensions.json:
{ "recommendations": ["oxc.oxc-vscode"] }
.vscode/settings.json:
{
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
}
Zed: Install the oxc extension from Zed's marketplace.
JetBrains (IntelliJ / WebStorm): Install from JetBrains Marketplace.
Neovim:
npm i -g oxfmt then vim.lsp.enable('oxfmt')formatters_by_ft for js/ts/json/vue:CocInstall coc-oxcOther LSP-compatible editors (Emacs, Helix, Sublime): Point at oxfmt --lsp.
Non-LSP editors: Pipe via stdin: cat file.js | oxfmt --stdin-filepath file.js
GitHub Actions:
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run fmt:check
GitLab CI:
oxfmt:
image: node:lts
stage: test
before_script:
- npm install
script:
- npm run fmt:check
Autofix (GitHub): Use autofix.ci — run oxfmt (no --check) and let the action commit fixes.
{
"lint-staged": {
"*": "oxfmt --no-error-on-unmatched-pattern"
}
}
Use --no-error-on-unmatched-pattern so non-supported file types don't cause errors.
import { format } from "oxfmt";
const result = format("foo.ts", "const x:string = 1", {
semi: false,
singleQuote: true,
});
console.log(result); // const x: string = 1
When you've modified files in an oxfmt-enabled project:
pnpm oxfmt (or the project's fmt script) to format changed files--check instead to verify without writingThe formatter is fast enough to run on the entire project — no need to target individual files unless piping via stdin.