Quickstart
This page shows the recommended setup for Oxlint and the most common workflows, with copy-paste commands.
Install
Install oxlint as a dev dependency:
$ npm add -D oxlint$ pnpm add -D oxlint$ yarn add -D oxlint$ bun add -D oxlintAdd lint commands to package.json:
{
"scripts": {
"lint": "oxlint",
"lint:fix": "oxlint --fix"
}
}Run it:
pnpm run lintApply fixes:
pnpm run lint:fixUsage
For the complete list of options, see the CLI reference.
oxlint [OPTIONS] [PATH]...If PATH is omitted, Oxlint lints the current working directory.
Common workflows
Pre-commit with lint-staged
{
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": "pnpm run lint"
}
}Create a config file
Initialize the .oxlintrc.json config with default values:
oxlint --initThen run Oxlint:
oxlintTIP
If you are migrating from ESLint, see the "Migrate from ESLint" page for detailed guidance on migrating.
Fix problems
Apply safe fixes:
oxlint --fixApply suggestions (may change program behavior):
oxlint --fix-suggestionsApply dangerous fixes and suggestions:
oxlint --fix-dangerouslySee Automatic fixes for guidance on when to use each mode.
Ignore files
Use an explicit ignore file:
oxlint --ignore-path .oxlintignoreAdd ignore patterns from the command line:
oxlint --ignore-pattern "dist/**" --ignore-pattern "*.min.js"Disable ignore handling:
oxlint --no-ignoreSee Ignore files.
Fail CI reliably
Only report errors:
oxlint --quietFail if any warnings are found:
oxlint --deny-warningsFail if warnings exceed a threshold:
oxlint --max-warnings 0See CI setup.
Use machine-readable output
Select an output format:
oxlint -f jsonAvailable formats include: default, json, unix, checkstyle, github, gitlab, junit, stylish.
Inspect the effective configuration
Print the configuration that would be used for a file:
oxlint --print-config path/to/file.tsList available rules
List registered rules, including those enabled by your current oxlint config:
oxlint --rulesThe full list is in the Rules reference.
Next steps
- Configure rules, plugins, and ignores: Configuration
- Setup editors
- Setup CI
- Learn advanced features: Multi-file analysis, Type-aware linting, JS plugins
- Migrate: From ESLint
- CLI reference
