ox-standard

oxc-standard

Lightning-fast JavaScript Standard Style linting and formatting ⚑

npm version CI License: MIT

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 preset for TypeScript and React.


Contents


πŸš€ Quick Setup

Requirements: Node.js ^20.19.0 || >=22.12.0, matching the bundled oxlint and oxfmt requirements. Development requires Node 22.12+ (22.x), Node 24.x, or Node 26+; Vitest 5 does not support Node 20. For Deno projects, you also need Node alongside Deno because oxlint and oxfmt are invoked through npx. The CLI itself runs from any package manager’s dlx-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         # bun

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

Deno Projects

Deno doesn’t ship a dlx-style runner, so use npx (Node must be installed alongside Deno):

npx oxc-standard --type=deno

The setup will:

Then run:

deno task lint

For 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-vscode

The --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


πŸ›  Customization

For projects set up before this refresh, add env (and any required globals) to the existing .oxlintrc.json; setup deliberately leaves existing configs unchanged.

Override individual rules by extending the bundled config. Oxlint does not inherit env or globals through extends; the setup CLI copies them for you. In manually written configs, declare the environments your project uses:

// .oxlintrc.json
{
  "extends": ["./node_modules/oxc-standard/.oxlintrc.json"],
  "env": { "browser": true, "node": true },
  "rules": {
    "no-console": "warn",
  },
}

Tweak formatting:

// .oxfmtrc.json
{
  "singleQuote": true,
  "semi": false,
  "printWidth": 120,
  "tabWidth": 2,
  "trailingComma": "es5",
}

πŸ’‘ VSCode Integration

The setup writes:

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:

  1. Detect existing ESLint/Prettier configs (.eslintrc*, eslint.config.*, .prettierrc*, prettier.config.*) and packages (eslint, prettier, common plugins/configs).
  2. Ask before deleting configs.
  3. Uninstall the legacy packages with your package manager.
  4. Install and configure oxc-standard.
  5. 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.67.0",
+   "oxlint": "^1.82.0"
  }

The script only touches scripts.lint. If you have a separate scripts.format calling prettier --write, you’ll want to remove it manually β€” oxfmt already runs as part of lint.


πŸ“– 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-standard

Node.js

echo '{"extends": ["./node_modules/oxc-standard/.oxlintrc.json"], "env": {"browser": true, "node": true}}' > .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

The preset combines explicit rule settings with correctness: error and suspicious: warn across 6 plugins (unicorn, typescript, oxc, react, react_perf, import) plus core ESLint rules. Category defaults automatically include newly supported checks; the explicit settings tune their severity and select additional style/performance rules. The full configuration lives in .oxlintrc.json.

The September 2026 refresh targets oxlint 1.82.0 and oxfmt 0.67.0. It enables the import plugin (previously configured import rules were inactive), replaces typescript/no-empty-interface with typescript/no-empty-object-type, and adds the following explicit selections:

Rules Level Purpose
one-var (never), prefer-regex-literals Error Separate variable declarations and use literal regular expressions when the pattern is static.
no-implied-eval, unicorn/no-array-fill-with-reference-type, oxc/bad-match-all-arg Error Catch string-based timer evaluation, shared references in array fills, and non-global matchAll expressions.
prefer-arrow-callback, unicorn/explicit-timer-delay, unicorn/prefer-export-from, unicorn/prefer-single-call Warning Prefer concise callbacks, explicit delays, direct re-exports, and combined collection updates.
react/no-object-type-as-default-prop, react/no-unstable-nested-components Warning Avoid unstable default props and components recreated during rendering.

The React plugin also gains compiler-backed correctness checks through the existing category defaults, including render purity and state-update checks. No React Compiler build integration is required to lint these patterns.

Type-aware rules

The default setup stays syntax-only and does not install oxlint-tsgolint. Configured rules that require type information (such as typescript/prefer-nullish-coalescing and typescript/no-unnecessary-type-assertion) only run when type-aware linting is enabled. To opt in for a TypeScript project with a tsconfig.json:

npm install --save-dev oxlint-tsgolint@^7.0.2001
// .oxlintrc.json
{
  "extends": ["./node_modules/oxc-standard/.oxlintrc.json"],
  "env": { "browser": true, "node": true },
  "options": { "typeAware": true },
}

See the upstream type-aware guide for setup details. The highlights below include both syntax-only and opt-in type-aware rules.

JavaScript Standard Style - `eqeqeq` - Strict equality (`===`) - `no-var` - Use `const`/`let` - `yoda` - Readable comparisons - `no-constructor-return` - No return values from constructors - `no-self-compare` - Flags `x === x` tautologies - `no-else-return` - Removes redundant else after return
Modern JavaScript - `prefer-template` - Template literals - `prefer-destructuring` - Modern patterns - `prefer-object-spread` - Clean objects - `no-duplicate-imports` - Organized imports
React Best Practices - `rules-of-hooks` - Proper hooks usage - `jsx-curly-brace-presence` - Clean JSX - `self-closing-comp` - Concise components - `jsx-no-duplicate-props` - Catches duplicate prop bugs - `void-dom-elements-no-children` - No children on ``, `
` etc. - `no-danger` _(warn)_ - Flags `dangerouslySetInnerHTML` - `jsx-no-constructed-context-values` _(warn)_ - Prevents needless re-renders - `react_perf/jsx-no-jsx-as-prop` _(warn)_ - JSX in props causes re-renders
TypeScript Integration - `consistent-type-imports` - Clean imports - `array-type` - Consistent syntax - `prefer-as-const` - Type assertions - `prefer-optional-chain` - `a?.b` over `a && a.b` - `prefer-nullish-coalescing` - `??` over `||` for null checks - `no-unnecessary-qualifier` - Removes redundant namespace qualifiers - `no-useless-empty-export` - Removes redundant `export {}` - `no-duplicate-enum-values` / `no-mixed-enums` - Enum correctness guards - `no-unsafe-declaration-merging` - Class+interface merge safety - `no-empty-object-type` _(warn)_ - Avoids misleading empty interfaces and `{}` types
Enhanced Patterns (Unicorn) - `prefer-includes` - Better array methods - `prefer-string-starts-ends-with` - Modern strings - `throw-new-error` - Proper errors - `prefer-string-slice` - `.slice()` over `.substring()` - `prefer-node-protocol` - `'node:fs'` over `'fs'` - `prefer-negative-index` - `arr.at(-1)` over `arr[arr.length - 1]` - `prefer-structured-clone` - `structuredClone()` over JSON round-trip - `no-negated-condition` - Flips negated if/ternary for readability - `no-typeof-undefined` - `x === undefined` over `typeof x` - `no-lonely-if` - Hoists lone `if` out of `else` - `no-useless-promise-resolve-reject` - Removes redundant wrappers - `no-instanceof-array` - `Array.isArray()` over `instanceof Array` - `no-negation-in-equality-check` - `!!x === y` instead of `!x === y` - `require-array-join-separator` - Explicit separator in `.join()`
Performance (Oxc) & Import Safety - `no-accumulating-spread` - Prevents O(nΒ²) spread in loops - `no-map-spread` _(warn)_ - Spread in map callbacks - `import/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 ci
npm run check       # build + read-only lint/format checks + all tests
npm run lint        # auto-fix lint issues and format the repository

CI runs the full check on Node 22, 24, and 26 across Linux and macOS, plus a smoke test of the setup CLI against npm, pnpm, yarn, bun, and Deno.


πŸ“„ License

MIT Β© Johann Berger