Get up and running with Oxc’s linter in under a minute.
The fastest way to try oxlint is to run it directly with npx:
This will:
Download and run the latest version of oxlint
Scan your current directory for JavaScript and TypeScript files
Report any issues found with sensible default rules
No installation or configuration required. oxlint works out of the box with intelligent defaults.
Example Output
Here’s what you might see when running oxlint on a project:
$ npx oxlint@latest
eslint(no-debugger ): Unexpected 'debugger' statement
╭─[src/app.ts:15:3]
14 │ if (isProduction) {
15 │ debugger ;
· ────┬───
· ╰── Remove this debugger statement
16 │ }
╰────
help: Debugger statements are considered harmful in production code
typescript/no-explicit-any: Unexpected any. Specify a different type.
╭─[src/utils.ts:8:24]
7 │
8 │ function process ( data: any ) {
· ─┬─
· ╰── any disables type checking
9 │ return data.value ;
╰────
✖ 2 problems (2 errors, 0 warnings )
Install Locally
For regular use, install oxlint in your project:
Install oxlint
Add oxlint as a dev dependency: npm install --save-dev oxlint
Add npm script
Update your package.json to include a lint script: {
"scripts" : {
"lint" : "oxlint"
}
}
Now you can run:
Run oxlint
Lint your entire project: Or specific files and directories: npx oxlint src/
npx oxlint src/ tests/
npx oxlint src/app.ts
Create Configuration File
Customize oxlint’s behavior with a configuration file.
Initialize configuration
Create a default configuration file: This creates .oxlintrc.json in your project root.
Configure rules
Edit .oxlintrc.json to customize rules: {
"plugins" : [
"typescript" ,
"unicorn" ,
"react" ,
"import" ,
"jsdoc" ,
"node"
],
"categories" : {
"correctness" : "error" ,
"suspicious" : "warn" ,
"pedantic" : "warn"
},
"rules" : {
"no-console" : "error" ,
"no-debugger" : "error" ,
"typescript/no-explicit-any" : "warn"
}
}
Run with configuration
oxlint automatically detects and uses .oxlintrc.json: Or specify a custom config file: npx oxlint -c path/to/config.json
Common CLI Options
Here are the most frequently used oxlint options:
Enable/Disable Rules
# Deny specific rules or categories
npx oxlint -D correctness -D no-debugger
# Allow (suppress) specific rules
npx oxlint -A no-console
# Warn on specific rules
npx oxlint -W suspicious
Fix Issues Automatically
# Fix safe auto-fixable issues
npx oxlint --fix
# Apply suggestions (may change behavior)
npx oxlint --fix-suggestions
# Apply dangerous fixes
npx oxlint --fix-dangerously
--fix-dangerously may change program behavior. Review changes carefully before committing.
# Default format (human-readable)
npx oxlint
# JSON format for programmatic use
npx oxlint --format json
# GitHub Actions format
npx oxlint --format github
# Unix format (file:line:column:message)
npx oxlint --format unix
Available formats: default, json, stylish, unix, checkstyle, github, gitlab, junit
Enable Plugins
# Enable React plugin
npx oxlint --react-plugin
# Enable import plugin (requires tsconfig)
npx oxlint --import-plugin --tsconfig tsconfig.json
# Enable JSX a11y plugin
npx oxlint --jsx-a11y-plugin
# Enable Jest plugin
npx oxlint --jest-plugin
Handle Warnings
# Disable warnings (errors only)
npx oxlint --quiet
# Treat warnings as errors
npx oxlint --deny-warnings
# Set maximum warning threshold
npx oxlint --max-warnings 10
Rule Categories
oxlint organizes rules into categories:
correctness
suspicious
pedantic
perf
style
restriction
nursery
Code that is outright wrong or useless Enabled by default. Catches bugs and incorrect code. # These rules are enabled by default
npx oxlint
Code that is most likely wrong or useless Strict lints with occasional false positives Code that could be more performant Prevent use of language/library features npx oxlint -D restriction
New lints still under development
Configuration Examples
Minimal Configuration
{
"rules" : {
"no-console" : "warn" ,
"no-debugger" : "error"
}
}
React Project
{
"plugins" : [ "react" , "react-perf" , "jsx-a11y" ],
"categories" : {
"correctness" : "error" ,
"perf" : "warn"
},
"rules" : {
"react/jsx-key" : "error" ,
"react-perf/jsx-no-new-object-as-prop" : "warn"
}
}
TypeScript Project
{
"plugins" : [ "typescript" , "import" ],
"categories" : {
"correctness" : "error" ,
"suspicious" : "warn"
},
"rules" : {
"typescript/no-explicit-any" : "warn" ,
"typescript/consistent-indexed-object-style" : [ "error" , "record" ],
"typescript/ban-ts-comment" : [
"error" ,
{ "ts-expect-error" : "allow-with-description" }
]
},
"options" : {
"typeAware" : true
}
}
With Ignore Patterns
{
"plugins" : [ "typescript" , "unicorn" ],
"categories" : {
"correctness" : "error"
},
"ignorePatterns" : [
"**/node_modules/**" ,
"**/dist/**" ,
"**/build/**" ,
"**/*.d.ts"
]
}
oxlint is designed for speed. Here’s a comparison on the VSCode repository (4800+ files):
$ time npx oxlint
✔ Linted 4863 files in 0.7s
real 0m0.712s
user 0m2.847s
sys 0m0.156s
oxlint is typically 50-100x faster than ESLint on large codebases.
Next Steps
Linter Configuration Learn about all configuration options
CLI Reference Explore all CLI flags and options
Linter Tool Learn about oxlint features
Formatter Format your code with oxfmt
Troubleshooting
oxlint is not finding my files
By default, oxlint scans the current directory for JS/TS files. Specify paths explicitly: Check your ignore patterns in .oxlintrc.json or .oxlintignore.
How do I ignore specific files?
Create a .oxlintignore file: Or use ignorePatterns in .oxlintrc.json.
Can I use oxlint with ESLint?
Yes! oxlint can run alongside ESLint. Use oxlint for fast checks and ESLint for rules not yet supported by oxlint. {
"scripts" : {
"lint" : "oxlint && eslint ."
}
}
How do I enable type-aware rules?
Add typeAware: true to your config: {
"options" : {
"typeAware" : true
}
}
Or use the --type-aware flag: