biome lint: Run Only the Linter
biome lint runs just the linter over your files and reports rule violations without touching formatting.
Use lint when you want linting alone, for instance in a job separate from formatting, or to apply only the linter safe fixes.
What it does
biome lint analyzes the given paths with the enabled lint rules and prints diagnostics. By default it only reports and exits non-zero on error-level findings. With --write it applies the safe fixes that rules provide.
Common usage
npx @biomejs/biome lint ./src
# apply safe lint fixes
npx @biomejs/biome lint --write ./src
# run a single rule
npx @biomejs/biome lint --only=correctness/noUnusedVariables ./srcOptions
| Flag | What it does |
|---|---|
| --write | Apply safe lint fixes (replaces v1 --apply) |
| --unsafe | Also apply unsafe fixes (with --write) |
| --only=<group/rule> | Run only the named rule or group |
| --skip=<group/rule> | Skip the named rule or group |
| --error-on-warnings | Exit non-zero on warnings too |
| --reporter=github | Emit GitHub Actions annotations |
Common errors in CI
lint exits 1 on any error-level diagnostic. "Unknown rule" from --only/--skip means a misspelled rule name or a v1 path used on v2 (some rules were renamed and groups reorganized). If a rule you expect is silent, it may be disabled by default; enable it under linter.rules in biome.json.