deno lint: Static Analysis in CI
deno lint applies a set of recommended lint rules to TypeScript and JavaScript without ESLint.
The linter is built in, so CI gets static analysis with zero setup. Rules and exclusions live in deno.json so they stay consistent.
What it does
deno lint analyzes files against its rule set and reports problems, exiting non-zero when any are found. It needs no permissions and no network, making it a cheap early gate.
Common usage
deno lint
deno lint src/
deno lint --rules
# machine-readable output for a reporter
deno lint --jsonOptions
| Flag | What it does |
|---|---|
| --rules | List all available lint rules |
| --json | Emit diagnostics as JSON |
| --compact | One line per diagnostic |
| --ignore=<paths> | Exclude paths from linting |
| --fix | Auto-apply fixes for rules that support it |
| --rules-tags / --rules-exclude | Select or exclude rule groups |
In CI
Run deno lint as a no-permission job alongside deno fmt --check. Configure "lint"."rules" and "exclude" in deno.json so contributors get the same results locally. Per-line ignores use // deno-lint-ignore <rule>.
Common errors in CI
deno lint prints "(rule-name)" with the offending span and "Found N problems", then exits 1. An "Unknown lint rule" message means a rule name in deno.json is misspelled or was removed. To silence one occurrence use // deno-lint-ignore no-explicit-any rather than disabling the rule globally.