Linting & Type-Checking
chant includes a built-in linter that validates your resource files. Run it with:
chant lintA clean project produces no output. Errors and warnings are printed to stderr:
src/data-bucket.ts:5:3 error [EVL001] expression in property "name" is not statically evaluablesrc/api.ts:12:1 error [EVL002] resource declaration must not be inside an if statementWhat Gets Checked
Section titled “What Gets Checked”Lint runs two layers in one pass:
- Evaluability rules (EVL) — ensures all resource property expressions can be statically evaluated. See Evaluability Rules.
- Correctness & style rules (COR) — structural constraints like missing exports, circular dependencies, naming conventions. See Correctness Rules.
Additionally, chant build runs post-synth checks against the serialized output (YAML, JSON, etc.). These lexicon-specific rules catch issues that only manifest in the generated output — for example, security misconfigurations, missing health probes, or invalid container commands. See your lexicon’s lint rules documentation for the full list.
Output Formats
Section titled “Output Formats”| Flag | Format |
|---|---|
| (default) | Styled terminal output |
--format json | JSON array of diagnostics |
--format sarif | SARIF 2.1.0 for CI integrations |
chant lint --format jsonWatch Mode
Section titled “Watch Mode”Re-run lint automatically on file changes:
chant lint --watchConfiguring Rules
Section titled “Configuring Rules”Rules are configured in chant.config.ts. See Rule Configuration.