Skip to content

Lint Rules Overview

chant includes a semantic lint system that validates the meaning of your declarations, not just their structure. Core rules (COR, EVL) apply to all projects. Each lexicon brings its own lexicon-specific rules.

CategoryID RangeScopeDescription
EvaluabilityEVL001–EVL005, EVL007, EVL009–EVL010Single fileFlag TypeScript patterns that cannot be statically evaluated
StyleCOR001–COR009, COR012–COR015Single fileStructural and naming conventions
Cross-FileCOR010–COR011Multi-fileUnused exports and circular dependencies
CorrectnessCOR003, COR004, COR007, COR008, COR017Single fileStructural errors
CompositeEVL009, EVL010, COR017, COR018Single fileBest practices for Composite() factories
LexiconVaries by lexiconVariesProvider-specific rules (see lexicon docs)
  • error — blocks the build. Must be fixed.
  • warning — does not block the build. Should be addressed.
  • info — informational. Highlights potential improvements.

Severity can be overridden per-rule in your configuration. See Rule Configuration.

Terminal window
chant lint # Lint all files
chant lint --format json # Machine-readable output
chant lint --format sarif # SARIF 2.1.0 for CI integrations (includes rule descriptions, fingerprints, suppressions)
chant lint --watch # Watch for changes
chant lint --fix # Auto-fix fixable issues

Rules are configured via chant.config.ts in your project root. When no config file is found, the strict preset is used by default.

Strict (@intentius/chant/lint/presets/strict) — recommended for production:

RuleSeverity
COR001error
COR002error
COR003warning
COR004warning
COR005warning
COR006error
COR007warning
COR008error
COR009warning
COR010warning
COR011error
COR012warning
COR013info
COR014warning
COR015warning
EVL001–EVL005, EVL007error
EVL009warning
EVL010warning

Relaxed (@intentius/chant/lint/presets/relaxed) — for migration or prototyping. Disables most style rules and relaxes correctness rules to warnings.

Suppress rules with comments:

// chant-disable — disable all rules for entire file
// chant-disable COR001 COR006 — disable specific rules for file
// chant-disable-line — disable all rules for this line
// chant-disable-next-line COR001 — disable COR001 for next line
// chant-disable COR001 -- reason text — suppress with an audit reason

See Disable Directives for details.