oxc-standard
v1.4.0
Published
Fast, comprehensive TypeScript/React linting with JavaScript Standard Style philosophy using oxlint
Maintainers
Readme
oxc-standard
Lightning-fast JavaScript Standard Style linting and formatting ⚡
A drop-in replacement for ESLint + Prettier built on the Rust-based oxc toolchain. Roughly 50–100× faster than the JavaScript equivalents, with a curated 113-rule preset for TypeScript and React.
Contents
- Quick Setup
- For AI Agents
- CLI Reference
- What You Get
- Customization
- VSCode Integration
- Migrating from ESLint/Prettier
- Manual Installation
- Rule Reference
- Contributing
🚀 Quick Setup
Requirements: Node.js (a recent LTS — oxlint and oxfmt need at least Node 18). For Deno projects, you also need Node alongside Deno because
oxlintandoxfmtare invoked throughnpx. The CLI itself runs from any package manager'sdlx-style runner.
Node.js Projects
Replace ESLint/Prettier in your project with one command — works with npm, pnpm, yarn, and bun:
npx oxc-standard # npm
pnpm dlx oxc-standard # pnpm
yarn dlx oxc-standard # yarn (berry)
bunx oxc-standard # bunThe setup auto-detects your package manager (via lockfile, then npm_config_user_agent, then the packageManager field in package.json) and uses the right install/uninstall commands. It then:
- ✅ Removes ESLint, Prettier, and related packages and configs
- ✅ Installs
oxlintandoxfmtpinned to known-good versions - ✅ Writes
.oxlintrc.jsonand.oxfmtrc.json - ✅ Adds a
lintscript topackage.json— run withnpm run lint/pnpm lint/yarn lint/bun run lint - ✅ Configures
.vscode/settings.jsonand.vscode/extensions.jsonfor the oxc-vscode extension
Deno Projects
Deno doesn't ship a dlx-style runner, so use npx (Node must be installed alongside Deno):
npx oxc-standard --type=denoThe setup will:
- ✅ Detect your Deno project (via
deno.json[c]or.vscode/settings.jsondeno.enable) - ✅ Write
.oxlintrc.jsonwith Deno-specific globals and ignore patterns - ✅ Write
.oxfmtrc.jsonwith Standard Style formatting - ✅ Add a
linttask todeno.json - ✅ Configure VSCode integration
Then run:
deno task lintFor AI Agents
Paste this into any coding-agent chat (Copilot, Claude Code, Cursor, opencode, etc.) when you want it to migrate the current repository:
Set up oxc-standard in this project by following https://raw.githubusercontent.com/JohnDeved/ox-standard/main/README.md — auto-detect the package manager and project type, run the CLI non-interactively, then verify the lint script works.Or, for agents that prefer running a single shell command, point them at the deterministic non-interactive form:
# Node project (auto-detects npm/pnpm/yarn/bun)
npx -y oxc-standard --yes --no-vscode
# Deno project
npx -y oxc-standard --yes --type=deno --no-vscodeThe --yes flag auto-accepts every prompt (required for non-interactive shells) and --no-vscode skips writing .vscode/ files. Drop --no-vscode if you do want VSCode integration.
📋 CLI Reference
npx oxc-standard [options]| Flag | Description |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| -y, --yes | Skip every confirmation prompt (CI / scripted use). |
| -t, --type=<node\|deno> | Skip auto-detection and force the project type. |
| -n, --dry-run | Preview every destructive action (file writes, deletes, package installs) without touching anything. Implies --yes. |
| --no-vscode | Skip the .vscode/ integration step. |
| -h, --help | Print the help text and exit. |
Examples:
# Fully non-interactive Node setup (e.g. inside a CI job)
npx oxc-standard --yes --type=node --no-vscode
# Non-interactive Deno setup
npx oxc-standard --yes --type=deno
# Preview what setup would do without changing anything
npx oxc-standard --dry-run --type=node✨ What You Get
- Sub-second linting and formatting —
oxlintandoxfmtare native Rust binaries shipped via npm. - One command for both — the generated lint script runs
oxlint --fix .followed byoxfmt .(semicolon, not&&, so formatting still runs even if lint reports an unfixable issue). - Standard Style enforced — no semicolons, single quotes, 2-space indent, strict equality, modern ES6+, React-hooks correctness, TypeScript consistency.
- Pinned tool versions —
oxc-standarddeclares the supportedoxlintandoxfmtversions in bothdependenciesandpeerDependencies, so the toolchain stays in sync with the rule set. - VSCode integration on by default — auto-fix and format-on-save via the official
oxc.oxc-vscodeextension.
🛠 Customization
Override individual rules by extending the bundled config:
// .oxlintrc.json
{
"extends": ["./node_modules/oxc-standard/.oxlintrc.json"],
"rules": {
"no-console": "warn",
},
}Tweak formatting:
// .oxfmtrc.json
{
"singleQuote": true,
"semi": false,
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5",
}💡 VSCode Integration
The setup writes:
.vscode/settings.json— setsoxc-vscodeas the default formatter, enables format-on-save, enables auto-fix-on-save, and turns on the experimental oxfmt support..vscode/extensions.json— recommendsoxc.oxc-vscode(andtypescriptteam.native-preview).
When you open the project, VSCode will offer to install the recommended extensions. Accept, and lint + format on save just works.
Skip this step entirely with --no-vscode.
🆚 Migrating from ESLint/Prettier
Run npx oxc-standard and confirm the prompts. The script will:
- Detect existing ESLint/Prettier configs (
.eslintrc*,eslint.config.*,.prettierrc*,prettier.config.*) and packages (eslint,prettier, common plugins/configs). - Ask before deleting configs.
- Uninstall the legacy packages with your package manager.
- Install and configure
oxc-standard. - Update
.vscode/(unless--no-vscode).
A typical package.json diff after migration:
"scripts": {
- "lint": "eslint . --fix",
+ "lint": "oxlint --fix .; oxfmt ."
},
"devDependencies": {
- "eslint": "^9.0.0",
- "eslint-config-standard": "^17.0.0",
- "prettier": "^3.0.0",
+ "oxc-standard": "^1",
+ "oxfmt": "^0.48.0",
+ "oxlint": "^1.63.0"
}The script only touches
scripts.lint. If you have a separatescripts.formatcallingprettier --write, you'll want to remove it manually —oxfmtalready runs as part oflint.
📖 Manual Installation
Prefer to skip the script? Pick the install command for your package manager:
npm install --save-dev oxc-standard
pnpm add --save-dev oxc-standard
yarn add --dev oxc-standard
bun add --dev oxc-standardNode.js
echo '{"extends": ["./node_modules/oxc-standard/.oxlintrc.json"]}' > .oxlintrc.json
cp node_modules/oxc-standard/.oxfmtrc.json .oxfmtrc.json
npm pkg set scripts.lint="oxlint --fix .; oxfmt ."Deno
Add a task to deno.json:
{
"tasks": {
"lint": "npx oxlint --fix . && npx oxfmt .",
},
}Then run deno task lint.
🔧 Rule Reference
113 carefully selected rules across 5 oxlint plugins (unicorn, typescript, oxc, react, react_perf). The full list lives in .oxlintrc.json; the highlights are below.
eqeqeq- Strict equality (===)curly- Consistent bracesno-var- Useconst/letspace-infix-ops- Proper spacingyoda- Readable comparisonsno-constructor-return- No return values from constructorsno-self-compare- Flagsx === xtautologiesno-else-return- Removes redundant else after return
prefer-template- Template literalsprefer-destructuring- Modern patternsprefer-object-spread- Clean objectsno-duplicate-imports- Organized imports
rules-of-hooks- Proper hooks usagejsx-curly-brace-presence- Clean JSXself-closing-comp- Concise componentsjsx-no-duplicate-props- Catches duplicate prop bugsvoid-dom-elements-no-children- No children on<img>,<br>etc.no-danger(warn) - FlagsdangerouslySetInnerHTMLjsx-no-constructed-context-values(warn) - Prevents needless re-rendersreact_perf/jsx-no-jsx-as-prop(warn) - JSX in props causes re-renders
consistent-type-imports- Clean importsarray-type- Consistent syntaxprefer-as-const- Type assertionsprefer-optional-chain-a?.bovera && a.bprefer-nullish-coalescing-??over||for null checksno-unnecessary-qualifier- Removes redundant namespace qualifiersno-useless-empty-export- Removes redundantexport {}no-duplicate-enum-values/no-mixed-enums- Enum correctness guardsno-unsafe-declaration-merging- Class+interface merge safety
prefer-includes- Better array methodsprefer-string-starts-ends-with- Modern stringsthrow-new-error- Proper errorsprefer-string-slice-.slice()over.substring()prefer-node-protocol-'node:fs'over'fs'prefer-negative-index-arr.at(-1)overarr[arr.length - 1]prefer-structured-clone-structuredClone()over JSON round-tripno-negated-condition- Flips negated if/ternary for readabilityno-typeof-undefined-x === undefinedovertypeof xno-lonely-if- Hoists loneifout ofelseno-useless-promise-resolve-reject- Removes redundant wrappersno-instanceof-array-Array.isArray()overinstanceof Arrayno-negation-in-equality-check-!!x === yinstead of!x === yrequire-array-join-separator- Explicit separator in.join()
no-accumulating-spread- Prevents O(n²) spread in loopsno-map-spread(warn) - Spread in map callbacksimport/no-cycle- Detects circular imports
🤝 Contributing
Found an issue or want to suggest improvements? Open an issue or submit a pull request.
Local development:
npm install
npm run build # tsc → dist/
npm test # vitest
npm run lint # dogfood: lint this repo with oxlint+oxfmtCI runs the full test suite on Node 20 and 22 across Linux and macOS, plus a smoke test of the setup CLI against npm, pnpm, yarn, bun, and Deno.
📄 License
MIT © Johann Berger
