Skip to content

chant lint

chant lint [path] [flags]

chant lint loads the project at the given path, runs all configured lint rules, and reports diagnostics. Each diagnostic includes a rule ID (e.g. COR010, EVL001) alongside the file location and message.

FlagTypeDefaultDescription
--formatstringstylishOutput format: stylish, json, or sarif
--fixboolfalseAuto-fix fixable issues
-w, --watchboolfalseWatch for file changes and re-lint
--sandboxboolfalseRun any project source the lint has to execute in one isolated child process rather than in the chant process. The same boundary as chant build --sandbox; composes with --watch
Terminal window
# Lint current directory
chant lint
# JSON output for CI
chant lint --format json
# SARIF for GitHub Code Scanning
chant lint --format sarif > results.sarif
# Auto-fix
chant lint --fix
# Watch mode
chant lint --watch
# Keep project source out of the chant process
chant lint --sandbox

A lexicon the project declares in chant.config.* but that cannot be resolved is reported as a LEX001 error against the config file, with the same message chant build gives for the same project. The lint exits 1, and the diagnostic appears in --format json and --format sarif like any other. This covers a lexicon package that is not installed and a chant.config.ts that fails to load, so a CI job that lints before it builds cannot report green on a project the build refuses.

LEX001 is not a rule, so it has no severity setting and no chant-disable form. What it reports is that the lint could not assemble the rule set the project asked for.

A project that declares no lexicon and imports none is unaffected. It lints under the core rules alone, as it always has.

CodeMeaning
0No errors found
1Lint errors found, including a declared lexicon that could not be resolved