astro-eslint-parser 1.4.0 → 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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll as t };
|
package/package.json
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-eslint-parser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Astro component parser for ESLint",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/index.mjs",
|
|
7
|
+
"types": "./lib/index.d.mts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.mts",
|
|
11
|
+
"import": "./lib/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
7
15
|
"files": [
|
|
8
16
|
"lib"
|
|
9
17
|
],
|
|
10
18
|
"engines": {
|
|
11
|
-
"node": "^
|
|
19
|
+
"node": "^22.22.3 || ^24.16.0 || >=26.3.0"
|
|
12
20
|
},
|
|
13
21
|
"scripts": {
|
|
14
22
|
"prebuild": "npm run -s clean",
|
|
15
|
-
"build": "
|
|
16
|
-
"build:tsup": "tsup",
|
|
23
|
+
"build": "tsdown",
|
|
17
24
|
"clean": "rimraf .nyc_output lib coverage",
|
|
18
25
|
"lint": "eslint .",
|
|
19
26
|
"eslint-fix": "npm run lint -- --fix",
|
|
@@ -25,7 +32,7 @@
|
|
|
25
32
|
"debug-parser": "npm run ts -- ./tools/parser-test.ts",
|
|
26
33
|
"eslint-playground": "eslint tests/fixtures --ext .astro --config .eslintrc-for-playground.js --format codeframe",
|
|
27
34
|
"benchmark": "npm run ts -- benchmark/index.ts",
|
|
28
|
-
"ts": "env-cmd -e basic --
|
|
35
|
+
"ts": "env-cmd -e basic -- tsx",
|
|
29
36
|
"mocha": "npm run ts -- ./node_modules/mocha/bin/mocha.js",
|
|
30
37
|
"prerelease": "npm run clean && npm run build",
|
|
31
38
|
"release": "changeset publish"
|
|
@@ -48,60 +55,53 @@
|
|
|
48
55
|
},
|
|
49
56
|
"homepage": "https://github.com/ota-meshi/astro-eslint-parser#readme",
|
|
50
57
|
"dependencies": {
|
|
51
|
-
"@astrojs/compiler": "^
|
|
52
|
-
"@typescript-eslint/scope-manager": "^
|
|
53
|
-
"@typescript-eslint/types": "^
|
|
58
|
+
"@astrojs/compiler": "^4.0.0",
|
|
59
|
+
"@typescript-eslint/scope-manager": "^8.61.0",
|
|
60
|
+
"@typescript-eslint/types": "^8.61.0",
|
|
54
61
|
"astrojs-compiler-sync": "^1.0.0",
|
|
55
62
|
"debug": "^4.3.4",
|
|
56
|
-
"entities": "^
|
|
57
|
-
"eslint-scope": "^
|
|
58
|
-
"eslint-visitor-keys": "^
|
|
59
|
-
"espree": "^
|
|
63
|
+
"entities": "^8.0.0",
|
|
64
|
+
"eslint-scope": "^9.1.2",
|
|
65
|
+
"eslint-visitor-keys": "^5.0.1",
|
|
66
|
+
"espree": "^11.2.0",
|
|
60
67
|
"fast-glob": "^3.3.3",
|
|
61
68
|
"is-glob": "^4.0.3",
|
|
62
69
|
"semver": "^7.3.8"
|
|
63
70
|
},
|
|
64
71
|
"devDependencies": {
|
|
65
|
-
"@changesets/changelog-github": "^0.
|
|
66
|
-
"@changesets/cli": "^2.
|
|
67
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
72
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
73
|
+
"@changesets/cli": "^2.31.0",
|
|
74
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
68
75
|
"@ota-meshi/eslint-plugin": "^0.20.0",
|
|
69
76
|
"@types/benchmark": "^2.1.1",
|
|
70
77
|
"@types/chai": "^5.0.0",
|
|
71
78
|
"@types/debug": "^4.1.7",
|
|
72
|
-
"@types/eslint": "^9.0.0",
|
|
73
|
-
"@types/eslint-scope": "^8.0.0",
|
|
74
|
-
"@types/eslint-visitor-keys": "^3.0.0",
|
|
75
79
|
"@types/is-glob": "^4.0.4",
|
|
76
80
|
"@types/mocha": "^10.0.0",
|
|
77
81
|
"@types/node": "^24.0.0",
|
|
78
82
|
"@types/semver": "^7.3.9",
|
|
79
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
80
|
-
"@typescript-eslint/parser": "^8.
|
|
81
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
83
|
+
"@typescript-eslint/eslint-plugin": "^8.61.0",
|
|
84
|
+
"@typescript-eslint/parser": "^8.61.0",
|
|
85
|
+
"@typescript-eslint/typescript-estree": "^8.61.0",
|
|
82
86
|
"astro": "^6.0.0",
|
|
83
87
|
"astro-eslint-parser": ">=0.1.0",
|
|
84
88
|
"benchmark": "^2.1.4",
|
|
85
89
|
"chai": "^6.0.0",
|
|
86
90
|
"env-cmd": "^11.0.0",
|
|
87
|
-
"
|
|
88
|
-
"esbuild-register": "^3.3.3",
|
|
89
|
-
"eslint": "^9.19.0",
|
|
91
|
+
"eslint": "^10.5.0",
|
|
90
92
|
"eslint-config-prettier": "^10.0.0",
|
|
91
93
|
"eslint-formatter-codeframe": "^7.32.1",
|
|
92
94
|
"eslint-plugin-astro": "^1.0.0",
|
|
93
95
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
94
|
-
"eslint-plugin-jsdoc": "^
|
|
96
|
+
"eslint-plugin-jsdoc": "^63.0.2",
|
|
95
97
|
"eslint-plugin-json-schema-validator": "^6.0.0",
|
|
96
98
|
"eslint-plugin-jsonc": "^3.0.0",
|
|
97
|
-
"eslint-plugin-
|
|
98
|
-
"eslint-plugin-n": "^17.0.0",
|
|
99
|
+
"eslint-plugin-n": "^18.0.0",
|
|
99
100
|
"eslint-plugin-node-dependencies": "^2.0.0",
|
|
100
101
|
"eslint-plugin-prettier": "^5.0.0",
|
|
101
|
-
"eslint-plugin-react": "^7.29.4",
|
|
102
102
|
"eslint-plugin-regexp": "^3.0.0",
|
|
103
|
-
"eslint-plugin-simple-import-sort": "^
|
|
104
|
-
"eslint-plugin-svelte": "^3.
|
|
103
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
104
|
+
"eslint-plugin-svelte": "^3.19.0",
|
|
105
105
|
"estree-walker": "^3.0.0",
|
|
106
106
|
"globals": "^17.0.0",
|
|
107
107
|
"locate-character": "^3.0.0",
|
|
@@ -111,12 +111,13 @@
|
|
|
111
111
|
"nyc": "^18.0.0",
|
|
112
112
|
"prettier": "^3.0.0",
|
|
113
113
|
"prettier-plugin-astro": "^0.14.0",
|
|
114
|
-
"prettier-plugin-svelte": "^
|
|
114
|
+
"prettier-plugin-svelte": "^4.0.0",
|
|
115
115
|
"string-replace-loader": "^3.0.3",
|
|
116
116
|
"svelte": "^5.19.3",
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"typescript
|
|
117
|
+
"tsdown": "^0.22.2",
|
|
118
|
+
"tsx": "^4.22.4",
|
|
119
|
+
"typescript": "~6.0.0",
|
|
120
|
+
"typescript-eslint": "^8.61.0",
|
|
120
121
|
"typescript-eslint-parser-for-extra-files": "^0.9.0"
|
|
121
122
|
},
|
|
122
123
|
"publishConfig": {
|
package/lib/index.d.ts
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import * as eslint from 'eslint';
|
|
2
|
-
import { TSESTree } from '@typescript-eslint/types';
|
|
3
|
-
import { ScopeManager } from '@typescript-eslint/scope-manager';
|
|
4
|
-
import { ParseResult } from '@astrojs/compiler';
|
|
5
|
-
import { Node, AttributeNode, ParentNode } from '@astrojs/compiler/types';
|
|
6
|
-
import { VisitorKeys as VisitorKeys$1 } from '@typescript-eslint/visitor-keys';
|
|
7
|
-
|
|
8
|
-
type RangeAndLoc = {
|
|
9
|
-
range: TSESTree.Range;
|
|
10
|
-
loc: TSESTree.SourceLocation;
|
|
11
|
-
};
|
|
12
|
-
declare class Context {
|
|
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
|
-
}
|
|
42
|
-
declare class LinesAndColumns {
|
|
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
|
-
}
|
|
57
|
-
declare class NormalizedLineFeed {
|
|
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
|
-
}
|
|
67
|
-
|
|
68
|
-
interface BaseNode {
|
|
69
|
-
loc: TSESTree.SourceLocation;
|
|
70
|
-
range: TSESTree.Range;
|
|
71
|
-
type: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
type JSXNode = JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText;
|
|
75
|
-
type JSXChild = JSXElement | JSXFragment | JSXExpression | JSXText | AstroHTMLComment | AstroRawText;
|
|
76
|
-
type JSXParentNode = JSXElement | JSXFragment | AstroFragment;
|
|
77
|
-
interface JSXElement extends BaseNode {
|
|
78
|
-
type: "JSXElement";
|
|
79
|
-
openingElement: JSXOpeningElement;
|
|
80
|
-
closingElement: JSXClosingElement | null;
|
|
81
|
-
children: JSXChild[];
|
|
82
|
-
parent?: JSXParentNode;
|
|
83
|
-
}
|
|
84
|
-
interface JSXFragment extends BaseNode {
|
|
85
|
-
type: "JSXFragment";
|
|
86
|
-
openingFragment: JSXOpeningFragment;
|
|
87
|
-
closingFragment: JSXClosingFragment;
|
|
88
|
-
children: JSXChild[];
|
|
89
|
-
parent?: JSXParentNode;
|
|
90
|
-
}
|
|
91
|
-
interface JSXOpeningElement extends BaseNode {
|
|
92
|
-
type: "JSXOpeningElement";
|
|
93
|
-
typeParameters?: TSESTree.TSTypeParameterInstantiation;
|
|
94
|
-
selfClosing: boolean;
|
|
95
|
-
name: JSXTagNameExpression;
|
|
96
|
-
attributes: (JSXAttribute | JSXSpreadAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute)[];
|
|
97
|
-
parent?: JSXElement;
|
|
98
|
-
}
|
|
99
|
-
interface JSXClosingElement extends BaseNode {
|
|
100
|
-
type: "JSXClosingElement";
|
|
101
|
-
name: JSXTagNameExpression;
|
|
102
|
-
parent?: JSXElement;
|
|
103
|
-
}
|
|
104
|
-
interface JSXClosingFragment extends BaseNode {
|
|
105
|
-
type: "JSXClosingFragment";
|
|
106
|
-
parent?: JSXFragment;
|
|
107
|
-
}
|
|
108
|
-
interface JSXOpeningFragment extends BaseNode {
|
|
109
|
-
type: "JSXOpeningFragment";
|
|
110
|
-
parent?: JSXFragment;
|
|
111
|
-
}
|
|
112
|
-
interface JSXAttribute extends BaseNode {
|
|
113
|
-
type: "JSXAttribute";
|
|
114
|
-
name: JSXIdentifier | JSXNamespacedName;
|
|
115
|
-
value: JSXExpression | TSESTree.Literal | null;
|
|
116
|
-
parent?: JSXOpeningElement;
|
|
117
|
-
}
|
|
118
|
-
interface JSXSpreadAttribute extends BaseNode {
|
|
119
|
-
type: "JSXSpreadAttribute";
|
|
120
|
-
argument: TSESTree.Expression;
|
|
121
|
-
parent?: JSXOpeningElement;
|
|
122
|
-
}
|
|
123
|
-
type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
|
|
124
|
-
interface JSXIdentifier extends BaseNode {
|
|
125
|
-
type: "JSXIdentifier";
|
|
126
|
-
name: string;
|
|
127
|
-
parent?: JSXAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXClosingElement;
|
|
128
|
-
}
|
|
129
|
-
interface JSXMemberExpression extends BaseNode {
|
|
130
|
-
type: "JSXMemberExpression";
|
|
131
|
-
object: JSXTagNameExpression;
|
|
132
|
-
property: JSXIdentifier;
|
|
133
|
-
parent?: JSXMemberExpression | JSXOpeningElement | JSXClosingElement;
|
|
134
|
-
}
|
|
135
|
-
interface JSXNamespacedName extends BaseNode {
|
|
136
|
-
type: "JSXNamespacedName";
|
|
137
|
-
namespace: JSXIdentifier;
|
|
138
|
-
name: JSXIdentifier;
|
|
139
|
-
parent?: JSXAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute | JSXMemberExpression | JSXOpeningElement | JSXClosingElement;
|
|
140
|
-
}
|
|
141
|
-
type JSXExpression = JSXExpressionContainer | JSXSpreadChild;
|
|
142
|
-
interface JSXExpressionContainer extends BaseNode {
|
|
143
|
-
type: "JSXExpressionContainer";
|
|
144
|
-
expression: TSESTree.Expression | JSXEmptyExpression;
|
|
145
|
-
parent?: JSXAttribute | AstroShorthandAttribute | AstroTemplateLiteralAttribute | JSXParentNode;
|
|
146
|
-
}
|
|
147
|
-
interface JSXSpreadChild extends BaseNode {
|
|
148
|
-
type: "JSXSpreadChild";
|
|
149
|
-
expression: TSESTree.Expression;
|
|
150
|
-
parent?: JSXAttribute | JSXParentNode;
|
|
151
|
-
}
|
|
152
|
-
interface JSXEmptyExpression extends BaseNode {
|
|
153
|
-
type: "JSXEmptyExpression";
|
|
154
|
-
parent?: JSXExpressionContainer;
|
|
155
|
-
}
|
|
156
|
-
interface JSXText extends BaseNode {
|
|
157
|
-
type: "JSXText";
|
|
158
|
-
value: string;
|
|
159
|
-
raw: string;
|
|
160
|
-
parent?: JSXParentNode;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
type AstroNode = AstroProgram | AstroFragment | AstroHTMLComment | AstroDoctype | AstroShorthandAttribute | AstroTemplateLiteralAttribute | AstroRawText;
|
|
164
|
-
type AstroChild = JSXElement | JSXFragment | JSXExpression | JSXText | AstroHTMLComment | AstroRawText;
|
|
165
|
-
type AstroParentNode = JSXElement | JSXFragment | AstroFragment;
|
|
166
|
-
/** Node of Astro program root */
|
|
167
|
-
interface AstroProgram extends Omit<TSESTree.Program, "type" | "body"> {
|
|
168
|
-
type: "Program";
|
|
169
|
-
body: (TSESTree.Program["body"][number] | AstroFragment)[];
|
|
170
|
-
sourceType: "script" | "module";
|
|
171
|
-
comments: TSESTree.Comment[];
|
|
172
|
-
tokens: TSESTree.Token[];
|
|
173
|
-
parent?: undefined;
|
|
174
|
-
}
|
|
175
|
-
/** Node of Astro fragment */
|
|
176
|
-
interface AstroFragment extends BaseNode {
|
|
177
|
-
type: "AstroFragment";
|
|
178
|
-
children: (AstroChild | AstroDoctype)[];
|
|
179
|
-
parent?: AstroParentNode;
|
|
180
|
-
}
|
|
181
|
-
/** Node of Astro html comment */
|
|
182
|
-
interface AstroHTMLComment extends BaseNode {
|
|
183
|
-
type: "AstroHTMLComment";
|
|
184
|
-
value: string;
|
|
185
|
-
parent?: AstroParentNode;
|
|
186
|
-
}
|
|
187
|
-
/** Node of Astro doctype */
|
|
188
|
-
interface AstroDoctype extends BaseNode {
|
|
189
|
-
type: "AstroDoctype";
|
|
190
|
-
parent?: AstroFragment;
|
|
191
|
-
}
|
|
192
|
-
/** Node of Astro shorthand attribute */
|
|
193
|
-
interface AstroShorthandAttribute extends Omit<JSXAttribute, "type"> {
|
|
194
|
-
type: "AstroShorthandAttribute";
|
|
195
|
-
value: JSXExpressionContainer;
|
|
196
|
-
}
|
|
197
|
-
/** Node of Astro template-literal attribute */
|
|
198
|
-
interface AstroTemplateLiteralAttribute extends Omit<JSXAttribute, "type"> {
|
|
199
|
-
type: "AstroTemplateLiteralAttribute";
|
|
200
|
-
value: JSXExpressionContainer & {
|
|
201
|
-
expression: TSESTree.TemplateLiteral;
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/** Node of Astro raw text */
|
|
205
|
-
interface AstroRawText extends Omit<JSXText, "type"> {
|
|
206
|
-
type: "AstroRawText";
|
|
207
|
-
parent?: JSXElement;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
type Comment = TSESTree.Comment;
|
|
211
|
-
type Token = TSESTree.Token;
|
|
212
|
-
type SourceLocation = TSESTree.SourceLocation;
|
|
213
|
-
type Range = TSESTree.Range;
|
|
214
|
-
type Position = TSESTree.Position;
|
|
215
|
-
|
|
216
|
-
type index_AstroChild = AstroChild;
|
|
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
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Parse source code
|
|
257
|
-
*/
|
|
258
|
-
declare function parseForESLint$1(code: string, options?: any): {
|
|
259
|
-
ast: AstroProgram;
|
|
260
|
-
services: Record<string, any> & {
|
|
261
|
-
isAstro: true;
|
|
262
|
-
getAstroAst: () => ParseResult["ast"];
|
|
263
|
-
getAstroResult: () => ParseResult;
|
|
264
|
-
};
|
|
265
|
-
visitorKeys: {
|
|
266
|
-
[type: string]: string[];
|
|
267
|
-
};
|
|
268
|
-
scopeManager: ScopeManager;
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
interface ParseTemplateResult {
|
|
272
|
-
result: ParseResult;
|
|
273
|
-
getEndOffset: (node: Node) => number;
|
|
274
|
-
calcAttributeValueStartOffset: (node: AttributeNode) => number;
|
|
275
|
-
calcAttributeEndOffset: (node: AttributeNode) => number;
|
|
276
|
-
walk: (parent: ParentNode, enter: (n: Node | AttributeNode, parents: ParentNode[]) => void, leave?: (n: Node | AttributeNode, parents: ParentNode[]) => void) => void;
|
|
277
|
-
getLocFromIndex: (index: number) => {
|
|
278
|
-
line: number;
|
|
279
|
-
column: number;
|
|
280
|
-
};
|
|
281
|
-
getIndexFromLoc: (loc: {
|
|
282
|
-
line: number;
|
|
283
|
-
column: number;
|
|
284
|
-
}) => number;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Parse the astro component template.
|
|
288
|
-
*/
|
|
289
|
-
declare function parseTemplate(code: string): ParseTemplateResult;
|
|
290
|
-
|
|
291
|
-
interface Visitor<N> {
|
|
292
|
-
visitorKeys?: VisitorKeys$1;
|
|
293
|
-
enterNode(node: N, parent: N | null): void;
|
|
294
|
-
leaveNode(node: N, parent: N | null): void;
|
|
295
|
-
}
|
|
296
|
-
declare function traverseNodes(node: AstroNode, visitor: Visitor<AstroNode | TSESTree.Node>): void;
|
|
297
|
-
declare function traverseNodes(node: TSESTree.Node, visitor: Visitor<TSESTree.Node>): void;
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Astro parse errors.
|
|
301
|
-
*/
|
|
302
|
-
declare class ParseError extends SyntaxError {
|
|
303
|
-
index: number;
|
|
304
|
-
lineNumber: number;
|
|
305
|
-
column: number;
|
|
306
|
-
originalAST: any;
|
|
307
|
-
/**
|
|
308
|
-
* Initialize this ParseError instance.
|
|
309
|
-
*/
|
|
310
|
-
constructor(message: string, offset: number | {
|
|
311
|
-
line: number;
|
|
312
|
-
column: number;
|
|
313
|
-
}, ctx: Context);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
var name = "astro-eslint-parser";
|
|
317
|
-
var version = "1.4.0";
|
|
318
|
-
|
|
319
|
-
declare const meta_name: typeof name;
|
|
320
|
-
declare const meta_version: typeof version;
|
|
321
|
-
declare namespace meta {
|
|
322
|
-
export { meta_name as name, meta_version as version };
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Parse source code
|
|
327
|
-
*/
|
|
328
|
-
declare function parseForESLint(code: string, options?: any): ReturnType<typeof parseForESLint$1>;
|
|
329
|
-
declare const VisitorKeys: eslint.SourceCode.VisitorKeys;
|
|
330
|
-
|
|
331
|
-
export { index as AST, ParseError, type ParseTemplateResult, VisitorKeys, meta, name, parseForESLint, parseTemplate, traverseNodes };
|