Disable Directives
Suppress specific lint diagnostics using comments in your source files.
Disable for Entire File
Section titled “Disable for Entire File”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
Disable for Current Line
Section titled “Disable for Current Line”export const myBucket = new _.Resource({ // chant-disable-line COR005 bucketName: "my-bucket",});Disable for Next Line
Section titled “Disable for Next Line”// chant-disable-next-line COR005export const myBucket = new _.Resource({ bucketName: "my-bucket",});Suppression Reasons
Section titled “Suppression Reasons”Add a reason after -- to document why a rule is suppressed. The reason is optional and purely informational — it 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 migrationThe -- separator follows the convention used by ESLint, clippy, and shellcheck. Everything after the first -- is the reason text. The reason is always optional — existing disable comments without -- continue to work unchanged.
When using --format sarif, suppressed diagnostics appear in the SARIF output with a suppressions array containing the justification text, enabling compliance workflows and audit reporting.
Block Comment Syntax
Section titled “Block Comment Syntax”All directives also work with block comments:
/* chant-disable-next-line COR010 */export const helper = { key: "value" };Usage Guidelines
Section titled “Usage Guidelines”- Prefer the narrowest scope possible (
disable-next-lineoverdisable) - Always specify the rule ID rather than suppressing all rules
- Include a
-- reasonwhen suppressing rules in shared or long-lived code - Use file-level
disablesparingly — typically only for generated files