Lightning-fast JavaScript Standard Style linting and formatting β‘
Drop-in replacement for ESLint/Prettier thatβs 50~100 times faster. Enforces JavaScript Standard Style using Rust-based oxlint and oxfmt formatter for TypeScript/React projects.
Replace ESLint/Prettier in your project with one command:
npx JohnDeved/ox-standard
Thatβs it! The setup automatically:
Run the setup in your Deno project directory:
npx JohnDeved/ox-standard
The setup will:
Then install oxlint and oxfmt:
# Using npx (recommended)
npx oxlint --fix .
npx oxfmt .
# Or install globally with Deno
deno install -A -n oxlint https://esm.sh/oxlint
deno install -A -n oxfmt https://esm.sh/oxfmt
npm run lint (Node.js) or deno task lint (Deno) handles both linting and formatting===), modern ES6+ patternsNeed to override rules? Easy:
// .oxlintrc.json
{
"extends": ["./node_modules/ox-standard/.oxlintrc.json"],
"rules": {
"no-console": "warn"
}
}
// .oxfmtrc.json
{
"singleQuote": true,
"semi": false,
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5"
}
The setup automatically configures VSCode for the best experience:
The .vscode/settings.json is configured to use oxc-vscode as the default formatter with experimental oxfmt support enabled. Just install the recommended oxc.oxc-vscode extension when prompted, and formatting will work out of the box!
The setup script handles everything automatically:
Prefer manual setup?
npm install --save-dev github:JohnDeved/ox-standard
echo '{"extends": ["./node_modules/ox-standard/.oxlintrc.json"]}' > .oxlintrc.json
cp node_modules/ox-standard/.oxfmtrc.json .oxfmtrc.json
npm pkg set scripts.lint="oxlint --fix .; oxfmt ."
For Deno projects, configuration is embedded directly:
# Run setup script
npx JohnDeved/ox-standard
# Or manually create configs
# The setup script will generate .oxlintrc.json with Deno-specific settings
# including Deno global environment and optimized ignore patterns
# Add to deno.json:
{
"tasks": {
"lint": "npx oxlint --fix . && npx oxfmt ."
}
}
# Run linting
deno task lint
70+ carefully selected rules across:
eqeqeq - Strict equality (===)curly - Consistent bracesno-var - Use const/letspace-infix-ops - Proper spacingyoda - Readable comparisonsprefer-template - Template literalsprefer-destructuring - Modern patternsprefer-object-spread - Clean objectsno-duplicate-imports - Organized importsrules-of-hooks - Proper hooks usagejsx-curly-brace-presence - Clean JSXself-closing-comp - Concise componentsconsistent-type-imports - Clean importsarray-type - Consistent syntaxprefer-as-const - Type assertionsprefer-includes - Better array methodsprefer-string-starts-ends-with - Modern stringsthrow-new-error - Proper errorsFound an issue or want to suggest improvements? Open an issue or submit a pull request.
MIT Β© Johann Berger