diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index d188a0a..3c68157 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -188,6 +188,7 @@ export interface RuleContext< LangOptions = LanguageOptions, Code extends SourceCode = SourceCode, RuleOptions = unknown[], + Node = unknown, > { /** * The current working directory for the session. @@ -269,7 +270,7 @@ export interface RuleContext< * The report function that the rule should use to report problems. * @param violation The violation to report. */ - report(violation: ViolationReport): void; + report(violation: ViolationReport): void; } // #region Rule Fixing @@ -392,11 +393,11 @@ interface ViolationReportBase { } type ViolationMessage = { message: string } | { messageId: string }; -type ViolationLocation = { loc: SourceLocation } | { node: object }; +type ViolationLocation = { loc: SourceLocation } | { node: Node }; -export type ViolationReport = ViolationReportBase & +export type ViolationReport = ViolationReportBase & ViolationMessage & - ViolationLocation; + ViolationLocation; // #region Suggestions