@@ -41,27 +41,6 @@ import type {
41
41
import { JSONSchema4 } from "json-schema" ;
42
42
import { LegacyESLint } from "./use-at-your-own-risk.js" ;
43
43
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
-
65
44
export namespace AST {
66
45
type TokenType =
67
46
| "Boolean"
@@ -607,15 +586,18 @@ export namespace SourceCode {
607
586
// #endregion
608
587
609
588
export 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
+ }
619
601
620
602
type NodeTypes = ESTree . Node [ "type" ] ;
621
603
interface NodeListener extends RuleVisitor {
@@ -1199,7 +1181,23 @@ export namespace Rule {
1199
1181
Node : ESTree . Node ;
1200
1182
}
1201
1183
> {
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 ;
1203
1201
}
1204
1202
1205
1203
type ReportFixer = (
0 commit comments