@@ -41,27 +41,6 @@ import type {
4141import { JSONSchema4 } from "json-schema" ;
4242import { LegacyESLint } from "./use-at-your-own-risk.js" ;
4343
44- /*
45- * Need to extend the `RuleContext` interface to include the
46- * deprecated methods that have not yet been removed.
47- * TODO: Remove in v10.0.0.
48- */
49- declare module "@eslint/core" {
50- interface RuleContext {
51- /** @deprecated Use `sourceCode.getAncestors()` instead */
52- getAncestors ( ) : ESTree . Node [ ] ;
53-
54- /** @deprecated Use `sourceCode.getDeclaredVariables()` instead */
55- getDeclaredVariables ( node : ESTree . Node ) : Scope . Variable [ ] ;
56-
57- /** @deprecated Use `sourceCode.getScope()` instead */
58- getScope ( ) : Scope . Scope ;
59-
60- /** @deprecated Use `sourceCode.markVariableAsUsed()` instead */
61- markVariableAsUsed ( name : string ) : boolean ;
62- }
63- }
64-
6544export namespace AST {
6645 type TokenType =
6746 | "Boolean"
@@ -607,15 +586,18 @@ export namespace SourceCode {
607586// #endregion
608587
609588export namespace Rule {
610- type RuleModule = RuleDefinition < {
611- LangOptions : Linter . LanguageOptions ;
612- Code : SourceCode ;
613- RuleOptions : any [ ] ;
614- Visitor : NodeListener ;
615- Node : ESTree . Node ;
616- MessageIds : string ;
617- ExtRuleDocs : { } ;
618- } > ;
589+ interface RuleModule
590+ extends RuleDefinition < {
591+ LangOptions : Linter . LanguageOptions ;
592+ Code : SourceCode ;
593+ RuleOptions : any [ ] ;
594+ Visitor : NodeListener ;
595+ Node : ESTree . Node ;
596+ MessageIds : string ;
597+ ExtRuleDocs : { } ;
598+ } > {
599+ create ( context : RuleContext ) : NodeListener ;
600+ }
619601
620602 type NodeTypes = ESTree . Node [ "type" ] ;
621603 interface NodeListener extends RuleVisitor {
@@ -1199,7 +1181,23 @@ export namespace Rule {
11991181 Node : ESTree . Node ;
12001182 }
12011183 > {
1202- // report(descriptor: ReportDescriptor): void;
1184+ /*
1185+ * Need to extend the `RuleContext` interface to include the
1186+ * deprecated methods that have not yet been removed.
1187+ * TODO: Remove in v10.0.0.
1188+ */
1189+
1190+ /** @deprecated Use `sourceCode.getAncestors()` instead */
1191+ getAncestors ( ) : ESTree . Node [ ] ;
1192+
1193+ /** @deprecated Use `sourceCode.getDeclaredVariables()` instead */
1194+ getDeclaredVariables ( node : ESTree . Node ) : Scope . Variable [ ] ;
1195+
1196+ /** @deprecated Use `sourceCode.getScope()` instead */
1197+ getScope ( ) : Scope . Scope ;
1198+
1199+ /** @deprecated Use `sourceCode.markVariableAsUsed()` instead */
1200+ markVariableAsUsed ( name : string ) : boolean ;
12031201 }
12041202
12051203 type ReportFixer = (
0 commit comments