Skip to content

Auto-Fix

llms.txt lists every page for an agent
Optional: hand this page to your coding agentThe steps work by hand too.
Show the whole prompt
Read https://intentius.io/chant/lint-rules/auto-fix/.
Run `npx chant lint` in this project and list the findings marked `[fixable]`, then run `npx chant lint --fix`.
Fix the findings it leaves by hand, run `npx chant build` and `npx chant lint` until both pass, and open a pull request.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.

Some lint rules come with fixes that chant lint --fix applies.

Terminal window
chant lint --fix

Without --fix, text output marks fixable diagnostics with [fixable]:

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.

RuleFix KindDescription
COR005renameRenames PascalCase exports to camelCase
COR012deleteRemoves redundant import type line
COR015TextEditRemoves redundant as Value<...> cast
COR017TextEditInserts or replaces Composite name to match variable
// Before
export const MyBucket = new _.Resource({ ... });
// After fix
export const myBucket = new _.Resource({ ... });
  1. Diagnostics with available fixes are collected during the lint pass
  2. Fixes are sorted in reverse source order (bottom-to-top) to preserve positions
  3. Overlapping fixes are skipped to avoid conflicts
  4. Each fix is applied to the source text and the file is written back
  5. Lint is re-run to show remaining unfixable issues

chant