Auto-Fix
Some lint rules provide structured fixes that can be applied automatically.
chant lint --fixWhen --fix is not set, fixable diagnostics are annotated with [fixable] in text output:
src/storage.ts:3:5 warning [COR005] [fixable] Exported names should be camelCase--fix runs once and exits. In watch mode, fixes are applied on each re-run.
Fixable Rules
Section titled “Fixable Rules”| Rule | Fix Kind | Description |
|---|---|---|
| COR005 | rename | Renames PascalCase exports to camelCase |
| COR012 | delete | Removes redundant import type line |
| COR015 | TextEdit | Removes redundant as Value<...> cast |
| COR017 | TextEdit | Inserts or replaces Composite name to match variable |
Examples
Section titled “Examples”COR005 — Naming Convention
Section titled “COR005 — Naming Convention”// Beforeexport const MyBucket = new _.Resource({ ... });
// After fixexport const myBucket = new _.Resource({ ... });How Fixes Are Applied
Section titled “How Fixes Are Applied”- Diagnostics with available fixes are collected during the lint pass
- Fixes are sorted in reverse source order (bottom-to-top) to preserve positions
- Overlapping fixes are skipped to avoid conflicts
- Each fix is applied to the source text and the file is written back
- Lint is re-run to show remaining unfixable issues