@vue-vine/eslint-parser 1.1.3 → 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 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
@@ -1,6 +1,5 @@
1
1
  import Module, { createRequire } from "node:module";
2
2
  import { parseForESLint as parseForESLint$1 } from "@typescript-eslint/parser";
3
- import * as tsEscopeTypes$1 from "@typescript-eslint/scope-manager";
4
3
  import * as tsEscopeTypes from "@typescript-eslint/scope-manager";
5
4
  import * as escope from "eslint-scope";
6
5
  import { lt, lte } from "semver";
@@ -40,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
40
39
  //#endregion
41
40
  //#region package.json
42
41
  var name = "@vue-vine/eslint-parser";
43
- var version = "1.1.3";
42
+ var version = "1.1.5";
44
43
 
45
44
  //#endregion
46
45
  //#region src/ast/errors.ts
@@ -128,192 +127,9 @@ const NS = Object.freeze({
128
127
  XMLNS: "http://www.w3.org/2000/xmlns/"
129
128
  });
130
129
 
131
- //#endregion
132
- //#region ../../node_modules/.pnpm/eslint-visitor-keys@4.2.0/node_modules/eslint-visitor-keys/lib/visitor-keys.js
133
- /**
134
- * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
135
- */
136
- /**
137
- * @type {VisitorKeys}
138
- */
139
- const KEYS$1 = {
140
- ArrayExpression: ["elements"],
141
- ArrayPattern: ["elements"],
142
- ArrowFunctionExpression: ["params", "body"],
143
- AssignmentExpression: ["left", "right"],
144
- AssignmentPattern: ["left", "right"],
145
- AwaitExpression: ["argument"],
146
- BinaryExpression: ["left", "right"],
147
- BlockStatement: ["body"],
148
- BreakStatement: ["label"],
149
- CallExpression: ["callee", "arguments"],
150
- CatchClause: ["param", "body"],
151
- ChainExpression: ["expression"],
152
- ClassBody: ["body"],
153
- ClassDeclaration: [
154
- "id",
155
- "superClass",
156
- "body"
157
- ],
158
- ClassExpression: [
159
- "id",
160
- "superClass",
161
- "body"
162
- ],
163
- ConditionalExpression: [
164
- "test",
165
- "consequent",
166
- "alternate"
167
- ],
168
- ContinueStatement: ["label"],
169
- DebuggerStatement: [],
170
- DoWhileStatement: ["body", "test"],
171
- EmptyStatement: [],
172
- ExperimentalRestProperty: ["argument"],
173
- ExperimentalSpreadProperty: ["argument"],
174
- ExportAllDeclaration: [
175
- "exported",
176
- "source",
177
- "attributes"
178
- ],
179
- ExportDefaultDeclaration: ["declaration"],
180
- ExportNamedDeclaration: [
181
- "declaration",
182
- "specifiers",
183
- "source",
184
- "attributes"
185
- ],
186
- ExportSpecifier: ["exported", "local"],
187
- ExpressionStatement: ["expression"],
188
- ForInStatement: [
189
- "left",
190
- "right",
191
- "body"
192
- ],
193
- ForOfStatement: [
194
- "left",
195
- "right",
196
- "body"
197
- ],
198
- ForStatement: [
199
- "init",
200
- "test",
201
- "update",
202
- "body"
203
- ],
204
- FunctionDeclaration: [
205
- "id",
206
- "params",
207
- "body"
208
- ],
209
- FunctionExpression: [
210
- "id",
211
- "params",
212
- "body"
213
- ],
214
- Identifier: [],
215
- IfStatement: [
216
- "test",
217
- "consequent",
218
- "alternate"
219
- ],
220
- ImportAttribute: ["key", "value"],
221
- ImportDeclaration: [
222
- "specifiers",
223
- "source",
224
- "attributes"
225
- ],
226
- ImportDefaultSpecifier: ["local"],
227
- ImportExpression: ["source", "options"],
228
- ImportNamespaceSpecifier: ["local"],
229
- ImportSpecifier: ["imported", "local"],
230
- JSXAttribute: ["name", "value"],
231
- JSXClosingElement: ["name"],
232
- JSXClosingFragment: [],
233
- JSXElement: [
234
- "openingElement",
235
- "children",
236
- "closingElement"
237
- ],
238
- JSXEmptyExpression: [],
239
- JSXExpressionContainer: ["expression"],
240
- JSXFragment: [
241
- "openingFragment",
242
- "children",
243
- "closingFragment"
244
- ],
245
- JSXIdentifier: [],
246
- JSXMemberExpression: ["object", "property"],
247
- JSXNamespacedName: ["namespace", "name"],
248
- JSXOpeningElement: ["name", "attributes"],
249
- JSXOpeningFragment: [],
250
- JSXSpreadAttribute: ["argument"],
251
- JSXSpreadChild: ["expression"],
252
- JSXText: [],
253
- LabeledStatement: ["label", "body"],
254
- Literal: [],
255
- LogicalExpression: ["left", "right"],
256
- MemberExpression: ["object", "property"],
257
- MetaProperty: ["meta", "property"],
258
- MethodDefinition: ["key", "value"],
259
- NewExpression: ["callee", "arguments"],
260
- ObjectExpression: ["properties"],
261
- ObjectPattern: ["properties"],
262
- PrivateIdentifier: [],
263
- Program: ["body"],
264
- Property: ["key", "value"],
265
- PropertyDefinition: ["key", "value"],
266
- RestElement: ["argument"],
267
- ReturnStatement: ["argument"],
268
- SequenceExpression: ["expressions"],
269
- SpreadElement: ["argument"],
270
- StaticBlock: ["body"],
271
- Super: [],
272
- SwitchCase: ["test", "consequent"],
273
- SwitchStatement: ["discriminant", "cases"],
274
- TaggedTemplateExpression: ["tag", "quasi"],
275
- TemplateElement: [],
276
- TemplateLiteral: ["quasis", "expressions"],
277
- ThisExpression: [],
278
- ThrowStatement: ["argument"],
279
- TryStatement: [
280
- "block",
281
- "handler",
282
- "finalizer"
283
- ],
284
- UnaryExpression: ["argument"],
285
- UpdateExpression: ["argument"],
286
- VariableDeclaration: ["declarations"],
287
- VariableDeclarator: ["id", "init"],
288
- WhileStatement: ["test", "body"],
289
- WithStatement: ["object", "body"],
290
- YieldExpression: ["argument"]
291
- };
292
- const NODE_TYPES = Object.keys(KEYS$1);
293
- for (const type of NODE_TYPES) Object.freeze(KEYS$1[type]);
294
- Object.freeze(KEYS$1);
295
- var visitor_keys_default = KEYS$1;
296
-
297
- //#endregion
298
- //#region ../../node_modules/.pnpm/eslint-visitor-keys@4.2.0/node_modules/eslint-visitor-keys/lib/index.js
299
- /**
300
- * Make the union set with `KEYS` and given keys.
301
- * @param {VisitorKeys} additionalKeys The additional keys.
302
- * @returns {VisitorKeys} The union set.
303
- */
304
- function unionWith(additionalKeys) {
305
- const retv = Object.assign({}, visitor_keys_default);
306
- for (const type of Object.keys(additionalKeys)) if (Object.hasOwn(retv, type)) {
307
- const keys$3 = new Set(additionalKeys[type]);
308
- for (const key of retv[type]) keys$3.add(key);
309
- retv[type] = Object.freeze(Array.from(keys$3));
310
- } else retv[type] = Object.freeze(Array.from(additionalKeys[type]));
311
- return Object.freeze(retv);
312
- }
313
-
314
130
  //#endregion
315
131
  //#region src/ast/traverse.ts
316
- const VineVisitorKeys = {
132
+ const KEYS = {
317
133
  VAttribute: ["key", "value"],
318
134
  VDirectiveKey: [
319
135
  "name",
@@ -338,7 +154,6 @@ const VineVisitorKeys = {
338
154
  VStartTag: ["attributes"],
339
155
  VText: []
340
156
  };
341
- const KEYS = unionWith(VineVisitorKeys);
342
157
  /**
343
158
  * Check that the given key should be traversed or not.
344
159
  * @this {Traversable}
@@ -531,7 +346,7 @@ let ReferenceTypeFlag = /* @__PURE__ */ function(ReferenceTypeFlag$1) {
531
346
  //#endregion
532
347
  //#region src/common/vine-specific.ts
533
348
  function createVirtualVineFnPropsReference({ compFnPropsIdentifier, foundVCFScope }) {
534
- const virtualReference = new tsEscopeTypes$1.Reference(compFnPropsIdentifier, foundVCFScope, ReferenceFlag.Read, void 0, void 0, void 0, ReferenceTypeFlag.Value);
349
+ const virtualReference = new tsEscopeTypes.Reference(compFnPropsIdentifier, foundVCFScope, ReferenceFlag.Read, void 0, void 0, void 0, ReferenceTypeFlag.Value);
535
350
  virtualReference.isWrite = () => false;
536
351
  virtualReference.isWriteOnly = () => false;
537
352
  virtualReference.isRead = () => true;
@@ -2640,7 +2455,7 @@ var require__getTag = __commonJS({ "../../node_modules/.pnpm/lodash@4.17.21/node
2640
2455
  * @returns {string} Returns the `toStringTag`.
2641
2456
  */
2642
2457
  var getTag$1 = baseGetTag$1;
2643
- 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) {
2644
2459
  var result = baseGetTag$1(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2645
2460
  if (ctorString) switch (ctorString) {
2646
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.3",
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": {