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:
pnpm 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 --initUse a config file explicitly:
oxlint -c ./oxlintrc.json
# or
oxlint --config ./oxlintrc.jsonFix 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 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-ignoreFollow symlinks (Oxlint ignores symlinks by default):
oxlint --symlinksSee 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, 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:
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