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.
Rule Categories
Section titled “Rule Categories”| Category | ID Range | Scope | Description |
|---|---|---|---|
| Evaluability | EVL001–EVL005, EVL007, EVL009–EVL010 | Single file | Flag TypeScript patterns that cannot be statically evaluated |
| Style | COR001–COR009, COR012–COR015 | Single file | Structural and naming conventions |
| Cross-File | COR010–COR011 | Multi-file | Unused exports and circular dependencies |
| Correctness | COR003, COR004, COR007, COR008, COR017 | Single file | Structural errors |
| Composite | EVL009, EVL010, COR017, COR018 | Single file | Best practices for Composite() factories |
| Lexicon | Varies by lexicon | Varies | Provider-specific rules (see lexicon docs) |
Severity Levels
Section titled “Severity Levels”- 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.
Running the Linter
Section titled “Running the Linter”chant lint # Lint all fileschant lint --format json # Machine-readable outputchant lint --format sarif # SARIF 2.1.0 for CI integrations (includes rule descriptions, fingerprints, suppressions)chant lint --watch # Watch for changeschant lint --fix # Auto-fix fixable issuesConfiguration
Section titled “Configuration”Rules are configured via chant.config.ts in your project root. When no config file is found, the strict preset is used by default.
Built-in Presets
Section titled “Built-in Presets”Strict (@intentius/chant/lint/presets/strict) — recommended for production:
| Rule | Severity |
|---|---|
| COR001 | error |
| COR002 | error |
| COR003 | warning |
| COR004 | warning |
| COR005 | warning |
| COR006 | error |
| COR007 | warning |
| COR008 | error |
| COR009 | warning |
| COR010 | warning |
| COR011 | error |
| COR012 | warning |
| COR013 | info |
| COR014 | warning |
| COR015 | warning |
| EVL001–EVL005, EVL007 | error |
| EVL009 | warning |
| EVL010 | warning |
Relaxed (@intentius/chant/lint/presets/relaxed) — for migration or prototyping. Disables most style rules and relaxes correctness rules to warnings.
Inline Disable Directives
Section titled “Inline Disable Directives”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 reasonSee Disable Directives for details.
See Also
Section titled “See Also”- Evaluability Rules — EVL001–EVL005, EVL007
- Style Rules — COR001, COR002, COR005, etc.
- Cross-File Rules — COR010, COR011
- Correctness Rules — COR003, COR004, COR007, COR008
- Composite Rules — EVL009, EVL010, COR017, COR018
- Custom Rules — project-specific rules
- Configuration — severity, presets, overrides
- Auto-Fix — automatic fixes