Skip to content

[I] LinterRuleContext

Per-run rule context providing resolved options and a rule-scoped diagnostic collector.

Type ParameterDefault type
DM extends DiagnosticMessages-
Options extends Record<string, unknown>Record<string, never>
PropertyModifierTypeDescription
optionsreadonlyOptionsConfigured properties merged over rule defaults, or an empty object when neither is provided.
programreadonlyProgramProgram being linted; report rule findings through this context rather than directly to the program.
reportDiagnostic<M>(diag): void;

Formats a warning using this rule’s ID and messages and adds it to the linter’s results. Only targets belonging to the user project are collected: library, compiler, synthetic, and NoTarget findings are ignored. The program later reports collected findings.

Type Parameter
M extends string | number | symbol
ParameterType
diagLinterRuleDiagnosticReport<DM, M>

void