@vue-vine/eslint-parser 1.1.4 → 1.1.5
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 +8 -1
- package/dist/index.js +3 -187
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
@@ -3,7 +3,6 @@ import { ScopeManager } from "eslint-scope";
|
|
3
3
|
import { TSESTree } from "@typescript-eslint/typescript-estree";
|
4
4
|
import { ESLint, Linter } from "eslint";
|
5
5
|
import { TSESTree as TSESTree$1 } from "@typescript-eslint/types";
|
6
|
-
import { VisitorKeys } from "eslint-visitor-keys";
|
7
6
|
|
8
7
|
//#region src/ast/errors.d.ts
|
9
8
|
/**
|
@@ -788,6 +787,14 @@ interface VTemplateRoot extends HasLocation {
|
|
788
787
|
}
|
789
788
|
//#endregion
|
790
789
|
//#region src/ast/traverse.d.ts
|
790
|
+
// ------------------------------------------------------------------------------
|
791
|
+
// Helpers
|
792
|
+
// ------------------------------------------------------------------------------
|
793
|
+
interface VisitorKeys {
|
794
|
+
readonly [type: string]: readonly string[];
|
795
|
+
}
|
796
|
+
// Only export Vue template visitor keys, don't merge with standard ESLint keys
|
797
|
+
// to avoid overriding TypeScript visitor keys
|
791
798
|
declare const KEYS: VisitorKeys;
|
792
799
|
/**
|
793
800
|
* Get the keys of the given node to traverse it.
|
package/dist/index.js
CHANGED
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
39
39
|
//#endregion
|
40
40
|
//#region package.json
|
41
41
|
var name = "@vue-vine/eslint-parser";
|
42
|
-
var version = "1.1.
|
42
|
+
var version = "1.1.5";
|
43
43
|
|
44
44
|
//#endregion
|
45
45
|
//#region src/ast/errors.ts
|
@@ -127,192 +127,9 @@ const NS = Object.freeze({
|
|
127
127
|
XMLNS: "http://www.w3.org/2000/xmlns/"
|
128
128
|
});
|
129
129
|
|
130
|
-
//#endregion
|
131
|
-
//#region ../../node_modules/.pnpm/eslint-visitor-keys@4.2.1/node_modules/eslint-visitor-keys/lib/visitor-keys.js
|
132
|
-
/**
|
133
|
-
* @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
|
134
|
-
*/
|
135
|
-
/**
|
136
|
-
* @type {VisitorKeys}
|
137
|
-
*/
|
138
|
-
const KEYS$1 = {
|
139
|
-
ArrayExpression: ["elements"],
|
140
|
-
ArrayPattern: ["elements"],
|
141
|
-
ArrowFunctionExpression: ["params", "body"],
|
142
|
-
AssignmentExpression: ["left", "right"],
|
143
|
-
AssignmentPattern: ["left", "right"],
|
144
|
-
AwaitExpression: ["argument"],
|
145
|
-
BinaryExpression: ["left", "right"],
|
146
|
-
BlockStatement: ["body"],
|
147
|
-
BreakStatement: ["label"],
|
148
|
-
CallExpression: ["callee", "arguments"],
|
149
|
-
CatchClause: ["param", "body"],
|
150
|
-
ChainExpression: ["expression"],
|
151
|
-
ClassBody: ["body"],
|
152
|
-
ClassDeclaration: [
|
153
|
-
"id",
|
154
|
-
"superClass",
|
155
|
-
"body"
|
156
|
-
],
|
157
|
-
ClassExpression: [
|
158
|
-
"id",
|
159
|
-
"superClass",
|
160
|
-
"body"
|
161
|
-
],
|
162
|
-
ConditionalExpression: [
|
163
|
-
"test",
|
164
|
-
"consequent",
|
165
|
-
"alternate"
|
166
|
-
],
|
167
|
-
ContinueStatement: ["label"],
|
168
|
-
DebuggerStatement: [],
|
169
|
-
DoWhileStatement: ["body", "test"],
|
170
|
-
EmptyStatement: [],
|
171
|
-
ExperimentalRestProperty: ["argument"],
|
172
|
-
ExperimentalSpreadProperty: ["argument"],
|
173
|
-
ExportAllDeclaration: [
|
174
|
-
"exported",
|
175
|
-
"source",
|
176
|
-
"attributes"
|
177
|
-
],
|
178
|
-
ExportDefaultDeclaration: ["declaration"],
|
179
|
-
ExportNamedDeclaration: [
|
180
|
-
"declaration",
|
181
|
-
"specifiers",
|
182
|
-
"source",
|
183
|
-
"attributes"
|
184
|
-
],
|
185
|
-
ExportSpecifier: ["local", "exported"],
|
186
|
-
ExpressionStatement: ["expression"],
|
187
|
-
ForInStatement: [
|
188
|
-
"left",
|
189
|
-
"right",
|
190
|
-
"body"
|
191
|
-
],
|
192
|
-
ForOfStatement: [
|
193
|
-
"left",
|
194
|
-
"right",
|
195
|
-
"body"
|
196
|
-
],
|
197
|
-
ForStatement: [
|
198
|
-
"init",
|
199
|
-
"test",
|
200
|
-
"update",
|
201
|
-
"body"
|
202
|
-
],
|
203
|
-
FunctionDeclaration: [
|
204
|
-
"id",
|
205
|
-
"params",
|
206
|
-
"body"
|
207
|
-
],
|
208
|
-
FunctionExpression: [
|
209
|
-
"id",
|
210
|
-
"params",
|
211
|
-
"body"
|
212
|
-
],
|
213
|
-
Identifier: [],
|
214
|
-
IfStatement: [
|
215
|
-
"test",
|
216
|
-
"consequent",
|
217
|
-
"alternate"
|
218
|
-
],
|
219
|
-
ImportAttribute: ["key", "value"],
|
220
|
-
ImportDeclaration: [
|
221
|
-
"specifiers",
|
222
|
-
"source",
|
223
|
-
"attributes"
|
224
|
-
],
|
225
|
-
ImportDefaultSpecifier: ["local"],
|
226
|
-
ImportExpression: ["source", "options"],
|
227
|
-
ImportNamespaceSpecifier: ["local"],
|
228
|
-
ImportSpecifier: ["imported", "local"],
|
229
|
-
JSXAttribute: ["name", "value"],
|
230
|
-
JSXClosingElement: ["name"],
|
231
|
-
JSXClosingFragment: [],
|
232
|
-
JSXElement: [
|
233
|
-
"openingElement",
|
234
|
-
"children",
|
235
|
-
"closingElement"
|
236
|
-
],
|
237
|
-
JSXEmptyExpression: [],
|
238
|
-
JSXExpressionContainer: ["expression"],
|
239
|
-
JSXFragment: [
|
240
|
-
"openingFragment",
|
241
|
-
"children",
|
242
|
-
"closingFragment"
|
243
|
-
],
|
244
|
-
JSXIdentifier: [],
|
245
|
-
JSXMemberExpression: ["object", "property"],
|
246
|
-
JSXNamespacedName: ["namespace", "name"],
|
247
|
-
JSXOpeningElement: ["name", "attributes"],
|
248
|
-
JSXOpeningFragment: [],
|
249
|
-
JSXSpreadAttribute: ["argument"],
|
250
|
-
JSXSpreadChild: ["expression"],
|
251
|
-
JSXText: [],
|
252
|
-
LabeledStatement: ["label", "body"],
|
253
|
-
Literal: [],
|
254
|
-
LogicalExpression: ["left", "right"],
|
255
|
-
MemberExpression: ["object", "property"],
|
256
|
-
MetaProperty: ["meta", "property"],
|
257
|
-
MethodDefinition: ["key", "value"],
|
258
|
-
NewExpression: ["callee", "arguments"],
|
259
|
-
ObjectExpression: ["properties"],
|
260
|
-
ObjectPattern: ["properties"],
|
261
|
-
PrivateIdentifier: [],
|
262
|
-
Program: ["body"],
|
263
|
-
Property: ["key", "value"],
|
264
|
-
PropertyDefinition: ["key", "value"],
|
265
|
-
RestElement: ["argument"],
|
266
|
-
ReturnStatement: ["argument"],
|
267
|
-
SequenceExpression: ["expressions"],
|
268
|
-
SpreadElement: ["argument"],
|
269
|
-
StaticBlock: ["body"],
|
270
|
-
Super: [],
|
271
|
-
SwitchCase: ["test", "consequent"],
|
272
|
-
SwitchStatement: ["discriminant", "cases"],
|
273
|
-
TaggedTemplateExpression: ["tag", "quasi"],
|
274
|
-
TemplateElement: [],
|
275
|
-
TemplateLiteral: ["quasis", "expressions"],
|
276
|
-
ThisExpression: [],
|
277
|
-
ThrowStatement: ["argument"],
|
278
|
-
TryStatement: [
|
279
|
-
"block",
|
280
|
-
"handler",
|
281
|
-
"finalizer"
|
282
|
-
],
|
283
|
-
UnaryExpression: ["argument"],
|
284
|
-
UpdateExpression: ["argument"],
|
285
|
-
VariableDeclaration: ["declarations"],
|
286
|
-
VariableDeclarator: ["id", "init"],
|
287
|
-
WhileStatement: ["test", "body"],
|
288
|
-
WithStatement: ["object", "body"],
|
289
|
-
YieldExpression: ["argument"]
|
290
|
-
};
|
291
|
-
const NODE_TYPES = Object.keys(KEYS$1);
|
292
|
-
for (const type of NODE_TYPES) Object.freeze(KEYS$1[type]);
|
293
|
-
Object.freeze(KEYS$1);
|
294
|
-
var visitor_keys_default = KEYS$1;
|
295
|
-
|
296
|
-
//#endregion
|
297
|
-
//#region ../../node_modules/.pnpm/eslint-visitor-keys@4.2.1/node_modules/eslint-visitor-keys/lib/index.js
|
298
|
-
/**
|
299
|
-
* Make the union set with `KEYS` and given keys.
|
300
|
-
* @param {VisitorKeys} additionalKeys The additional keys.
|
301
|
-
* @returns {VisitorKeys} The union set.
|
302
|
-
*/
|
303
|
-
function unionWith(additionalKeys) {
|
304
|
-
const retv = Object.assign({}, visitor_keys_default);
|
305
|
-
for (const type of Object.keys(additionalKeys)) if (Object.hasOwn(retv, type)) {
|
306
|
-
const keys$3 = new Set(additionalKeys[type]);
|
307
|
-
for (const key of retv[type]) keys$3.add(key);
|
308
|
-
retv[type] = Object.freeze(Array.from(keys$3));
|
309
|
-
} else retv[type] = Object.freeze(Array.from(additionalKeys[type]));
|
310
|
-
return Object.freeze(retv);
|
311
|
-
}
|
312
|
-
|
313
130
|
//#endregion
|
314
131
|
//#region src/ast/traverse.ts
|
315
|
-
const
|
132
|
+
const KEYS = {
|
316
133
|
VAttribute: ["key", "value"],
|
317
134
|
VDirectiveKey: [
|
318
135
|
"name",
|
@@ -337,7 +154,6 @@ const VineVisitorKeys = {
|
|
337
154
|
VStartTag: ["attributes"],
|
338
155
|
VText: []
|
339
156
|
};
|
340
|
-
const KEYS = unionWith(VineVisitorKeys);
|
341
157
|
/**
|
342
158
|
* Check that the given key should be traversed or not.
|
343
159
|
* @this {Traversable}
|
@@ -2639,7 +2455,7 @@ var require__getTag = __commonJS({ "../../node_modules/.pnpm/lodash@4.17.21/node
|
|
2639
2455
|
* @returns {string} Returns the `toStringTag`.
|
2640
2456
|
*/
|
2641
2457
|
var getTag$1 = baseGetTag$1;
|
2642
|
-
if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$1 && getTag$1(new Set$1()) != setTag || WeakMap && getTag$1(new WeakMap()) != weakMapTag) getTag$1 = function(value) {
|
2458
|
+
if (DataView && getTag$1(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$1 && getTag$1(new Set$1()) != setTag || WeakMap && getTag$1(new WeakMap()) != weakMapTag) getTag$1 = function(value) {
|
2643
2459
|
var result = baseGetTag$1(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
2644
2460
|
if (ctorString) switch (ctorString) {
|
2645
2461
|
case dataViewCtorString: return dataViewTag;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vue-vine/eslint-parser",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.1.
|
4
|
+
"version": "1.1.5",
|
5
5
|
"description": "ESLint parser for Vue Vine",
|
6
6
|
"author": "ShenQingchuan",
|
7
7
|
"license": "MIT",
|
@@ -48,7 +48,6 @@
|
|
48
48
|
"@typescript-eslint/types": "~8.33.0",
|
49
49
|
"@typescript/native-preview": "latest",
|
50
50
|
"eslint": "~9.27.0",
|
51
|
-
"eslint-visitor-keys": "^4.2.0",
|
52
51
|
"lodash": "^4.17.21"
|
53
52
|
},
|
54
53
|
"scripts": {
|