@vue-vine/eslint-parser 0.2.20 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +472 -454
- package/dist/index.js +10255 -9910
- package/package.json +7 -8
- package/dist/index.d.mts +0 -858
- package/dist/index.mjs +0 -10171
package/dist/index.d.ts
CHANGED
@@ -1,77 +1,81 @@
|
|
1
|
-
import {
|
2
|
-
import { ScopeManager } from
|
3
|
-
import {
|
4
|
-
import { TSESTree } from
|
5
|
-
import { VisitorKeys } from
|
1
|
+
import { ParserOptions, parseForESLint as parseForESLint$1 } from "@typescript-eslint/parser";
|
2
|
+
import { ScopeManager } from "eslint-scope";
|
3
|
+
import { TSESTree } from "@typescript-eslint/typescript-estree";
|
4
|
+
import { TSESTree as TSESTree$1 } from "@typescript-eslint/types";
|
5
|
+
import { VisitorKeys } from "eslint-visitor-keys";
|
6
6
|
|
7
|
+
//#region src/ast/errors.d.ts
|
8
|
+
/**
|
9
|
+
* HTML parse errors.
|
10
|
+
*/
|
7
11
|
/**
|
8
12
|
* HTML parse errors.
|
9
13
|
*/
|
10
14
|
declare class ParseError extends SyntaxError {
|
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
|
-
|
15
|
+
code?: ErrorCode;
|
16
|
+
index: number;
|
17
|
+
lineNumber: number;
|
18
|
+
column: number;
|
19
|
+
/**
|
20
|
+
* Create new parser error object.
|
21
|
+
* @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
|
22
|
+
* @param offset The offset number of this error.
|
23
|
+
* @param line The line number of this error.
|
24
|
+
* @param column The column number of this error.
|
25
|
+
*/
|
26
|
+
static fromCode(code: ErrorCode, offset: number, line: number, column: number): ParseError;
|
27
|
+
/**
|
28
|
+
* Normalize the error object.
|
29
|
+
* @param x The error object to normalize.
|
30
|
+
*/
|
31
|
+
static normalize(x: any): ParseError | null;
|
32
|
+
/**
|
33
|
+
* Initialize this ParseError instance.
|
34
|
+
* @param message The error message.
|
35
|
+
* @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
|
36
|
+
* @param offset The offset number of this error.
|
37
|
+
* @param line The line number of this error.
|
38
|
+
* @param column The column number of this error.
|
39
|
+
*/
|
40
|
+
constructor(message: string, code: ErrorCode | undefined, offset: number, line: number, column: number);
|
41
|
+
/**
|
42
|
+
* Type guard for ParseError.
|
43
|
+
* @param x The value to check.
|
44
|
+
* @returns `true` if the value has `message`, `pos`, `loc` properties.
|
45
|
+
*/
|
46
|
+
static isParseError(x: any): x is ParseError;
|
43
47
|
}
|
44
48
|
/**
|
45
49
|
* The error codes of HTML syntax errors.
|
46
50
|
* https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
|
47
51
|
*/
|
48
|
-
type ErrorCode = 'abrupt-closing-of-empty-comment' | 'absence-of-digits-in-numeric-character-reference' | 'cdata-in-html-content' | 'character-reference-outside-unicode-range' | 'control-character-in-input-stream' | 'control-character-reference' | 'eof-before-tag-name' | 'eof-in-cdata' | 'eof-in-comment' | 'eof-in-tag' | 'incorrectly-closed-comment' | 'incorrectly-opened-comment' | 'invalid-first-character-of-tag-name' | 'missing-attribute-value' | 'missing-end-tag-name' | 'missing-semicolon-after-character-reference' | 'missing-whitespace-between-attributes' | 'nested-comment' | 'noncharacter-character-reference' | 'noncharacter-in-input-stream' | 'null-character-reference' | 'surrogate-character-reference' | 'surrogate-in-input-stream' | 'unexpected-character-in-attribute-name' | 'unexpected-character-in-unquoted-attribute-value' | 'unexpected-equals-sign-before-attribute-name' | 'unexpected-null-character' | 'unexpected-question-mark-instead-of-tag-name' | 'unexpected-solidus-in-tag' | 'unknown-named-character-reference' | 'end-tag-with-attributes' | 'duplicate-attribute' | 'end-tag-with-trailing-solidus' | 'non-void-html-element-start-tag-with-trailing-solidus' | 'x-invalid-end-tag' | 'x-invalid-namespace' | 'x-missing-interpolation-end';
|
49
|
-
|
52
|
+
type ErrorCode = 'abrupt-closing-of-empty-comment' | 'absence-of-digits-in-numeric-character-reference' | 'cdata-in-html-content' | 'character-reference-outside-unicode-range' | 'control-character-in-input-stream' | 'control-character-reference' | 'eof-before-tag-name' | 'eof-in-cdata' | 'eof-in-comment' | 'eof-in-tag' | 'incorrectly-closed-comment' | 'incorrectly-opened-comment' | 'invalid-first-character-of-tag-name' | 'missing-attribute-value' | 'missing-end-tag-name' | 'missing-semicolon-after-character-reference' | 'missing-whitespace-between-attributes' | 'nested-comment' | 'noncharacter-character-reference' | 'noncharacter-in-input-stream' | 'null-character-reference' | 'surrogate-character-reference' | 'surrogate-in-input-stream' | 'unexpected-character-in-attribute-name' | 'unexpected-character-in-unquoted-attribute-value' | 'unexpected-equals-sign-before-attribute-name' | 'unexpected-null-character' | 'unexpected-question-mark-instead-of-tag-name' | 'unexpected-solidus-in-tag' | 'unknown-named-character-reference' | 'end-tag-with-attributes' | 'duplicate-attribute' | 'end-tag-with-trailing-solidus' | 'non-void-html-element-start-tag-with-trailing-solidus' | 'x-invalid-end-tag' | 'x-invalid-namespace' | 'x-missing-interpolation-end'; //#endregion
|
53
|
+
//#region src/ast/locations.d.ts
|
50
54
|
/**
|
51
55
|
* Location information in lines and columns.
|
52
56
|
*/
|
53
57
|
interface Location {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
/**
|
59
|
+
* The line number. This is 1-based.
|
60
|
+
*/
|
61
|
+
line: number;
|
62
|
+
/**
|
63
|
+
* The column number. This is 0-based.
|
64
|
+
*/
|
65
|
+
column: number;
|
62
66
|
}
|
63
67
|
/**
|
64
68
|
* Range information in lines and columns.
|
65
69
|
*/
|
66
70
|
interface LocationRange {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
/**
|
72
|
+
* The start location.
|
73
|
+
*/
|
74
|
+
start: Location;
|
75
|
+
/**
|
76
|
+
* The end location.
|
77
|
+
*/
|
78
|
+
end: Location;
|
75
79
|
}
|
76
80
|
/**
|
77
81
|
* Location information in offsets.
|
@@ -90,90 +94,99 @@ type OffsetRange = [Offset, Offset];
|
|
90
94
|
* Objects which have their location.
|
91
95
|
*/
|
92
96
|
interface HasLocation {
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
+
range: OffsetRange;
|
98
|
+
loc: LocationRange;
|
99
|
+
start?: number;
|
100
|
+
end?: number;
|
97
101
|
}
|
98
102
|
|
103
|
+
//#endregion
|
104
|
+
//#region src/common/parser-object.d.ts
|
99
105
|
/**
|
100
106
|
* The type of basic ESLint custom parser.
|
101
107
|
* e.g. espree
|
102
108
|
*/
|
103
109
|
interface BasicParserObject<R = ESLintProgram> {
|
104
|
-
|
105
|
-
|
110
|
+
parse: (code: string, options: any) => R;
|
111
|
+
parseForESLint: undefined;
|
106
112
|
}
|
107
113
|
/**
|
108
114
|
* The type of ESLint custom parser enhanced for ESLint.
|
109
115
|
* e.g. @babel/eslint-parser, @typescript-eslint/parser
|
110
116
|
*/
|
111
117
|
interface EnhancedParserObject<R = ESLintExtendedProgram> {
|
112
|
-
|
113
|
-
|
118
|
+
parseForESLint: (code: string, options: any) => R;
|
119
|
+
parse: undefined;
|
114
120
|
}
|
115
121
|
/**
|
116
122
|
* The type of ESLint (custom) parsers.
|
117
123
|
*/
|
118
124
|
type ParserObject<R1 = ESLintExtendedProgram, R2 = ESLintProgram> = EnhancedParserObject<R1> | BasicParserObject<R2>;
|
119
125
|
|
126
|
+
//#endregion
|
127
|
+
//#region src/template/utils/process-vine-template-node.d.ts
|
120
128
|
declare function prepareTemplate(templateNode: TSESTree.TaggedTemplateExpression): {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
129
|
+
templatePositionInfo: {
|
130
|
+
templateStartLine: number;
|
131
|
+
templateStartColumn: number;
|
132
|
+
templateStartOffset: number;
|
133
|
+
templateEndOffset: number;
|
134
|
+
templateEndLine: number;
|
135
|
+
templateEndColumn: number;
|
136
|
+
};
|
137
|
+
templateRawContent: string;
|
130
138
|
};
|
131
139
|
|
132
|
-
|
133
|
-
|
134
|
-
} & {};
|
140
|
+
//#endregion
|
141
|
+
//#region src/types.d.ts
|
142
|
+
type PrettierType<T> = { [K in keyof T]: T[K] } & {};
|
135
143
|
type TsESLintParseForESLint = ReturnType<typeof parseForESLint$1>;
|
136
144
|
interface ParseForESLintResult {
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
145
|
+
ast: ESLintProgram;
|
146
|
+
services: TsESLintParseForESLint['services'];
|
147
|
+
scopeManager: TsESLintParseForESLint['scopeManager'];
|
148
|
+
visitorKeys: TsESLintParseForESLint['visitorKeys'];
|
141
149
|
}
|
142
150
|
type VineESLintParserOptions = ParserOptions & {
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
151
|
+
parser?: boolean | string | ParserObject | Record<string, string | ParserObject | undefined>;
|
152
|
+
ecmaFeatures?: ParserOptions['ecmaFeatures'] & {
|
153
|
+
[key: string]: any;
|
154
|
+
};
|
155
|
+
sourceType?: 'module' | 'script';
|
147
156
|
};
|
148
157
|
interface VineTemplateMeta {
|
149
|
-
|
150
|
-
|
151
|
-
|
158
|
+
tokens: Token[];
|
159
|
+
comments: Token[];
|
160
|
+
errors: ParseError[];
|
152
161
|
}
|
153
162
|
type FinalProcessTemplateInfo = ReturnType<typeof prepareTemplate> & {
|
154
|
-
|
155
|
-
|
163
|
+
templateRootAST: VTemplateRoot;
|
164
|
+
templateMeta: VineTemplateMeta;
|
156
165
|
};
|
157
166
|
|
167
|
+
//#endregion
|
168
|
+
//#region src/ast/tokens.d.ts
|
158
169
|
/**
|
159
170
|
* Tokens.
|
160
171
|
*/
|
161
172
|
interface Token extends HasLocation {
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
173
|
+
/**
|
174
|
+
* Token types.
|
175
|
+
*/
|
176
|
+
type: string;
|
177
|
+
/**
|
178
|
+
* Processed values.
|
179
|
+
*/
|
180
|
+
value: string;
|
170
181
|
}
|
171
182
|
|
183
|
+
//#endregion
|
184
|
+
//#region src/ast/nodes.d.ts
|
172
185
|
/**
|
173
186
|
* Objects which have their parent.
|
174
187
|
*/
|
175
188
|
interface HasParent {
|
176
|
-
|
189
|
+
parent?: Node | null;
|
177
190
|
}
|
178
191
|
/**
|
179
192
|
* The union type for all nodes.
|
@@ -191,462 +204,462 @@ type ESLintNode = ESLintIdentifier | ESLintLiteral | ESLintProgram | ESLintSwitc
|
|
191
204
|
* The parsing result of ESLint custom parsers.
|
192
205
|
*/
|
193
206
|
interface ESLintExtendedProgram {
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
207
|
+
ast: ESLintProgram;
|
208
|
+
services?: Record<string, unknown>;
|
209
|
+
visitorKeys?: {
|
210
|
+
[type: string]: string[];
|
211
|
+
};
|
212
|
+
scopeManager?: ScopeManager;
|
200
213
|
}
|
201
214
|
interface ESLintProgram extends HasLocation, HasParent {
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
215
|
+
type: 'Program';
|
216
|
+
sourceType: 'script' | 'module';
|
217
|
+
body: (ESLintStatement | ESLintModuleDeclaration)[];
|
218
|
+
templateBody?: VElement & HasConcreteInfo;
|
219
|
+
tokens?: Token[];
|
220
|
+
comments?: Token[];
|
221
|
+
errors?: ParseError[];
|
209
222
|
}
|
210
223
|
type ESLintStatement = ESLintExpressionStatement | ESLintDirective | ESLintBlockStatement | ESLintEmptyStatement | ESLintDebuggerStatement | ESLintWithStatement | ESLintReturnStatement | ESLintLabeledStatement | ESLintBreakStatement | ESLintContinueStatement | ESLintIfStatement | ESLintSwitchStatement | ESLintThrowStatement | ESLintTryStatement | ESLintWhileStatement | ESLintDoWhileStatement | ESLintForStatement | ESLintForInStatement | ESLintForOfStatement | ESLintDeclaration;
|
211
224
|
interface ESLintEmptyStatement extends HasLocation, HasParent {
|
212
|
-
|
225
|
+
type: 'EmptyStatement';
|
213
226
|
}
|
214
227
|
interface ESLintBlockStatement extends HasLocation, HasParent {
|
215
|
-
|
216
|
-
|
228
|
+
type: 'BlockStatement';
|
229
|
+
body: ESLintStatement[];
|
217
230
|
}
|
218
231
|
interface ESLintExpressionStatement extends HasLocation, HasParent {
|
219
|
-
|
220
|
-
|
232
|
+
type: 'ExpressionStatement';
|
233
|
+
expression: ESLintExpression;
|
221
234
|
}
|
222
235
|
interface ESLintDirective extends HasLocation, HasParent {
|
223
|
-
|
224
|
-
|
225
|
-
|
236
|
+
type: 'ExpressionStatement';
|
237
|
+
expression: ESLintLiteral;
|
238
|
+
directive: string;
|
226
239
|
}
|
227
240
|
interface ESLintIfStatement extends HasLocation, HasParent {
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
241
|
+
type: 'IfStatement';
|
242
|
+
test: ESLintExpression;
|
243
|
+
consequent: ESLintStatement;
|
244
|
+
alternate: ESLintStatement | null;
|
232
245
|
}
|
233
246
|
interface ESLintSwitchStatement extends HasLocation, HasParent {
|
234
|
-
|
235
|
-
|
236
|
-
|
247
|
+
type: 'SwitchStatement';
|
248
|
+
discriminant: ESLintExpression;
|
249
|
+
cases: ESLintSwitchCase[];
|
237
250
|
}
|
238
251
|
interface ESLintSwitchCase extends HasLocation, HasParent {
|
239
|
-
|
240
|
-
|
241
|
-
|
252
|
+
type: 'SwitchCase';
|
253
|
+
test: ESLintExpression | null;
|
254
|
+
consequent: ESLintStatement[];
|
242
255
|
}
|
243
256
|
interface ESLintWhileStatement extends HasLocation, HasParent {
|
244
|
-
|
245
|
-
|
246
|
-
|
257
|
+
type: 'WhileStatement';
|
258
|
+
test: ESLintExpression;
|
259
|
+
body: ESLintStatement;
|
247
260
|
}
|
248
261
|
interface ESLintDoWhileStatement extends HasLocation, HasParent {
|
249
|
-
|
250
|
-
|
251
|
-
|
262
|
+
type: 'DoWhileStatement';
|
263
|
+
body: ESLintStatement;
|
264
|
+
test: ESLintExpression;
|
252
265
|
}
|
253
266
|
interface ESLintForStatement extends HasLocation, HasParent {
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
267
|
+
type: 'ForStatement';
|
268
|
+
init: ESLintVariableDeclaration | ESLintExpression | null;
|
269
|
+
test: ESLintExpression | null;
|
270
|
+
update: ESLintExpression | null;
|
271
|
+
body: ESLintStatement;
|
259
272
|
}
|
260
273
|
interface ESLintForInStatement extends HasLocation, HasParent {
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
274
|
+
type: 'ForInStatement';
|
275
|
+
left: ESLintVariableDeclaration | ESLintPattern;
|
276
|
+
right: ESLintExpression;
|
277
|
+
body: ESLintStatement;
|
265
278
|
}
|
266
279
|
interface ESLintForOfStatement extends HasLocation, HasParent {
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
280
|
+
type: 'ForOfStatement';
|
281
|
+
left: ESLintVariableDeclaration | ESLintPattern;
|
282
|
+
right: ESLintExpression;
|
283
|
+
body: ESLintStatement;
|
284
|
+
await: boolean;
|
272
285
|
}
|
273
286
|
interface ESLintLabeledStatement extends HasLocation, HasParent {
|
274
|
-
|
275
|
-
|
276
|
-
|
287
|
+
type: 'LabeledStatement';
|
288
|
+
label: ESLintIdentifier;
|
289
|
+
body: ESLintStatement;
|
277
290
|
}
|
278
291
|
interface ESLintBreakStatement extends HasLocation, HasParent {
|
279
|
-
|
280
|
-
|
292
|
+
type: 'BreakStatement';
|
293
|
+
label: ESLintIdentifier | null;
|
281
294
|
}
|
282
295
|
interface ESLintContinueStatement extends HasLocation, HasParent {
|
283
|
-
|
284
|
-
|
296
|
+
type: 'ContinueStatement';
|
297
|
+
label: ESLintIdentifier | null;
|
285
298
|
}
|
286
299
|
interface ESLintReturnStatement extends HasLocation, HasParent {
|
287
|
-
|
288
|
-
|
300
|
+
type: 'ReturnStatement';
|
301
|
+
argument: ESLintExpression | null;
|
289
302
|
}
|
290
303
|
interface ESLintThrowStatement extends HasLocation, HasParent {
|
291
|
-
|
292
|
-
|
304
|
+
type: 'ThrowStatement';
|
305
|
+
argument: ESLintExpression;
|
293
306
|
}
|
294
307
|
interface ESLintTryStatement extends HasLocation, HasParent {
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
308
|
+
type: 'TryStatement';
|
309
|
+
block: ESLintBlockStatement;
|
310
|
+
handler: ESLintCatchClause | null;
|
311
|
+
finalizer: ESLintBlockStatement | null;
|
299
312
|
}
|
300
313
|
interface ESLintCatchClause extends HasLocation, HasParent {
|
301
|
-
|
302
|
-
|
303
|
-
|
314
|
+
type: 'CatchClause';
|
315
|
+
param: ESLintPattern | null;
|
316
|
+
body: ESLintBlockStatement;
|
304
317
|
}
|
305
318
|
interface ESLintWithStatement extends HasLocation, HasParent {
|
306
|
-
|
307
|
-
|
308
|
-
|
319
|
+
type: 'WithStatement';
|
320
|
+
object: ESLintExpression;
|
321
|
+
body: ESLintStatement;
|
309
322
|
}
|
310
323
|
interface ESLintDebuggerStatement extends HasLocation, HasParent {
|
311
|
-
|
324
|
+
type: 'DebuggerStatement';
|
312
325
|
}
|
313
326
|
type ESLintDeclaration = ESLintFunctionDeclaration | ESLintVariableDeclaration | ESLintClassDeclaration;
|
314
327
|
interface ESLintFunctionDeclaration extends HasLocation, HasParent {
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
328
|
+
type: 'FunctionDeclaration';
|
329
|
+
async: boolean;
|
330
|
+
generator: boolean;
|
331
|
+
id: ESLintIdentifier | null;
|
332
|
+
params: ESLintPattern[];
|
333
|
+
body: ESLintBlockStatement;
|
321
334
|
}
|
322
335
|
interface ESLintVariableDeclaration extends HasLocation, HasParent {
|
323
|
-
|
324
|
-
|
325
|
-
|
336
|
+
type: 'VariableDeclaration';
|
337
|
+
kind: 'var' | 'let' | 'const';
|
338
|
+
declarations: ESLintVariableDeclarator[];
|
326
339
|
}
|
327
340
|
interface ESLintVariableDeclarator extends HasLocation, HasParent {
|
328
|
-
|
329
|
-
|
330
|
-
|
341
|
+
type: 'VariableDeclarator';
|
342
|
+
id: ESLintPattern;
|
343
|
+
init: ESLintExpression | null;
|
331
344
|
}
|
332
345
|
interface ESLintClassDeclaration extends HasLocation, HasParent {
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
346
|
+
type: 'ClassDeclaration';
|
347
|
+
id: ESLintIdentifier | null;
|
348
|
+
superClass: ESLintExpression | null;
|
349
|
+
body: ESLintClassBody;
|
337
350
|
}
|
338
351
|
interface ESLintClassBody extends HasLocation, HasParent {
|
339
|
-
|
340
|
-
|
352
|
+
type: 'ClassBody';
|
353
|
+
body: (ESLintMethodDefinition | ESLintPropertyDefinition | ESLintStaticBlock)[];
|
341
354
|
}
|
342
355
|
interface ESLintMethodDefinition extends HasLocation, HasParent {
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
356
|
+
type: 'MethodDefinition';
|
357
|
+
kind: 'constructor' | 'method' | 'get' | 'set';
|
358
|
+
computed: boolean;
|
359
|
+
static: boolean;
|
360
|
+
key: ESLintExpression | ESLintPrivateIdentifier;
|
361
|
+
value: ESLintFunctionExpression;
|
349
362
|
}
|
350
363
|
interface ESLintPropertyDefinition extends HasLocation, HasParent {
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
364
|
+
type: 'PropertyDefinition';
|
365
|
+
computed: boolean;
|
366
|
+
static: boolean;
|
367
|
+
key: ESLintExpression | ESLintPrivateIdentifier;
|
368
|
+
value: ESLintExpression | null;
|
356
369
|
}
|
357
370
|
interface ESLintStaticBlock extends HasLocation, HasParent, Omit<ESLintBlockStatement, 'type'> {
|
358
|
-
|
359
|
-
|
371
|
+
type: 'StaticBlock';
|
372
|
+
body: ESLintStatement[];
|
360
373
|
}
|
361
374
|
interface ESLintPrivateIdentifier extends HasLocation, HasParent {
|
362
|
-
|
363
|
-
|
375
|
+
type: 'PrivateIdentifier';
|
376
|
+
name: string;
|
364
377
|
}
|
365
378
|
type ESLintModuleDeclaration = ESLintImportDeclaration | ESLintExportNamedDeclaration | ESLintExportDefaultDeclaration | ESLintExportAllDeclaration;
|
366
379
|
type ESLintModuleSpecifier = ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier | ESLintExportSpecifier;
|
367
380
|
interface ESLintImportDeclaration extends HasLocation, HasParent {
|
368
|
-
|
369
|
-
|
370
|
-
|
381
|
+
type: 'ImportDeclaration';
|
382
|
+
specifiers: (ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier)[];
|
383
|
+
source: ESLintLiteral;
|
371
384
|
}
|
372
385
|
interface ESLintImportSpecifier extends HasLocation, HasParent {
|
373
|
-
|
374
|
-
|
375
|
-
|
386
|
+
type: 'ImportSpecifier';
|
387
|
+
imported: ESLintIdentifier | ESLintStringLiteral;
|
388
|
+
local: ESLintIdentifier;
|
376
389
|
}
|
377
390
|
interface ESLintImportDefaultSpecifier extends HasLocation, HasParent {
|
378
|
-
|
379
|
-
|
391
|
+
type: 'ImportDefaultSpecifier';
|
392
|
+
local: ESLintIdentifier;
|
380
393
|
}
|
381
394
|
interface ESLintImportNamespaceSpecifier extends HasLocation, HasParent {
|
382
|
-
|
383
|
-
|
395
|
+
type: 'ImportNamespaceSpecifier';
|
396
|
+
local: ESLintIdentifier;
|
384
397
|
}
|
385
398
|
interface ESLintImportExpression extends HasLocation, HasParent {
|
386
|
-
|
387
|
-
|
399
|
+
type: 'ImportExpression';
|
400
|
+
source: ESLintExpression;
|
388
401
|
}
|
389
402
|
interface ESLintExportNamedDeclaration extends HasLocation, HasParent {
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
403
|
+
type: 'ExportNamedDeclaration';
|
404
|
+
declaration?: ESLintDeclaration | null;
|
405
|
+
specifiers: ESLintExportSpecifier[];
|
406
|
+
source?: ESLintLiteral | null;
|
394
407
|
}
|
395
408
|
interface ESLintExportSpecifier extends HasLocation, HasParent {
|
396
|
-
|
397
|
-
|
398
|
-
|
409
|
+
type: 'ExportSpecifier';
|
410
|
+
local: ESLintIdentifier | ESLintStringLiteral;
|
411
|
+
exported: ESLintIdentifier | ESLintStringLiteral;
|
399
412
|
}
|
400
413
|
interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {
|
401
|
-
|
402
|
-
|
414
|
+
type: 'ExportDefaultDeclaration';
|
415
|
+
declaration: ESLintDeclaration | ESLintExpression;
|
403
416
|
}
|
404
417
|
interface ESLintExportAllDeclaration extends HasLocation, HasParent {
|
405
|
-
|
406
|
-
|
407
|
-
|
418
|
+
type: 'ExportAllDeclaration';
|
419
|
+
exported: ESLintIdentifier | ESLintStringLiteral | null;
|
420
|
+
source: ESLintLiteral;
|
408
421
|
}
|
409
422
|
type ESLintExpression = ESLintThisExpression | ESLintArrayExpression | ESLintObjectExpression | ESLintFunctionExpression | ESLintArrowFunctionExpression | ESLintYieldExpression | ESLintLiteral | ESLintUnaryExpression | ESLintUpdateExpression | ESLintBinaryExpression | ESLintAssignmentExpression | ESLintLogicalExpression | ESLintMemberExpression | ESLintConditionalExpression | ESLintCallExpression | ESLintNewExpression | ESLintSequenceExpression | ESLintTemplateLiteral | ESLintTaggedTemplateExpression | ESLintClassExpression | ESLintMetaProperty | ESLintIdentifier | ESLintAwaitExpression | ESLintChainExpression;
|
410
423
|
interface ESLintIdentifier extends HasLocation, HasParent {
|
411
|
-
|
412
|
-
|
424
|
+
type: 'Identifier';
|
425
|
+
name: string;
|
413
426
|
}
|
414
427
|
interface ESLintLiteralBase extends HasLocation, HasParent {
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
428
|
+
type: 'Literal';
|
429
|
+
value: string | boolean | null | number | RegExp | bigint;
|
430
|
+
raw: string;
|
431
|
+
regex?: {
|
432
|
+
pattern: string;
|
433
|
+
flags: string;
|
434
|
+
};
|
435
|
+
bigint?: string;
|
423
436
|
}
|
424
437
|
interface ESLintStringLiteral extends ESLintLiteralBase {
|
425
|
-
|
426
|
-
|
427
|
-
|
438
|
+
value: string;
|
439
|
+
regex?: undefined;
|
440
|
+
bigint?: undefined;
|
428
441
|
}
|
429
442
|
interface ESLintBooleanLiteral extends ESLintLiteralBase {
|
430
|
-
|
431
|
-
|
432
|
-
|
443
|
+
value: boolean;
|
444
|
+
regex?: undefined;
|
445
|
+
bigint?: undefined;
|
433
446
|
}
|
434
447
|
interface ESLintNullLiteral extends ESLintLiteralBase {
|
435
|
-
|
436
|
-
|
437
|
-
|
448
|
+
value: null;
|
449
|
+
regex?: undefined;
|
450
|
+
bigint?: undefined;
|
438
451
|
}
|
439
452
|
interface ESLintNumberLiteral extends ESLintLiteralBase {
|
440
|
-
|
441
|
-
|
442
|
-
|
453
|
+
value: number;
|
454
|
+
regex?: undefined;
|
455
|
+
bigint?: undefined;
|
443
456
|
}
|
444
457
|
interface ESLintRegExpLiteral extends ESLintLiteralBase {
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
458
|
+
value: null | RegExp;
|
459
|
+
regex: {
|
460
|
+
pattern: string;
|
461
|
+
flags: string;
|
462
|
+
};
|
463
|
+
bigint?: undefined;
|
451
464
|
}
|
452
465
|
interface ESLintBigIntLiteral extends ESLintLiteralBase {
|
453
|
-
|
454
|
-
|
455
|
-
|
466
|
+
value: null | bigint;
|
467
|
+
regex?: undefined;
|
468
|
+
bigint: string;
|
456
469
|
}
|
457
470
|
type ESLintLiteral = ESLintStringLiteral | ESLintBooleanLiteral | ESLintNullLiteral | ESLintNumberLiteral | ESLintRegExpLiteral | ESLintBigIntLiteral;
|
458
471
|
interface ESLintThisExpression extends HasLocation, HasParent {
|
459
|
-
|
472
|
+
type: 'ThisExpression';
|
460
473
|
}
|
461
474
|
interface ESLintArrayExpression extends HasLocation, HasParent {
|
462
|
-
|
463
|
-
|
475
|
+
type: 'ArrayExpression';
|
476
|
+
elements: (ESLintExpression | ESLintSpreadElement)[];
|
464
477
|
}
|
465
478
|
interface ESLintObjectExpression extends HasLocation, HasParent {
|
466
|
-
|
467
|
-
|
479
|
+
type: 'ObjectExpression';
|
480
|
+
properties: (ESLintProperty | ESLintSpreadElement | ESLintLegacySpreadProperty)[];
|
468
481
|
}
|
469
482
|
interface ESLintProperty extends HasLocation, HasParent {
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
483
|
+
type: 'Property';
|
484
|
+
kind: 'init' | 'get' | 'set';
|
485
|
+
method: boolean;
|
486
|
+
shorthand: boolean;
|
487
|
+
computed: boolean;
|
488
|
+
key: ESLintExpression;
|
489
|
+
value: ESLintExpression | ESLintPattern;
|
477
490
|
}
|
478
491
|
interface ESLintFunctionExpression extends HasLocation, HasParent {
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
492
|
+
type: 'FunctionExpression';
|
493
|
+
async: boolean;
|
494
|
+
generator: boolean;
|
495
|
+
id: ESLintIdentifier | null;
|
496
|
+
params: ESLintPattern[];
|
497
|
+
body: ESLintBlockStatement;
|
485
498
|
}
|
486
499
|
interface ESLintArrowFunctionExpression extends HasLocation, HasParent {
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
500
|
+
type: 'ArrowFunctionExpression';
|
501
|
+
async: boolean;
|
502
|
+
generator: boolean;
|
503
|
+
id: ESLintIdentifier | null;
|
504
|
+
params: ESLintPattern[];
|
505
|
+
body: ESLintBlockStatement;
|
493
506
|
}
|
494
507
|
interface ESLintSequenceExpression extends HasLocation, HasParent {
|
495
|
-
|
496
|
-
|
508
|
+
type: 'SequenceExpression';
|
509
|
+
expressions: ESLintExpression[];
|
497
510
|
}
|
498
511
|
interface ESLintUnaryExpression extends HasLocation, HasParent {
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
512
|
+
type: 'UnaryExpression';
|
513
|
+
operator: '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete';
|
514
|
+
prefix: boolean;
|
515
|
+
argument: ESLintExpression;
|
503
516
|
}
|
504
517
|
interface ESLintBinaryExpression extends HasLocation, HasParent {
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
518
|
+
type: 'BinaryExpression';
|
519
|
+
operator: '==' | '!=' | '===' | '!==' | '<' | '<=' | '>' | '>=' | '<<' | '>>' | '>>>' | '+' | '-' | '*' | '/' | '%' | '**' | '|' | '^' | '&' | 'in' | 'instanceof';
|
520
|
+
left: ESLintExpression | ESLintPrivateIdentifier;
|
521
|
+
right: ESLintExpression;
|
509
522
|
}
|
510
523
|
interface ESLintAssignmentExpression extends HasLocation, HasParent {
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
524
|
+
type: 'AssignmentExpression';
|
525
|
+
operator: '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '**=' | '<<=' | '>>=' | '>>>=' | '|=' | '^=' | '&=' | '||=' | '&&=' | '??=';
|
526
|
+
left: ESLintPattern;
|
527
|
+
right: ESLintExpression;
|
515
528
|
}
|
516
529
|
interface ESLintUpdateExpression extends HasLocation, HasParent {
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
530
|
+
type: 'UpdateExpression';
|
531
|
+
operator: '++' | '--';
|
532
|
+
argument: ESLintExpression;
|
533
|
+
prefix: boolean;
|
521
534
|
}
|
522
535
|
interface ESLintLogicalExpression extends HasLocation, HasParent {
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
536
|
+
type: 'LogicalExpression';
|
537
|
+
operator: '||' | '&&' | '??';
|
538
|
+
left: ESLintExpression;
|
539
|
+
right: ESLintExpression;
|
527
540
|
}
|
528
541
|
interface ESLintConditionalExpression extends HasLocation, HasParent {
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
542
|
+
type: 'ConditionalExpression';
|
543
|
+
test: ESLintExpression;
|
544
|
+
alternate: ESLintExpression;
|
545
|
+
consequent: ESLintExpression;
|
533
546
|
}
|
534
547
|
interface ESLintCallExpression extends HasLocation, HasParent {
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
548
|
+
type: 'CallExpression';
|
549
|
+
optional: boolean;
|
550
|
+
callee: ESLintExpression | ESLintSuper;
|
551
|
+
arguments: (ESLintExpression | ESLintSpreadElement)[];
|
539
552
|
}
|
540
553
|
interface ESLintSuper extends HasLocation, HasParent {
|
541
|
-
|
554
|
+
type: 'Super';
|
542
555
|
}
|
543
556
|
interface ESLintNewExpression extends HasLocation, HasParent {
|
544
|
-
|
545
|
-
|
546
|
-
|
557
|
+
type: 'NewExpression';
|
558
|
+
callee: ESLintExpression;
|
559
|
+
arguments: (ESLintExpression | ESLintSpreadElement)[];
|
547
560
|
}
|
548
561
|
interface ESLintMemberExpression extends HasLocation, HasParent {
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
562
|
+
type: 'MemberExpression';
|
563
|
+
optional: boolean;
|
564
|
+
computed: boolean;
|
565
|
+
object: ESLintExpression | ESLintSuper;
|
566
|
+
property: ESLintExpression | ESLintPrivateIdentifier;
|
554
567
|
}
|
555
568
|
interface ESLintYieldExpression extends HasLocation, HasParent {
|
556
|
-
|
557
|
-
|
558
|
-
|
569
|
+
type: 'YieldExpression';
|
570
|
+
delegate: boolean;
|
571
|
+
argument: ESLintExpression | null;
|
559
572
|
}
|
560
573
|
interface ESLintAwaitExpression extends HasLocation, HasParent {
|
561
|
-
|
562
|
-
|
574
|
+
type: 'AwaitExpression';
|
575
|
+
argument: ESLintExpression;
|
563
576
|
}
|
564
577
|
interface ESLintTemplateLiteral extends HasLocation, HasParent {
|
565
|
-
|
566
|
-
|
567
|
-
|
578
|
+
type: 'TemplateLiteral';
|
579
|
+
quasis: ESLintTemplateElement[];
|
580
|
+
expressions: ESLintExpression[];
|
568
581
|
}
|
569
582
|
interface ESLintTaggedTemplateExpression extends HasLocation, HasParent {
|
570
|
-
|
571
|
-
|
572
|
-
|
583
|
+
type: 'TaggedTemplateExpression';
|
584
|
+
tag: ESLintExpression;
|
585
|
+
quasi: ESLintTemplateLiteral;
|
573
586
|
}
|
574
587
|
interface ESLintTemplateElement extends HasLocation, HasParent {
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
588
|
+
type: 'TemplateElement';
|
589
|
+
tail: boolean;
|
590
|
+
value: {
|
591
|
+
cooked: string | null;
|
592
|
+
raw: string;
|
593
|
+
};
|
581
594
|
}
|
582
595
|
interface ESLintClassExpression extends HasLocation, HasParent {
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
596
|
+
type: 'ClassExpression';
|
597
|
+
id: ESLintIdentifier | null;
|
598
|
+
superClass: ESLintExpression | null;
|
599
|
+
body: ESLintClassBody;
|
587
600
|
}
|
588
601
|
interface ESLintMetaProperty extends HasLocation, HasParent {
|
589
|
-
|
590
|
-
|
591
|
-
|
602
|
+
type: 'MetaProperty';
|
603
|
+
meta: ESLintIdentifier;
|
604
|
+
property: ESLintIdentifier;
|
592
605
|
}
|
593
606
|
type ESLintPattern = ESLintIdentifier | ESLintObjectPattern | ESLintArrayPattern | ESLintRestElement | ESLintAssignmentPattern | ESLintMemberExpression | ESLintLegacyRestProperty;
|
594
607
|
interface ESLintObjectPattern extends HasLocation, HasParent {
|
595
|
-
|
596
|
-
|
608
|
+
type: 'ObjectPattern';
|
609
|
+
properties: (ESLintAssignmentProperty | ESLintRestElement | ESLintLegacyRestProperty)[];
|
597
610
|
}
|
598
611
|
interface ESLintAssignmentProperty extends ESLintProperty {
|
599
|
-
|
600
|
-
|
601
|
-
|
612
|
+
value: ESLintPattern;
|
613
|
+
kind: 'init';
|
614
|
+
method: false;
|
602
615
|
}
|
603
616
|
interface ESLintArrayPattern extends HasLocation, HasParent {
|
604
|
-
|
605
|
-
|
617
|
+
type: 'ArrayPattern';
|
618
|
+
elements: ESLintPattern[];
|
606
619
|
}
|
607
620
|
interface ESLintRestElement extends HasLocation, HasParent {
|
608
|
-
|
609
|
-
|
621
|
+
type: 'RestElement';
|
622
|
+
argument: ESLintPattern;
|
610
623
|
}
|
611
624
|
interface ESLintSpreadElement extends HasLocation, HasParent {
|
612
|
-
|
613
|
-
|
625
|
+
type: 'SpreadElement';
|
626
|
+
argument: ESLintExpression;
|
614
627
|
}
|
615
628
|
interface ESLintAssignmentPattern extends HasLocation, HasParent {
|
616
|
-
|
617
|
-
|
618
|
-
|
629
|
+
type: 'AssignmentPattern';
|
630
|
+
left: ESLintPattern;
|
631
|
+
right: ESLintExpression;
|
619
632
|
}
|
620
633
|
type ESLintChainElement = ESLintCallExpression | ESLintMemberExpression;
|
621
634
|
interface ESLintChainExpression extends HasLocation, HasParent {
|
622
|
-
|
623
|
-
|
635
|
+
type: 'ChainExpression';
|
636
|
+
expression: ESLintChainElement;
|
624
637
|
}
|
625
638
|
/**
|
626
639
|
* Legacy for babel-eslint and espree.
|
627
640
|
*/
|
628
641
|
interface ESLintLegacyRestProperty extends HasLocation, HasParent {
|
629
|
-
|
630
|
-
|
642
|
+
type: 'RestProperty' | 'ExperimentalRestProperty';
|
643
|
+
argument: ESLintPattern;
|
631
644
|
}
|
632
645
|
/**
|
633
646
|
* Legacy for babel-eslint and espree.
|
634
647
|
*/
|
635
648
|
interface ESLintLegacySpreadProperty extends HasLocation, HasParent {
|
636
|
-
|
637
|
-
|
649
|
+
type: 'SpreadProperty' | 'ExperimentalSpreadProperty';
|
650
|
+
argument: ESLintExpression;
|
638
651
|
}
|
639
652
|
/**
|
640
653
|
* Constants of namespaces.
|
641
654
|
* @see https://infra.spec.whatwg.org/#namespaces
|
642
655
|
*/
|
643
656
|
declare const NS: Readonly<{
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
657
|
+
HTML: "http://www.w3.org/1999/xhtml";
|
658
|
+
MathML: "http://www.w3.org/1998/Math/MathML";
|
659
|
+
SVG: "http://www.w3.org/2000/svg";
|
660
|
+
XLink: "http://www.w3.org/1999/xlink";
|
661
|
+
XML: "http://www.w3.org/XML/1998/namespace";
|
662
|
+
XMLNS: "http://www.w3.org/2000/xmlns/";
|
650
663
|
}>;
|
651
664
|
/**
|
652
665
|
* Type of namespaces.
|
@@ -656,62 +669,62 @@ type Namespace = typeof NS.HTML | typeof NS.MathML | typeof NS.SVG | typeof NS.X
|
|
656
669
|
* Type of variable definitions.
|
657
670
|
*/
|
658
671
|
interface Variable {
|
659
|
-
|
660
|
-
|
661
|
-
|
672
|
+
id: ESLintIdentifier;
|
673
|
+
kind: 'v-for' | 'scope';
|
674
|
+
references: Reference[];
|
662
675
|
}
|
663
676
|
/**
|
664
677
|
* Type of variable references.
|
665
678
|
*/
|
666
679
|
interface Reference {
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
680
|
+
id: ESLintIdentifier;
|
681
|
+
mode: 'rw' | 'r' | 'w';
|
682
|
+
variable: Variable | null;
|
683
|
+
isValueReference?: boolean;
|
684
|
+
isTypeReference?: boolean;
|
672
685
|
}
|
673
686
|
/**
|
674
687
|
* The node of `v-for` directives.
|
675
688
|
*/
|
676
689
|
interface VForExpression extends HasLocation, HasParent {
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
690
|
+
type: 'VForExpression';
|
691
|
+
parent: VExpressionContainer;
|
692
|
+
left: ESLintPattern[];
|
693
|
+
right: ESLintExpression;
|
681
694
|
}
|
682
695
|
/**
|
683
696
|
* The node of `v-on` directives.
|
684
697
|
*/
|
685
698
|
interface VOnExpression extends HasLocation, HasParent {
|
686
|
-
|
687
|
-
|
688
|
-
|
699
|
+
type: 'VOnExpression';
|
700
|
+
parent: VExpressionContainer;
|
701
|
+
body: ESLintStatement[];
|
689
702
|
}
|
690
703
|
/**
|
691
704
|
* The node of `slot-scope` directives.
|
692
705
|
*/
|
693
706
|
interface VSlotScopeExpression extends HasLocation, HasParent {
|
694
|
-
|
695
|
-
|
696
|
-
|
707
|
+
type: 'VSlotScopeExpression';
|
708
|
+
parent: VExpressionContainer;
|
709
|
+
params: ESLintPattern[];
|
697
710
|
}
|
698
711
|
/**
|
699
712
|
* The node of a filter sequence which is separated by `|`.
|
700
713
|
*/
|
701
714
|
interface VFilterSequenceExpression extends HasLocation, HasParent {
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
715
|
+
type: 'VFilterSequenceExpression';
|
716
|
+
parent: VExpressionContainer;
|
717
|
+
expression: ESLintExpression;
|
718
|
+
filters: VFilter[];
|
706
719
|
}
|
707
720
|
/**
|
708
721
|
* The node of a filter sequence which is separated by `|`.
|
709
722
|
*/
|
710
723
|
interface VFilter extends HasLocation, HasParent {
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
724
|
+
type: 'VFilter';
|
725
|
+
parent: VFilterSequenceExpression;
|
726
|
+
callee: ESLintIdentifier;
|
727
|
+
arguments: (ESLintExpression | ESLintSpreadElement)[];
|
715
728
|
}
|
716
729
|
/**
|
717
730
|
* The union type of any nodes.
|
@@ -722,128 +735,130 @@ type VExpression = ESLintExpression | VFilterSequenceExpression | VForExpression
|
|
722
735
|
* Text nodes.
|
723
736
|
*/
|
724
737
|
interface VText extends HasLocation, HasParent {
|
725
|
-
|
726
|
-
|
727
|
-
|
738
|
+
type: 'VText';
|
739
|
+
parent: VTemplateRoot | VElement;
|
740
|
+
value: string;
|
728
741
|
}
|
729
742
|
/**
|
730
743
|
* The node of JavaScript expression in text.
|
731
744
|
* e.g. `{{ name }}`
|
732
745
|
*/
|
733
746
|
interface VExpressionContainer extends HasLocation, HasParent {
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
747
|
+
type: 'VExpressionContainer';
|
748
|
+
parent: VTemplateRoot | VElement | VDirective | VDirectiveKey;
|
749
|
+
expression: VExpression | null;
|
750
|
+
references: Reference[];
|
738
751
|
}
|
739
752
|
/**
|
740
753
|
* Attribute name nodes.
|
741
754
|
*/
|
742
755
|
interface VIdentifier extends HasLocation, HasParent {
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
756
|
+
type: 'VIdentifier';
|
757
|
+
parent: VAttribute | VDirectiveKey;
|
758
|
+
name: string;
|
759
|
+
rawName: string;
|
747
760
|
}
|
748
761
|
/**
|
749
762
|
* Attribute name nodes.
|
750
763
|
*/
|
751
764
|
interface VDirectiveKey extends HasLocation, HasParent {
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
765
|
+
type: 'VDirectiveKey';
|
766
|
+
parent: VDirective;
|
767
|
+
name: VIdentifier;
|
768
|
+
argument: VExpressionContainer | VIdentifier | null;
|
769
|
+
modifiers: VIdentifier[];
|
757
770
|
}
|
758
771
|
/**
|
759
772
|
* Attribute value nodes.
|
760
773
|
*/
|
761
774
|
interface VLiteral extends HasLocation, HasParent {
|
762
|
-
|
763
|
-
|
764
|
-
|
775
|
+
type: 'VLiteral';
|
776
|
+
parent: VAttribute;
|
777
|
+
value: string;
|
765
778
|
}
|
766
779
|
/**
|
767
780
|
* Static attribute nodes.
|
768
781
|
*/
|
769
782
|
interface VAttribute extends HasLocation, HasParent {
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
783
|
+
type: 'VAttribute';
|
784
|
+
parent: VStartTag;
|
785
|
+
directive: false;
|
786
|
+
key: VIdentifier;
|
787
|
+
value: VLiteral | null;
|
775
788
|
}
|
776
789
|
/**
|
777
790
|
* Directive nodes.
|
778
791
|
*/
|
779
792
|
interface VDirective extends HasLocation, HasParent {
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
793
|
+
type: 'VAttribute';
|
794
|
+
parent: VStartTag;
|
795
|
+
directive: true;
|
796
|
+
key: VDirectiveKey;
|
797
|
+
value: VExpressionContainer | null;
|
785
798
|
}
|
786
799
|
/**
|
787
800
|
* Start tag nodes.
|
788
801
|
*/
|
789
802
|
interface VStartTag extends HasLocation, HasParent {
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
803
|
+
type: 'VStartTag';
|
804
|
+
parent: VElement;
|
805
|
+
selfClosing: boolean;
|
806
|
+
attributes: (VAttribute | VDirective)[];
|
794
807
|
}
|
795
808
|
/**
|
796
809
|
* End tag nodes.
|
797
810
|
*/
|
798
811
|
interface VEndTag extends HasLocation, HasParent {
|
799
|
-
|
800
|
-
|
812
|
+
type: 'VEndTag';
|
813
|
+
parent: VElement;
|
801
814
|
}
|
802
815
|
/**
|
803
816
|
* The property which has concrete information.
|
804
817
|
*/
|
805
818
|
interface HasConcreteInfo {
|
806
|
-
|
807
|
-
|
808
|
-
|
819
|
+
tokens: Token[];
|
820
|
+
comments: Token[];
|
821
|
+
errors: ParseError[];
|
809
822
|
}
|
810
823
|
/**
|
811
824
|
* Element nodes.
|
812
825
|
*/
|
813
826
|
interface VElement extends HasLocation, HasParent {
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
827
|
+
type: 'VElement';
|
828
|
+
parent: VTemplateRoot | VElement;
|
829
|
+
namespace: Namespace;
|
830
|
+
name: string;
|
831
|
+
rawName: string;
|
832
|
+
startTag: VStartTag;
|
833
|
+
children: (VElement | VText | VExpressionContainer)[];
|
834
|
+
endTag: VEndTag | null;
|
835
|
+
variables: Variable[];
|
823
836
|
}
|
824
837
|
/**
|
825
838
|
* Root nodes.
|
826
839
|
*/
|
827
840
|
interface VTemplateRoot extends HasLocation {
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
841
|
+
type: 'VTemplateRoot';
|
842
|
+
parent: TSESTree$1.Node;
|
843
|
+
children: (VElement | VText | VExpressionContainer)[];
|
844
|
+
templateInfo?: PrettierType<Omit<FinalProcessTemplateInfo, 'templateMeta' | 'templateRootAST'>>;
|
832
845
|
}
|
833
846
|
|
847
|
+
//#endregion
|
848
|
+
//#region src/ast/traverse.d.ts
|
834
849
|
declare const KEYS: {
|
835
|
-
|
850
|
+
readonly [type: string]: readonly string[];
|
836
851
|
};
|
837
852
|
/**
|
838
853
|
* Get the keys of the given node to traverse it.
|
839
854
|
* @param node The node to get.
|
840
855
|
* @returns The keys to traverse.
|
841
856
|
*/
|
842
|
-
declare function getFallbackKeys(node:
|
857
|
+
declare function getFallbackKeys(node: any): string[];
|
843
858
|
interface Visitor {
|
844
|
-
|
845
|
-
|
846
|
-
|
859
|
+
visitorKeys?: VisitorKeys;
|
860
|
+
enterNode: (node: Node, parent: Node | null) => void;
|
861
|
+
leaveNode: (node: Node, parent: Node | null) => void;
|
847
862
|
}
|
848
863
|
/**
|
849
864
|
* Traverse the given AST tree.
|
@@ -852,7 +867,10 @@ interface Visitor {
|
|
852
867
|
*/
|
853
868
|
declare function traverseNodes(node: Node, visitor: Visitor): void;
|
854
869
|
|
870
|
+
//#endregion
|
871
|
+
//#region src/index.d.ts
|
855
872
|
declare function parse(code: string, parserOptions: VineESLintParserOptions): ESLintProgram;
|
856
873
|
declare function parseForESLint(code: string, parserOptions: VineESLintParserOptions): ParseForESLintResult;
|
857
874
|
|
858
|
-
|
875
|
+
//#endregion
|
876
|
+
export { ESLintArrayExpression, ESLintArrayPattern, ESLintArrowFunctionExpression, ESLintAssignmentExpression, ESLintAssignmentPattern, ESLintAssignmentProperty, ESLintAwaitExpression, ESLintBigIntLiteral, ESLintBinaryExpression, ESLintBlockStatement, ESLintBooleanLiteral, ESLintBreakStatement, ESLintCallExpression, ESLintCatchClause, ESLintChainElement, ESLintChainExpression, ESLintClassBody, ESLintClassDeclaration, ESLintClassExpression, ESLintConditionalExpression, ESLintContinueStatement, ESLintDebuggerStatement, ESLintDeclaration, ESLintDirective, ESLintDoWhileStatement, ESLintEmptyStatement, ESLintExportAllDeclaration, ESLintExportDefaultDeclaration, ESLintExportNamedDeclaration, ESLintExportSpecifier, ESLintExpression, ESLintExpressionStatement, ESLintExtendedProgram, ESLintForInStatement, ESLintForOfStatement, ESLintForStatement, ESLintFunctionDeclaration, ESLintFunctionExpression, ESLintIdentifier, ESLintIfStatement, ESLintImportDeclaration, ESLintImportDefaultSpecifier, ESLintImportExpression, ESLintImportNamespaceSpecifier, ESLintImportSpecifier, ESLintLabeledStatement, ESLintLegacyRestProperty, ESLintLegacySpreadProperty, ESLintLiteral, ESLintLogicalExpression, ESLintMemberExpression, ESLintMetaProperty, ESLintMethodDefinition, ESLintModuleDeclaration, ESLintModuleSpecifier, ESLintNewExpression, ESLintNode, ESLintNullLiteral, ESLintNumberLiteral, ESLintObjectExpression, ESLintObjectPattern, ESLintPattern, ESLintPrivateIdentifier, ESLintProgram, ESLintProperty, ESLintPropertyDefinition, ESLintRegExpLiteral, ESLintRestElement, ESLintReturnStatement, ESLintSequenceExpression, ESLintSpreadElement, ESLintStatement, ESLintStaticBlock, ESLintStringLiteral, ESLintSuper, ESLintSwitchCase, ESLintSwitchStatement, ESLintTaggedTemplateExpression, ESLintTemplateElement, ESLintTemplateLiteral, ESLintThisExpression, ESLintThrowStatement, ESLintTryStatement, ESLintUnaryExpression, ESLintUpdateExpression, ESLintVariableDeclaration, ESLintVariableDeclarator, ESLintWhileStatement, ESLintWithStatement, ESLintYieldExpression, ErrorCode, HasConcreteInfo, HasLocation, HasParent, KEYS, Location, LocationRange, NS, Namespace, Node, Offset, OffsetRange, ParseError, Reference, Token, VAttribute, VDirective, VDirectiveKey, VElement, VEndTag, VExpression, VExpressionContainer, VFilter, VFilterSequenceExpression, VForExpression, VIdentifier, VLiteral, VNode, VOnExpression, VSlotScopeExpression, VStartTag, VTemplateNode, VTemplateRoot, VText, Variable, Visitor, getFallbackKeys, parse, parseForESLint, traverseNodes };
|