Skip to content

Disable Directives

llms.txt lists every page for an agent

Suppress specific lint diagnostics using comments in your source files.

Place at the top of the file:

// chant-disable COR005
// chant-disable
  • // chant-disable — suppresses all rules for the entire file
  • // chant-disable COR005 — suppresses only COR005 for the entire file
export const myBucket = new _.Resource({ // chant-disable-line COR005
bucketName: "my-bucket",
});
// chant-disable-next-line COR005
export const myBucket = new _.Resource({
bucketName: "my-bucket",
});

Add a reason after -- to document why a rule is suppressed. The reason is optional, changes no behaviour, and appears in SARIF output for audit trails.

// chant-disable COR001 -- intentional for backwards compat
// chant-disable-line WAW001 -- CDN must use us-east-1
// chant-disable-next-line -- legacy code, will refactor
// chant-disable -- entire file suppressed for migration

The -- separator follows the convention used by ESLint, clippy, and shellcheck. Everything after the first -- is the reason text. Disable comments without -- work as before.

When using --format sarif, suppressed diagnostics appear in the SARIF output with a suppressions array that holds the reason text, for compliance and audit reports.

All directives also work with block comments:

/* chant-disable-next-line COR010 */
export const helper = { key: "value" };
  • Prefer the narrowest scope possible (disable-next-line over disable)
  • Always specify the rule ID rather than suppressing all rules
  • Include a -- reason when suppressing rules in shared or long-lived code
  • Use file-level disable sparingly — typically only for generated files

chant-disable suppresses diagnostics from AST rules (COR/EVL) and, at file-level only, COMP* composition checks (see Composition Rules). Post-synth checks and organizational policies (a lexicon’s WAW019, a project’s ORG-COST-CENTER) report on the synthesized output, which has no source line for a chant-disable comment to sit on. Suppress those with lint.rules instead; see Post-Synth Checks and Policies.

chant