/
Referencer.ts
81 lines (76 loc) · 2.72 KB
/
Referencer.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* eslint-disable @typescript-eslint/no-explicit-any */
import { TSESTree } from '@typescript-eslint/typescript-estree';
import ESLintReferencer from 'eslint-scope/lib/referencer';
import {
PatternVisitorCallback,
PatternVisitorOptions,
Visitor,
} from './Options';
import { Scope } from './Scope';
import { ScopeManager } from './ScopeManager';
interface Referencer<SM extends ScopeManager> extends Visitor {
isInnerMethodDefinition: boolean;
options: any;
scopeManager: SM;
parent?: TSESTree.Node;
currentScope(): Scope;
close(node: TSESTree.Node): void;
pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean;
popInnerMethodDefinition(isInnerMethodDefinition: boolean): void;
referencingDefaultValue(
pattern: any,
assignments: any,
maybeImplicitGlobal: any,
init: boolean,
): void;
visitPattern(
node: TSESTree.Node,
options: PatternVisitorOptions,
callback: PatternVisitorCallback,
): void;
visitFunction(node: TSESTree.Node): void;
visitClass(node: TSESTree.Node): void;
visitProperty(node: TSESTree.Node): void;
visitForIn(node: TSESTree.Node): void;
visitVariableDeclaration(
variableTargetScope: any,
type: any,
node: TSESTree.Node,
index: any,
): void;
AssignmentExpression(node: TSESTree.Node): void;
CatchClause(node: TSESTree.Node): void;
Program(node: TSESTree.Program): void;
Identifier(node: TSESTree.Identifier): void;
UpdateExpression(node: TSESTree.Node): void;
MemberExpression(node: TSESTree.Node): void;
Property(node: TSESTree.Node): void;
MethodDefinition(node: TSESTree.Node): void;
BreakStatement(): void;
ContinueStatement(): void;
LabeledStatement(node: TSESTree.Node): void;
ForStatement(node: TSESTree.Node): void;
ClassExpression(node: TSESTree.Node): void;
ClassDeclaration(node: TSESTree.Node): void;
CallExpression(node: TSESTree.Node): void;
BlockStatement(node: TSESTree.Node): void;
ThisExpression(): void;
WithStatement(node: TSESTree.Node): void;
VariableDeclaration(node: TSESTree.Node): void;
SwitchStatement(node: TSESTree.Node): void;
FunctionDeclaration(node: TSESTree.Node): void;
FunctionExpression(node: TSESTree.Node): void;
ForOfStatement(node: TSESTree.Node): void;
ForInStatement(node: TSESTree.Node): void;
ArrowFunctionExpression(node: TSESTree.Node): void;
ImportDeclaration(node: TSESTree.Node): void;
visitExportDeclaration(node: TSESTree.Node): void;
ExportDeclaration(node: TSESTree.Node): void;
ExportNamedDeclaration(node: TSESTree.Node): void;
ExportSpecifier(node: TSESTree.Node): void;
MetaProperty(): void;
}
const Referencer = ESLintReferencer as {
new <SM extends ScopeManager>(options: any, scopeManager: SM): Referencer<SM>;
};
export { Referencer };