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