Skip to content
Latchkey

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

Terminal
deno lint
deno lint src/
deno lint --rules
# machine-readable output for a reporter
deno lint --json

Options

FlagWhat it does
--rulesList all available lint rules
--jsonEmit diagnostics as JSON
--compactOne line per diagnostic
--ignore=<paths>Exclude paths from linting
--fixAuto-apply fixes for rules that support it
--rules-tags / --rules-excludeSelect 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.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →