Module pragma

Module pragma 

Source
Expand description

Pragma handling for inline rule disabling.

Supports comment-based rule disabling similar to ESLint:

  • # dclint-disable - Disable all rules for the rest of the file
  • # dclint-disable rule-name - Disable specific rule(s) globally
  • # dclint-disable-next-line - Disable all rules for the next line
  • # dclint-disable-next-line rule-name - Disable specific rule(s) for next line
  • # dclint-disable-file - Disable all rules for the entire file

Structs§

PragmaState
Tracks which rules are disabled at which lines.

Functions§

extract_global_disable_rules
Extract global disable rules from the first comment line. Returns set of disabled rule names (empty string means all disabled).
extract_line_disable_rules
Extract line-specific disable rules. Returns map of line number -> set of disabled rules.
extract_pragmas
Extract pragmas from source content.
starts_with_disable_file_comment
Check if file starts with a disable-file comment.