chant lint
Synopsis
Section titled “Synopsis”chant lint [path] [flags]Description
Section titled “Description”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.
| Flag | Type | Default | Description |
|---|---|---|---|
--format | string | stylish | Output format: stylish, json, or sarif |
--fix | bool | false | Auto-fix fixable issues |
-w, --watch | bool | false | Watch for file changes and re-lint |
--sandbox | bool | false | Run 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 |
# Lint current directorychant lint
# JSON output for CIchant lint --format json
# SARIF for GitHub Code Scanningchant lint --format sarif > results.sarif
# Auto-fixchant lint --fix
# Watch modechant lint --watch
# Keep project source out of the chant processchant lint --sandboxUnresolved lexicons
Section titled “Unresolved lexicons”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.
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | No errors found |
| 1 | Lint errors found, including a declared lexicon that could not be resolved |