astro-eslint-parser 1.3.2 → 2.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/README.md +88 -59
- package/lib/index.d.mts +199 -230
- package/lib/index.mjs +2301 -2801
- package/lib/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +37 -36
- package/lib/index.d.ts +0 -331
- package/lib/index.js +0 -2960
package/lib/index.d.mts
CHANGED
|
@@ -1,331 +1,300 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { VisitorKeys as VisitorKeys$1 } from '@typescript-eslint/visitor-keys';
|
|
1
|
+
import { TSESTree } from "@typescript-eslint/types";
|
|
2
|
+
import { ScopeManager } from "@typescript-eslint/scope-manager";
|
|
3
|
+
import { ParseResult } from "@astrojs/compiler";
|
|
4
|
+
import { AttributeNode, Node, ParentNode } from "@astrojs/compiler/types";
|
|
5
|
+
import { VisitorKeys as VisitorKeys$1 } from "@typescript-eslint/visitor-keys";
|
|
7
6
|
|
|
7
|
+
//#region src/context/index.d.ts
|
|
8
8
|
type RangeAndLoc = {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
range: TSESTree.Range;
|
|
10
|
+
loc: TSESTree.SourceLocation;
|
|
11
11
|
};
|
|
12
12
|
declare class Context {
|
|
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
|
-
|
|
13
|
+
readonly code: string;
|
|
14
|
+
readonly filePath?: string;
|
|
15
|
+
readonly locs: LinesAndColumns;
|
|
16
|
+
private readonly locsMap;
|
|
17
|
+
private readonly state;
|
|
18
|
+
constructor(code: string, filePath?: string);
|
|
19
|
+
getLocFromIndex(index: number): {
|
|
20
|
+
line: number;
|
|
21
|
+
column: number;
|
|
22
|
+
};
|
|
23
|
+
getIndexFromLoc(loc: {
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
}): number;
|
|
27
|
+
/**
|
|
28
|
+
* Get the location information of the given indexes.
|
|
29
|
+
*/
|
|
30
|
+
getLocations(start: number, end: number): RangeAndLoc;
|
|
31
|
+
/**
|
|
32
|
+
* Build token
|
|
33
|
+
*/
|
|
34
|
+
buildToken(type: TSESTree.Token["type"], range: TSESTree.Range): TSESTree.Token;
|
|
35
|
+
/**
|
|
36
|
+
* get text
|
|
37
|
+
*/
|
|
38
|
+
getText(range: TSESTree.Range): string;
|
|
39
|
+
get originalAST(): any;
|
|
40
|
+
set originalAST(originalAST: any);
|
|
41
41
|
}
|
|
42
42
|
declare class LinesAndColumns {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
private readonly lineStartIndices;
|
|
44
|
+
private readonly code;
|
|
45
|
+
private readonly normalizedLineFeed;
|
|
46
|
+
constructor(origCode: string);
|
|
47
|
+
getLocFromIndex(index: number): {
|
|
48
|
+
line: number;
|
|
49
|
+
column: number;
|
|
50
|
+
};
|
|
51
|
+
getIndexFromLoc(loc: {
|
|
52
|
+
line: number;
|
|
53
|
+
column: number;
|
|
54
|
+
}): number;
|
|
55
|
+
getNormalizedLineFeed(): NormalizedLineFeed;
|
|
56
56
|
}
|
|
57
57
|
declare class NormalizedLineFeed {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
readonly code: string;
|
|
59
|
+
private readonly offsets;
|
|
60
|
+
get needRemap(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Remap index
|
|
63
|
+
*/
|
|
64
|
+
readonly remapIndex: (index: number) => number;
|
|
65
|
+
constructor(code: string, offsets: number[]);
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/ast/base.d.ts
|
|
68
69
|
interface BaseNode {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
loc: TSESTree.SourceLocation;
|
|
71
|
+
range: TSESTree.Range;
|
|
72
|
+
type: string;
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/ast/jsx.d.ts
|
|
74
76
|
type JSXNode = JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText;
|
|
75
77
|
type JSXChild = JSXElement | JSXFragment | JSXExpression | JSXText | AstroHTMLComment | AstroRawText;
|
|
76
78
|
type JSXParentNode = JSXElement | JSXFragment | AstroFragment;
|
|
77
79
|
interface JSXElement extends BaseNode {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
type: "JSXElement";
|
|
81
|
+
openingElement: JSXOpeningElement;
|
|
82
|
+
closingElement: JSXClosingElement | null;
|
|
83
|
+
children: JSXChild[];
|
|
84
|
+
parent?: JSXParentNode;
|
|
83
85
|
}
|
|
84
86
|
interface JSXFragment extends BaseNode {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
type: "JSXFragment";
|
|
88
|
+
openingFragment: JSXOpeningFragment;
|
|
89
|
+
closingFragment: JSXClosingFragment;
|
|
90
|
+
children: JSXChild[];
|
|
91
|
+
parent?: JSXParentNode;
|
|
90
92
|
}
|
|
91
93
|
interface JSXOpeningElement extends BaseNode {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
type: "JSXOpeningElement";
|
|
95
|
+
typeParameters?: TSESTree.TSTypeParameterInstantiation;
|
|
96
|
+
selfClosing: boolean;
|
|
97
|
+
name: JSXTagNameExpression;
|
|
98
|
+
attributes: (JSXAttribute | JSXSpreadAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute)[];
|
|
99
|
+
parent?: JSXElement;
|
|
98
100
|
}
|
|
99
101
|
interface JSXClosingElement extends BaseNode {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
type: "JSXClosingElement";
|
|
103
|
+
name: JSXTagNameExpression;
|
|
104
|
+
parent?: JSXElement;
|
|
103
105
|
}
|
|
104
106
|
interface JSXClosingFragment extends BaseNode {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
type: "JSXClosingFragment";
|
|
108
|
+
parent?: JSXFragment;
|
|
107
109
|
}
|
|
108
110
|
interface JSXOpeningFragment extends BaseNode {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
type: "JSXOpeningFragment";
|
|
112
|
+
parent?: JSXFragment;
|
|
111
113
|
}
|
|
112
114
|
interface JSXAttribute extends BaseNode {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
type: "JSXAttribute";
|
|
116
|
+
name: JSXIdentifier | JSXNamespacedName;
|
|
117
|
+
value: JSXExpression | TSESTree.Literal | null;
|
|
118
|
+
parent?: JSXOpeningElement;
|
|
117
119
|
}
|
|
118
120
|
interface JSXSpreadAttribute extends BaseNode {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
type: "JSXSpreadAttribute";
|
|
122
|
+
argument: TSESTree.Expression;
|
|
123
|
+
parent?: JSXOpeningElement;
|
|
122
124
|
}
|
|
123
125
|
type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
|
|
124
126
|
interface JSXIdentifier extends BaseNode {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
type: "JSXIdentifier";
|
|
128
|
+
name: string;
|
|
129
|
+
parent?: JSXAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXClosingElement;
|
|
128
130
|
}
|
|
129
131
|
interface JSXMemberExpression extends BaseNode {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
type: "JSXMemberExpression";
|
|
133
|
+
object: JSXTagNameExpression;
|
|
134
|
+
property: JSXIdentifier;
|
|
135
|
+
parent?: JSXMemberExpression | JSXOpeningElement | JSXClosingElement;
|
|
134
136
|
}
|
|
135
137
|
interface JSXNamespacedName extends BaseNode {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
type: "JSXNamespacedName";
|
|
139
|
+
namespace: JSXIdentifier;
|
|
140
|
+
name: JSXIdentifier;
|
|
141
|
+
parent?: JSXAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute | JSXMemberExpression | JSXOpeningElement | JSXClosingElement;
|
|
140
142
|
}
|
|
141
143
|
type JSXExpression = JSXExpressionContainer | JSXSpreadChild;
|
|
142
144
|
interface JSXExpressionContainer extends BaseNode {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
type: "JSXExpressionContainer";
|
|
146
|
+
expression: TSESTree.Expression | JSXEmptyExpression;
|
|
147
|
+
parent?: JSXAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute | JSXParentNode;
|
|
146
148
|
}
|
|
147
149
|
interface JSXSpreadChild extends BaseNode {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
type: "JSXSpreadChild";
|
|
151
|
+
expression: TSESTree.Expression;
|
|
152
|
+
parent?: JSXAttribute | JSXParentNode;
|
|
151
153
|
}
|
|
152
154
|
interface JSXEmptyExpression extends BaseNode {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
type: "JSXEmptyExpression";
|
|
156
|
+
parent?: JSXExpressionContainer;
|
|
155
157
|
}
|
|
156
158
|
interface JSXText extends BaseNode {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
type: "JSXText";
|
|
160
|
+
value: string;
|
|
161
|
+
raw: string;
|
|
162
|
+
parent?: JSXParentNode;
|
|
161
163
|
}
|
|
162
|
-
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/ast/astro.d.ts
|
|
163
166
|
type AstroNode = AstroProgram | AstroFragment | AstroHTMLComment | AstroDoctype | AstroShorthandAttribute | AstroTemplateLiteralAttribute | AstroRawText;
|
|
164
167
|
type AstroChild = JSXElement | JSXFragment | JSXExpression | JSXText | AstroHTMLComment | AstroRawText;
|
|
165
168
|
type AstroParentNode = JSXElement | JSXFragment | AstroFragment;
|
|
166
169
|
/** Node of Astro program root */
|
|
167
170
|
interface AstroProgram extends Omit<TSESTree.Program, "type" | "body"> {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
type: "Program";
|
|
172
|
+
body: (TSESTree.Program["body"][number] | AstroFragment)[];
|
|
173
|
+
sourceType: "script" | "module";
|
|
174
|
+
comments: TSESTree.Comment[];
|
|
175
|
+
tokens: TSESTree.Token[];
|
|
176
|
+
parent?: undefined;
|
|
174
177
|
}
|
|
175
178
|
/** Node of Astro fragment */
|
|
176
179
|
interface AstroFragment extends BaseNode {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
type: "AstroFragment";
|
|
181
|
+
children: (AstroChild | AstroDoctype)[];
|
|
182
|
+
parent?: AstroParentNode;
|
|
180
183
|
}
|
|
181
184
|
/** Node of Astro html comment */
|
|
182
185
|
interface AstroHTMLComment extends BaseNode {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
type: "AstroHTMLComment";
|
|
187
|
+
value: string;
|
|
188
|
+
parent?: AstroParentNode;
|
|
186
189
|
}
|
|
187
190
|
/** Node of Astro doctype */
|
|
188
191
|
interface AstroDoctype extends BaseNode {
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
type: "AstroDoctype";
|
|
193
|
+
parent?: AstroFragment;
|
|
191
194
|
}
|
|
192
195
|
/** Node of Astro shorthand attribute */
|
|
193
196
|
interface AstroShorthandAttribute extends Omit<JSXAttribute, "type"> {
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
type: "AstroShorthandAttribute";
|
|
198
|
+
value: JSXExpressionContainer;
|
|
196
199
|
}
|
|
197
200
|
/** Node of Astro template-literal attribute */
|
|
198
201
|
interface AstroTemplateLiteralAttribute extends Omit<JSXAttribute, "type"> {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
type: "AstroTemplateLiteralAttribute";
|
|
203
|
+
value: JSXExpressionContainer & {
|
|
204
|
+
expression: TSESTree.TemplateLiteral;
|
|
205
|
+
};
|
|
203
206
|
}
|
|
204
207
|
/** Node of Astro raw text */
|
|
205
208
|
interface AstroRawText extends Omit<JSXText, "type"> {
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
type: "AstroRawText";
|
|
210
|
+
parent?: JSXElement;
|
|
211
|
+
}
|
|
212
|
+
declare namespace index_d_exports {
|
|
213
|
+
export { AstroChild, AstroDoctype, AstroFragment, AstroHTMLComment, AstroNode, AstroParentNode, AstroProgram, AstroRawText, AstroShorthandAttribute, AstroTemplateLiteralAttribute, Comment, JSXAttribute, JSXChild, JSXClosingElement, JSXClosingFragment, JSXElement, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXIdentifier, JSXMemberExpression, JSXNamespacedName, JSXNode, JSXOpeningElement, JSXOpeningFragment, JSXParentNode, JSXSpreadAttribute, JSXSpreadChild, JSXTagNameExpression, JSXText, Position, Range, SourceLocation, Token };
|
|
208
214
|
}
|
|
209
|
-
|
|
210
215
|
type Comment = TSESTree.Comment;
|
|
211
216
|
type Token = TSESTree.Token;
|
|
212
217
|
type SourceLocation = TSESTree.SourceLocation;
|
|
213
218
|
type Range = TSESTree.Range;
|
|
214
219
|
type Position = TSESTree.Position;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
type index_AstroDoctype = AstroDoctype;
|
|
218
|
-
type index_AstroFragment = AstroFragment;
|
|
219
|
-
type index_AstroHTMLComment = AstroHTMLComment;
|
|
220
|
-
type index_AstroNode = AstroNode;
|
|
221
|
-
type index_AstroParentNode = AstroParentNode;
|
|
222
|
-
type index_AstroProgram = AstroProgram;
|
|
223
|
-
type index_AstroRawText = AstroRawText;
|
|
224
|
-
type index_AstroShorthandAttribute = AstroShorthandAttribute;
|
|
225
|
-
type index_AstroTemplateLiteralAttribute = AstroTemplateLiteralAttribute;
|
|
226
|
-
type index_Comment = Comment;
|
|
227
|
-
type index_JSXAttribute = JSXAttribute;
|
|
228
|
-
type index_JSXChild = JSXChild;
|
|
229
|
-
type index_JSXClosingElement = JSXClosingElement;
|
|
230
|
-
type index_JSXClosingFragment = JSXClosingFragment;
|
|
231
|
-
type index_JSXElement = JSXElement;
|
|
232
|
-
type index_JSXEmptyExpression = JSXEmptyExpression;
|
|
233
|
-
type index_JSXExpression = JSXExpression;
|
|
234
|
-
type index_JSXExpressionContainer = JSXExpressionContainer;
|
|
235
|
-
type index_JSXFragment = JSXFragment;
|
|
236
|
-
type index_JSXIdentifier = JSXIdentifier;
|
|
237
|
-
type index_JSXMemberExpression = JSXMemberExpression;
|
|
238
|
-
type index_JSXNamespacedName = JSXNamespacedName;
|
|
239
|
-
type index_JSXNode = JSXNode;
|
|
240
|
-
type index_JSXOpeningElement = JSXOpeningElement;
|
|
241
|
-
type index_JSXOpeningFragment = JSXOpeningFragment;
|
|
242
|
-
type index_JSXParentNode = JSXParentNode;
|
|
243
|
-
type index_JSXSpreadAttribute = JSXSpreadAttribute;
|
|
244
|
-
type index_JSXSpreadChild = JSXSpreadChild;
|
|
245
|
-
type index_JSXTagNameExpression = JSXTagNameExpression;
|
|
246
|
-
type index_JSXText = JSXText;
|
|
247
|
-
type index_Position = Position;
|
|
248
|
-
type index_Range = Range;
|
|
249
|
-
type index_SourceLocation = SourceLocation;
|
|
250
|
-
type index_Token = Token;
|
|
251
|
-
declare namespace index {
|
|
252
|
-
export type { index_AstroChild as AstroChild, index_AstroDoctype as AstroDoctype, index_AstroFragment as AstroFragment, index_AstroHTMLComment as AstroHTMLComment, index_AstroNode as AstroNode, index_AstroParentNode as AstroParentNode, index_AstroProgram as AstroProgram, index_AstroRawText as AstroRawText, index_AstroShorthandAttribute as AstroShorthandAttribute, index_AstroTemplateLiteralAttribute as AstroTemplateLiteralAttribute, index_Comment as Comment, index_JSXAttribute as JSXAttribute, index_JSXChild as JSXChild, index_JSXClosingElement as JSXClosingElement, index_JSXClosingFragment as JSXClosingFragment, index_JSXElement as JSXElement, index_JSXEmptyExpression as JSXEmptyExpression, index_JSXExpression as JSXExpression, index_JSXExpressionContainer as JSXExpressionContainer, index_JSXFragment as JSXFragment, index_JSXIdentifier as JSXIdentifier, index_JSXMemberExpression as JSXMemberExpression, index_JSXNamespacedName as JSXNamespacedName, index_JSXNode as JSXNode, index_JSXOpeningElement as JSXOpeningElement, index_JSXOpeningFragment as JSXOpeningFragment, index_JSXParentNode as JSXParentNode, index_JSXSpreadAttribute as JSXSpreadAttribute, index_JSXSpreadChild as JSXSpreadChild, index_JSXTagNameExpression as JSXTagNameExpression, index_JSXText as JSXText, index_Position as Position, index_Range as Range, index_SourceLocation as SourceLocation, index_Token as Token };
|
|
253
|
-
}
|
|
254
|
-
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/parser/index.d.ts
|
|
255
222
|
/**
|
|
256
223
|
* Parse source code
|
|
257
224
|
*/
|
|
258
225
|
declare function parseForESLint$1(code: string, options?: any): {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
226
|
+
ast: AstroProgram;
|
|
227
|
+
services: Record<string, any> & {
|
|
228
|
+
isAstro: true;
|
|
229
|
+
getAstroAst: () => ParseResult["ast"];
|
|
230
|
+
getAstroResult: () => ParseResult;
|
|
231
|
+
};
|
|
232
|
+
visitorKeys: {
|
|
233
|
+
[type: string]: string[];
|
|
234
|
+
};
|
|
235
|
+
scopeManager: ScopeManager;
|
|
269
236
|
};
|
|
270
|
-
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/astro-tools/index.d.ts
|
|
271
239
|
interface ParseTemplateResult {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
240
|
+
result: ParseResult;
|
|
241
|
+
getEndOffset: (node: Node) => number;
|
|
242
|
+
calcAttributeValueStartOffset: (node: AttributeNode) => number;
|
|
243
|
+
calcAttributeEndOffset: (node: AttributeNode) => number;
|
|
244
|
+
walk: (parent: ParentNode, enter: (n: Node | AttributeNode, parents: ParentNode[]) => void, leave?: (n: Node | AttributeNode, parents: ParentNode[]) => void) => void;
|
|
245
|
+
getLocFromIndex: (index: number) => {
|
|
246
|
+
line: number;
|
|
247
|
+
column: number;
|
|
248
|
+
};
|
|
249
|
+
getIndexFromLoc: (loc: {
|
|
250
|
+
line: number;
|
|
251
|
+
column: number;
|
|
252
|
+
}) => number;
|
|
285
253
|
}
|
|
286
254
|
/**
|
|
287
255
|
* Parse the astro component template.
|
|
288
256
|
*/
|
|
289
257
|
declare function parseTemplate(code: string): ParseTemplateResult;
|
|
290
|
-
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/traverse.d.ts
|
|
291
260
|
interface Visitor<N> {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
261
|
+
visitorKeys?: VisitorKeys$1;
|
|
262
|
+
enterNode(node: N, parent: N | null): void;
|
|
263
|
+
leaveNode(node: N, parent: N | null): void;
|
|
295
264
|
}
|
|
296
265
|
declare function traverseNodes(node: AstroNode, visitor: Visitor<AstroNode | TSESTree.Node>): void;
|
|
297
266
|
declare function traverseNodes(node: TSESTree.Node, visitor: Visitor<TSESTree.Node>): void;
|
|
298
|
-
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region src/errors.d.ts
|
|
299
269
|
/**
|
|
300
270
|
* Astro parse errors.
|
|
301
271
|
*/
|
|
302
272
|
declare class ParseError extends SyntaxError {
|
|
303
|
-
|
|
304
|
-
|
|
273
|
+
index: number;
|
|
274
|
+
lineNumber: number;
|
|
275
|
+
column: number;
|
|
276
|
+
originalAST: any;
|
|
277
|
+
/**
|
|
278
|
+
* Initialize this ParseError instance.
|
|
279
|
+
*/
|
|
280
|
+
constructor(message: string, offset: number | {
|
|
281
|
+
line: number;
|
|
305
282
|
column: number;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Initialize this ParseError instance.
|
|
309
|
-
*/
|
|
310
|
-
constructor(message: string, offset: number | {
|
|
311
|
-
line: number;
|
|
312
|
-
column: number;
|
|
313
|
-
}, ctx: Context);
|
|
283
|
+
}, ctx: Context);
|
|
314
284
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
declare
|
|
320
|
-
|
|
321
|
-
declare namespace meta {
|
|
322
|
-
export { meta_name as name, meta_version as version };
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region package.json.d.ts
|
|
287
|
+
declare let name: string;
|
|
288
|
+
declare let version: string;
|
|
289
|
+
declare namespace meta_d_exports {
|
|
290
|
+
export { name, version };
|
|
323
291
|
}
|
|
324
|
-
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/index.d.ts
|
|
325
294
|
/**
|
|
326
295
|
* Parse source code
|
|
327
296
|
*/
|
|
328
297
|
declare function parseForESLint(code: string, options?: any): ReturnType<typeof parseForESLint$1>;
|
|
329
|
-
declare const VisitorKeys: eslint.SourceCode.VisitorKeys;
|
|
330
|
-
|
|
331
|
-
export {
|
|
298
|
+
declare const VisitorKeys: import("eslint").SourceCode.VisitorKeys;
|
|
299
|
+
//#endregion
|
|
300
|
+
export { index_d_exports as AST, ParseError, type ParseTemplateResult, VisitorKeys, meta_d_exports as meta, name, parseForESLint, parseTemplate, traverseNodes };
|