@jsse/eslint-config 0.1.0 → 0.1.3

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.cjs CHANGED
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
8
  var __commonJS = (cb, mod) => function __require() {
10
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
10
  };
@@ -30,40 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
29
  mod
31
30
  ));
32
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
- var __publicField = (obj, key, value) => {
34
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
- return value;
36
- };
37
- var __accessCheck = (obj, member, msg) => {
38
- if (!member.has(obj))
39
- throw TypeError("Cannot " + msg);
40
- };
41
- var __privateGet = (obj, member, getter) => {
42
- __accessCheck(obj, member, "read from private field");
43
- return getter ? getter.call(obj) : member.get(obj);
44
- };
45
- var __privateAdd = (obj, member, value) => {
46
- if (member.has(obj))
47
- throw TypeError("Cannot add the same private member more than once");
48
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
49
- };
50
- var __privateSet = (obj, member, value, setter) => {
51
- __accessCheck(obj, member, "write to private field");
52
- setter ? setter.call(obj, value) : member.set(obj, value);
53
- return value;
54
- };
55
- var __privateWrapper = (obj, member, setter, getter) => ({
56
- set _(value) {
57
- __privateSet(obj, member, value, setter);
58
- },
59
- get _() {
60
- return __privateGet(obj, member, getter);
61
- }
62
- });
63
32
 
64
33
  // node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js
65
34
  var require_natural_compare = __commonJS({
66
- "node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js"(exports, module2) {
35
+ "node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js"(exports2, module2) {
67
36
  "use strict";
68
37
  var naturalCompare = function(a, b) {
69
38
  var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
@@ -100,7 +69,7 @@ var require_natural_compare = __commonJS({
100
69
 
101
70
  // node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js
102
71
  var require_sort_keys_fix = __commonJS({
103
- "node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js"(exports, module2) {
72
+ "node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js"(exports2, module2) {
104
73
  "use strict";
105
74
  var naturalCompare = require_natural_compare();
106
75
  module2.exports = {
@@ -149,8 +118,8 @@ var require_sort_keys_fix = __commonJS({
149
118
  const isValidOrder = isValidOrders[order + (insensitive ? "I" : "") + (natural ? "N" : "")];
150
119
  const minKeys = Number(options && options.minKeys) || 2;
151
120
  let stack = null;
152
- const SpreadElement = (node2) => {
153
- if (node2.parent.type === "ObjectExpression") {
121
+ const SpreadElement = (node) => {
122
+ if (node.parent.type === "ObjectExpression") {
154
123
  stack.prevName = null;
155
124
  }
156
125
  };
@@ -167,27 +136,27 @@ var require_sort_keys_fix = __commonJS({
167
136
  "ObjectExpression:exit"() {
168
137
  stack = stack.upper;
169
138
  },
170
- Property(node2) {
171
- if (node2.parent.type === "ObjectPattern") {
139
+ Property(node) {
140
+ if (node.parent.type === "ObjectPattern") {
172
141
  return;
173
142
  }
174
- if (node2.parent.properties.length < minKeys) {
143
+ if (node.parent.properties.length < minKeys) {
175
144
  return;
176
145
  }
177
146
  const prevName = stack.prevName;
178
147
  const prevNode = stack.prevNode;
179
- const thisName = getPropertyName(node2);
148
+ const thisName = getPropertyName(node);
180
149
  if (thisName !== null) {
181
150
  stack.prevName = thisName;
182
- stack.prevNode = node2 || prevNode;
151
+ stack.prevNode = node || prevNode;
183
152
  }
184
153
  if (prevName === null || thisName === null) {
185
154
  return;
186
155
  }
187
156
  if (!isValidOrder(prevName, thisName)) {
188
157
  ctx.report({
189
- node: node2,
190
- loc: node2.key.loc,
158
+ node,
159
+ loc: node.key.loc,
191
160
  messageId: "sortKeys",
192
161
  data: {
193
162
  thisName,
@@ -197,13 +166,13 @@ var require_sort_keys_fix = __commonJS({
197
166
  natural: natural ? "natural " : ""
198
167
  },
199
168
  fix(fixer) {
200
- if (node2.parent.__alreadySorted || node2.parent.properties.__alreadySorted) {
169
+ if (node.parent.__alreadySorted || node.parent.properties.__alreadySorted) {
201
170
  return [];
202
171
  }
203
- node2.parent.__alreadySorted = true;
204
- node2.parent.properties.__alreadySorted = true;
172
+ node.parent.__alreadySorted = true;
173
+ node.parent.properties.__alreadySorted = true;
205
174
  const src = ctx.getSourceCode();
206
- const props = node2.parent.properties;
175
+ const props = node.parent.properties;
207
176
  const parts = [];
208
177
  let part = [];
209
178
  props.forEach((p) => {
@@ -274,21 +243,21 @@ var require_sort_keys_fix = __commonJS({
274
243
  }
275
244
  return fixes;
276
245
  };
277
- var findTokenPrevLine = (node2, src) => {
278
- let t = src.getTokenBefore(node2);
246
+ var findTokenPrevLine = (node, src) => {
247
+ let t = src.getTokenBefore(node);
279
248
  while (true) {
280
- if (!t || t.range[0] < node2.parent.range[0]) {
249
+ if (!t || t.range[0] < node.parent.range[0]) {
281
250
  return null;
282
251
  }
283
- if (t.loc.end.line < node2.loc.start.line) {
252
+ if (t.loc.end.line < node.loc.start.line) {
284
253
  return t;
285
254
  }
286
255
  t = src.getTokenBefore(t);
287
256
  }
288
257
  };
289
- var findCommaSameLine = (node2, src) => {
290
- const t = src.getTokenAfter(node2);
291
- return t && t.value === "," && node2.loc.end.line === t.loc.start.line ? t : null;
258
+ var findCommaSameLine = (node, src) => {
259
+ const t = src.getTokenAfter(node);
260
+ return t && t.value === "," && node.loc.end.line === t.loc.start.line ? t : null;
292
261
  };
293
262
  var isValidOrders = {
294
263
  asc: (a, b) => a <= b,
@@ -300,15 +269,15 @@ var require_sort_keys_fix = __commonJS({
300
269
  descN: (a, b) => isValidOrders.ascN(b, a),
301
270
  descIN: (a, b) => isValidOrders.ascIN(b, a)
302
271
  };
303
- var getPropertyName = (node2) => {
272
+ var getPropertyName = (node) => {
304
273
  let prop;
305
- switch (node2 && node2.type) {
274
+ switch (node && node.type) {
306
275
  case "Property":
307
276
  case "MethodDefinition":
308
- prop = node2.key;
277
+ prop = node.key;
309
278
  break;
310
279
  case "MemberExpression":
311
- prop = node2.property;
280
+ prop = node.property;
312
281
  break;
313
282
  }
314
283
  switch (prop && prop.type) {
@@ -320,19 +289,19 @@ var require_sort_keys_fix = __commonJS({
320
289
  }
321
290
  break;
322
291
  case "Identifier":
323
- if (!node2.computed) {
292
+ if (!node.computed) {
324
293
  return prop.name;
325
294
  }
326
295
  break;
327
296
  }
328
- return node2.key && node2.key.name || null;
297
+ return node.key && node.key.name || null;
329
298
  };
330
299
  }
331
300
  });
332
301
 
333
302
  // node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js
334
303
  var require_eslint_plugin_sort_keys = __commonJS({
335
- "node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js"(exports, module2) {
304
+ "node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js"(exports2, module2) {
336
305
  "use strict";
337
306
  module2.exports.rules = {
338
307
  "sort-keys-fix": require_sort_keys_fix()
@@ -340,9 +309,9 @@ var require_eslint_plugin_sort_keys = __commonJS({
340
309
  }
341
310
  });
342
311
 
343
- // node_modules/.pnpm/globals@13.24.0/node_modules/globals/globals.json
312
+ // node_modules/.pnpm/globals@14.0.0/node_modules/globals/globals.json
344
313
  var require_globals = __commonJS({
345
- "node_modules/.pnpm/globals@13.24.0/node_modules/globals/globals.json"(exports, module2) {
314
+ "node_modules/.pnpm/globals@14.0.0/node_modules/globals/globals.json"(exports2, module2) {
346
315
  module2.exports = {
347
316
  builtin: {
348
317
  AggregateError: false,
@@ -2344,9 +2313,9 @@ var require_globals = __commonJS({
2344
2313
  }
2345
2314
  });
2346
2315
 
2347
- // node_modules/.pnpm/globals@13.24.0/node_modules/globals/index.js
2316
+ // node_modules/.pnpm/globals@14.0.0/node_modules/globals/index.js
2348
2317
  var require_globals2 = __commonJS({
2349
- "node_modules/.pnpm/globals@13.24.0/node_modules/globals/index.js"(exports, module2) {
2318
+ "node_modules/.pnpm/globals@14.0.0/node_modules/globals/index.js"(exports2, module2) {
2350
2319
  "use strict";
2351
2320
  module2.exports = require_globals();
2352
2321
  }
@@ -2376,11 +2345,13 @@ __export(src_exports, {
2376
2345
  GLOB_TSX: () => GLOB_TSX,
2377
2346
  GLOB_YAML: () => GLOB_YAML,
2378
2347
  combine: () => combine,
2348
+ combineAsync: () => combineAsync,
2379
2349
  comments: () => comments,
2380
2350
  default: () => jsse,
2381
2351
  eslintConfigPrettierRules: () => eslintConfigPrettierRules,
2382
2352
  ignores: () => ignores,
2383
2353
  imports: () => imports,
2354
+ interopDefault: () => interopDefault,
2384
2355
  isCI: () => isCI,
2385
2356
  isInEditor: () => isInEditor,
2386
2357
  javascript: () => javascript,
@@ -2389,17 +2360,18 @@ __export(src_exports, {
2389
2360
  jsse: () => jsse,
2390
2361
  jsseReact: () => jsseReact,
2391
2362
  jssestd: () => jssestd,
2392
- node: () => node,
2363
+ n: () => n,
2393
2364
  parserJsonc: () => import_jsonc_eslint_parser.default,
2394
2365
  parserTs: () => parserTs,
2395
2366
  perfectionist: () => perfectionist,
2367
+ pluginAntfu: () => import_eslint_plugin_antfu.default,
2396
2368
  pluginEslintComments: () => import_eslint_plugin_eslint_comments.default,
2397
2369
  pluginImport: () => pluginImport,
2398
2370
  pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
2399
2371
  pluginJsonc: () => pluginJsonc,
2400
2372
  pluginMarkdown: () => import_eslint_plugin_markdown.default,
2373
+ pluginN: () => import_eslint_plugin_n.default,
2401
2374
  pluginNoOnlyTests: () => import_eslint_plugin_no_only_tests.default,
2402
- pluginNode: () => import_eslint_plugin_n.default,
2403
2375
  pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
2404
2376
  pluginReact: () => import_eslint_plugin_react.default,
2405
2377
  pluginReactHooks: () => import_eslint_plugin_react_hooks.default,
@@ -2428,42 +2400,41 @@ module.exports = __toCommonJS(src_exports);
2428
2400
  var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
2429
2401
  var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
2430
2402
  var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
2403
+ var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
2431
2404
  var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
2432
2405
  var pluginImport = __toESM(require("eslint-plugin-i"), 1);
2433
2406
  var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
2434
2407
  var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
2408
+ var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
2435
2409
  var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
2436
2410
  var import_eslint_plugin_no_only_tests = __toESM(require("eslint-plugin-no-only-tests"), 1);
2411
+ var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
2437
2412
  var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
2438
2413
  var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
2439
2414
  var pluginReactRefresh = __toESM(require("eslint-plugin-react-refresh"), 1);
2440
2415
  var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
2416
+ var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"), 1);
2441
2417
  var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
2442
2418
  var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
2443
- var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"), 1);
2444
2419
  var import_eslint_plugin_vitest = __toESM(require("eslint-plugin-vitest"), 1);
2445
2420
  var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
2446
- var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
2447
- var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
2448
2421
 
2449
2422
  // src/configs/comments.ts
2450
- function comments() {
2451
- return [
2452
- {
2453
- name: "jsse:eslint-comments",
2454
- plugins: {
2455
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2456
- "eslint-comments": import_eslint_plugin_eslint_comments.default
2457
- },
2458
- rules: {
2459
- "eslint-comments/no-aggregating-enable": "error",
2460
- "eslint-comments/no-duplicate-disable": "error",
2461
- "eslint-comments/no-unlimited-disable": "error",
2462
- "eslint-comments/no-unused-enable": "error"
2463
- }
2423
+ var comments = async () => [
2424
+ {
2425
+ name: "jsse:eslint-comments",
2426
+ plugins: {
2427
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2428
+ "eslint-comments": import_eslint_plugin_eslint_comments.default
2429
+ },
2430
+ rules: {
2431
+ "eslint-comments/no-aggregating-enable": "error",
2432
+ "eslint-comments/no-duplicate-disable": "error",
2433
+ "eslint-comments/no-unlimited-disable": "error",
2434
+ "eslint-comments/no-unused-enable": "error"
2464
2435
  }
2465
- ];
2466
- }
2436
+ }
2437
+ ];
2467
2438
 
2468
2439
  // src/globs.ts
2469
2440
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -2534,17 +2505,17 @@ var GLOB_EXCLUDE = [
2534
2505
  ];
2535
2506
 
2536
2507
  // src/configs/ignores.ts
2537
- function ignores() {
2508
+ var ignores = async () => {
2538
2509
  return [
2539
2510
  {
2540
2511
  ignores: GLOB_EXCLUDE
2541
2512
  }
2542
2513
  ];
2543
- }
2514
+ };
2544
2515
 
2545
2516
  // src/configs/imports.ts
2546
- function imports(options = {}) {
2547
- const { stylistic: stylistic2 = true } = options;
2517
+ var imports = async (options) => {
2518
+ const { stylistic: stylistic2 = true } = options ?? {};
2548
2519
  return [
2549
2520
  {
2550
2521
  name: "jsse:imports",
@@ -2569,13 +2540,17 @@ function imports(options = {}) {
2569
2540
  }
2570
2541
  }
2571
2542
  ];
2572
- }
2543
+ };
2573
2544
 
2574
2545
  // src/configs/javascript.ts
2575
2546
  var import_js = __toESM(require("@eslint/js"), 1);
2576
2547
  var import_globals = __toESM(require_globals2(), 1);
2577
- function javascript(options = {}) {
2578
- const { isInEditor: isInEditor2 = false, overrides = {} } = options;
2548
+ var javascript = async (options) => {
2549
+ const {
2550
+ isInEditor: isInEditor2 = false,
2551
+ overrides = {},
2552
+ reportUnusedDisableDirectives = true
2553
+ } = options ?? {};
2579
2554
  return [
2580
2555
  {
2581
2556
  languageOptions: {
@@ -2598,7 +2573,7 @@ function javascript(options = {}) {
2598
2573
  sourceType: "module"
2599
2574
  },
2600
2575
  linterOptions: {
2601
- reportUnusedDisableDirectives: options.reportUnusedDisableDirectives ?? true
2576
+ reportUnusedDisableDirectives
2602
2577
  },
2603
2578
  name: "jsse:javascript",
2604
2579
  plugins: {
@@ -2826,11 +2801,10 @@ function javascript(options = {}) {
2826
2801
  }
2827
2802
  }
2828
2803
  ];
2829
- }
2804
+ };
2830
2805
 
2831
2806
  // src/configs/jsdoc.ts
2832
- function jsdoc(options = {}) {
2833
- const { stylistic: stylistic2 = true } = options;
2807
+ var jsdoc = async () => {
2834
2808
  return [
2835
2809
  {
2836
2810
  name: "jsse:jsdoc",
@@ -2840,11 +2814,13 @@ function jsdoc(options = {}) {
2840
2814
  },
2841
2815
  rules: {
2842
2816
  "jsdoc/check-access": "warn",
2817
+ "jsdoc/check-alignment": "warn",
2843
2818
  "jsdoc/check-param-names": "warn",
2844
2819
  "jsdoc/check-property-names": "warn",
2845
2820
  "jsdoc/check-types": "warn",
2846
2821
  "jsdoc/empty-tags": "warn",
2847
2822
  "jsdoc/implements-on-classes": "warn",
2823
+ "jsdoc/multiline-blocks": "warn",
2848
2824
  "jsdoc/no-defaults": "warn",
2849
2825
  "jsdoc/no-multi-asterisks": "warn",
2850
2826
  "jsdoc/require-param-name": "warn",
@@ -2853,19 +2829,15 @@ function jsdoc(options = {}) {
2853
2829
  "jsdoc/require-property-name": "warn",
2854
2830
  "jsdoc/require-returns-check": "warn",
2855
2831
  "jsdoc/require-returns-description": "warn",
2856
- "jsdoc/require-yields-check": "warn",
2857
- ...stylistic2 ? {
2858
- "jsdoc/check-alignment": "warn",
2859
- "jsdoc/multiline-blocks": "warn"
2860
- } : {}
2832
+ "jsdoc/require-yields-check": "warn"
2861
2833
  }
2862
2834
  }
2863
2835
  ];
2864
- }
2836
+ };
2865
2837
 
2866
2838
  // src/configs/jsonc.ts
2867
- function jsonc(options = {}) {
2868
- const { overrides = {}, stylistic: stylistic2 = true } = options;
2839
+ var jsonc = async (options) => {
2840
+ const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
2869
2841
  const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
2870
2842
  return [
2871
2843
  {
@@ -2933,30 +2905,42 @@ function jsonc(options = {}) {
2933
2905
  }
2934
2906
  }
2935
2907
  ];
2936
- }
2908
+ };
2937
2909
 
2938
- // src/configs/node.ts
2939
- function node() {
2910
+ // src/configs/n.ts
2911
+ var n = async () => {
2940
2912
  return [
2941
2913
  {
2942
- name: "jsse:node",
2914
+ name: "jsse:n",
2943
2915
  plugins: {
2944
2916
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2945
- node: import_eslint_plugin_n.default
2917
+ n: import_eslint_plugin_n.default
2946
2918
  },
2947
2919
  rules: {
2948
- "node/handle-callback-err": ["error", "^(err|error)$"],
2949
- "node/no-deprecated-api": "error",
2950
- "node/no-exports-assign": "error",
2951
- "node/no-new-require": "error",
2952
- "node/no-path-concat": "error",
2953
- "node/prefer-global/buffer": ["error", "never"],
2954
- "node/prefer-global/process": ["error", "never"],
2955
- "node/process-exit-as-throw": "error"
2920
+ "n/handle-callback-err": ["error", "^(err|error)$"],
2921
+ "n/no-deprecated-api": "error",
2922
+ "n/no-exports-assign": "error",
2923
+ "n/no-new-require": "error",
2924
+ "n/no-path-concat": "error",
2925
+ "n/prefer-global/buffer": ["error", "never"],
2926
+ "n/prefer-global/process": ["error", "never"],
2927
+ "n/process-exit-as-throw": "error"
2956
2928
  }
2957
2929
  }
2958
2930
  ];
2959
- }
2931
+ };
2932
+
2933
+ // src/configs/perfectionist.ts
2934
+ var perfectionist = async () => {
2935
+ return [
2936
+ {
2937
+ name: "jsse:perfectionist",
2938
+ plugins: {
2939
+ perfectionist: import_eslint_plugin_perfectionist.default
2940
+ }
2941
+ }
2942
+ ];
2943
+ };
2960
2944
 
2961
2945
  // src/configs/prettier.ts
2962
2946
  function eslintConfigPrettierRules() {
@@ -3073,16 +3057,14 @@ function eslintConfigPrettierRules() {
3073
3057
  "yield-star-spacing": "off"
3074
3058
  };
3075
3059
  }
3076
- function prettier() {
3060
+ var prettier = async () => {
3077
3061
  return [
3078
3062
  {
3079
3063
  name: "jsse:prettier",
3080
- rules: {
3081
- ...eslintConfigPrettierRules()
3082
- }
3064
+ rules: eslintConfigPrettierRules()
3083
3065
  }
3084
3066
  ];
3085
- }
3067
+ };
3086
3068
 
3087
3069
  // src/configs/ts/typescript-language-options.ts
3088
3070
  var import_node_process = __toESM(require("process"), 1);
@@ -3341,7 +3323,7 @@ function reactRecomendedRules() {
3341
3323
  "react/require-render-return": 2
3342
3324
  };
3343
3325
  }
3344
- function react(options) {
3326
+ var react = async (options) => {
3345
3327
  const {
3346
3328
  componentExts,
3347
3329
  parserOptions = {},
@@ -3386,10 +3368,10 @@ function react(options) {
3386
3368
  config.push(...reactRefreshFlatConfigs());
3387
3369
  }
3388
3370
  return config;
3389
- }
3371
+ };
3390
3372
 
3391
3373
  // src/configs/sort.ts
3392
- function sortPackageJson() {
3374
+ var sortPackageJson = async () => {
3393
3375
  return [
3394
3376
  {
3395
3377
  files: ["**/package.json"],
@@ -3472,8 +3454,8 @@ function sortPackageJson() {
3472
3454
  }
3473
3455
  }
3474
3456
  ];
3475
- }
3476
- function sortTsconfig() {
3457
+ };
3458
+ var sortTsconfig = async () => {
3477
3459
  return [
3478
3460
  {
3479
3461
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
@@ -3597,7 +3579,7 @@ function sortTsconfig() {
3597
3579
  }
3598
3580
  }
3599
3581
  ];
3600
- }
3582
+ };
3601
3583
 
3602
3584
  // src/utils.ts
3603
3585
  var import_node_process2 = __toESM(require("process"), 1);
@@ -3606,6 +3588,12 @@ function combine(...configs) {
3606
3588
  (config) => Array.isArray(config) ? config : [config]
3607
3589
  );
3608
3590
  }
3591
+ async function combineAsync(...configs) {
3592
+ const resolved = await Promise.all(configs);
3593
+ return resolved.flatMap(
3594
+ (config) => Array.isArray(config) ? config : [config]
3595
+ );
3596
+ }
3609
3597
  function renameRules(rules, from, to) {
3610
3598
  if (from === to) {
3611
3599
  return rules;
@@ -3619,6 +3607,10 @@ function renameRules(rules, from, to) {
3619
3607
  })
3620
3608
  );
3621
3609
  }
3610
+ async function interopDefault(m) {
3611
+ const resolved = await m;
3612
+ return resolved.default || resolved;
3613
+ }
3622
3614
  function isCI() {
3623
3615
  return !!import_node_process2.default.env.CI;
3624
3616
  }
@@ -3627,7 +3619,7 @@ function isInEditor() {
3627
3619
  }
3628
3620
 
3629
3621
  // src/configs/test.ts
3630
- function test(options = {}) {
3622
+ var test = async (options = {}) => {
3631
3623
  const { isInEditor: isInEditor2 = false, overrides = {} } = options;
3632
3624
  return [
3633
3625
  {
@@ -3654,7 +3646,7 @@ function test(options = {}) {
3654
3646
  }
3655
3647
  }
3656
3648
  ];
3657
- }
3649
+ };
3658
3650
 
3659
3651
  // src/configs/ts/typescript-rules.ts
3660
3652
  function typescriptRulesTypeAware() {
@@ -4086,7 +4078,7 @@ function typescriptRules(props) {
4086
4078
  }
4087
4079
 
4088
4080
  // src/configs/ts/typescript.ts
4089
- function typescript(options) {
4081
+ async function typescript(options) {
4090
4082
  const {
4091
4083
  componentExts = [],
4092
4084
  overrides = {},
@@ -4119,6 +4111,7 @@ function typescript(options) {
4119
4111
  [tsPrefixTo]: import_eslint_plugin2.default
4120
4112
  }
4121
4113
  },
4114
+ // ...tseslint.configs.recommended,
4122
4115
  {
4123
4116
  // use ts parser for js files as well!
4124
4117
  files: [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)],
@@ -4180,7 +4173,7 @@ function unicornOff() {
4180
4173
  // Super insanely annoying rule
4181
4174
  };
4182
4175
  }
4183
- function unicorn() {
4176
+ var unicorn = async () => {
4184
4177
  return [
4185
4178
  {
4186
4179
  name: "jsse:unicorn",
@@ -4261,19 +4254,7 @@ function unicorn() {
4261
4254
  }
4262
4255
  }
4263
4256
  ];
4264
- }
4265
-
4266
- // src/configs/perfectionist.ts
4267
- function perfectionist() {
4268
- return [
4269
- {
4270
- name: "jsse:perfectionist",
4271
- plugins: {
4272
- perfectionist: import_eslint_plugin_perfectionist.default
4273
- }
4274
- }
4275
- ];
4276
- }
4257
+ };
4277
4258
 
4278
4259
  // src/factory.ts
4279
4260
  var import_node_fs3 = __toESM(require("fs"), 1);
@@ -4531,8 +4512,8 @@ var Position = function Position2(line, col) {
4531
4512
  this.line = line;
4532
4513
  this.column = col;
4533
4514
  };
4534
- Position.prototype.offset = function offset(n) {
4535
- return new Position(this.line, this.column + n);
4515
+ Position.prototype.offset = function offset(n2) {
4516
+ return new Position(this.line, this.column + n2);
4536
4517
  };
4537
4518
  var SourceLocation = function SourceLocation2(p, start, end) {
4538
4519
  this.start = start;
@@ -4768,9 +4749,9 @@ var Parser = function Parser2(options, input, startPos) {
4768
4749
  };
4769
4750
  var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } };
4770
4751
  Parser.prototype.parse = function parse() {
4771
- var node2 = this.options.program || this.startNode();
4752
+ var node = this.options.program || this.startNode();
4772
4753
  this.nextToken();
4773
- return this.parseTopLevel(node2);
4754
+ return this.parseTopLevel(node);
4774
4755
  };
4775
4756
  prototypeAccessors.inFunction.get = function() {
4776
4757
  return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
@@ -4965,14 +4946,14 @@ pp$9.isSimpleAssignTarget = function(expr) {
4965
4946
  return expr.type === "Identifier" || expr.type === "MemberExpression";
4966
4947
  };
4967
4948
  var pp$8 = Parser.prototype;
4968
- pp$8.parseTopLevel = function(node2) {
4969
- var exports = /* @__PURE__ */ Object.create(null);
4970
- if (!node2.body) {
4971
- node2.body = [];
4949
+ pp$8.parseTopLevel = function(node) {
4950
+ var exports2 = /* @__PURE__ */ Object.create(null);
4951
+ if (!node.body) {
4952
+ node.body = [];
4972
4953
  }
4973
4954
  while (this.type !== types$1.eof) {
4974
- var stmt = this.parseStatement(null, true, exports);
4975
- node2.body.push(stmt);
4955
+ var stmt = this.parseStatement(null, true, exports2);
4956
+ node.body.push(stmt);
4976
4957
  }
4977
4958
  if (this.inModule) {
4978
4959
  for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {
@@ -4980,10 +4961,10 @@ pp$8.parseTopLevel = function(node2) {
4980
4961
  this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined");
4981
4962
  }
4982
4963
  }
4983
- this.adaptDirectivePrologue(node2.body);
4964
+ this.adaptDirectivePrologue(node.body);
4984
4965
  this.next();
4985
- node2.sourceType = this.options.sourceType;
4986
- return this.finishNode(node2, "Program");
4966
+ node.sourceType = this.options.sourceType;
4967
+ return this.finishNode(node, "Program");
4987
4968
  };
4988
4969
  var loopLabel = { kind: "loop" };
4989
4970
  var switchLabel = { kind: "switch" };
@@ -5027,8 +5008,8 @@ pp$8.isAsyncFunction = function() {
5027
5008
  var next = this.pos + skip[0].length, after;
5028
5009
  return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320));
5029
5010
  };
5030
- pp$8.parseStatement = function(context, topLevel, exports) {
5031
- var starttype = this.type, node2 = this.startNode(), kind;
5011
+ pp$8.parseStatement = function(context, topLevel, exports2) {
5012
+ var starttype = this.type, node = this.startNode(), kind;
5032
5013
  if (this.isLet(context)) {
5033
5014
  starttype = types$1._var;
5034
5015
  kind = "let";
@@ -5036,48 +5017,48 @@ pp$8.parseStatement = function(context, topLevel, exports) {
5036
5017
  switch (starttype) {
5037
5018
  case types$1._break:
5038
5019
  case types$1._continue:
5039
- return this.parseBreakContinueStatement(node2, starttype.keyword);
5020
+ return this.parseBreakContinueStatement(node, starttype.keyword);
5040
5021
  case types$1._debugger:
5041
- return this.parseDebuggerStatement(node2);
5022
+ return this.parseDebuggerStatement(node);
5042
5023
  case types$1._do:
5043
- return this.parseDoStatement(node2);
5024
+ return this.parseDoStatement(node);
5044
5025
  case types$1._for:
5045
- return this.parseForStatement(node2);
5026
+ return this.parseForStatement(node);
5046
5027
  case types$1._function:
5047
5028
  if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) {
5048
5029
  this.unexpected();
5049
5030
  }
5050
- return this.parseFunctionStatement(node2, false, !context);
5031
+ return this.parseFunctionStatement(node, false, !context);
5051
5032
  case types$1._class:
5052
5033
  if (context) {
5053
5034
  this.unexpected();
5054
5035
  }
5055
- return this.parseClass(node2, true);
5036
+ return this.parseClass(node, true);
5056
5037
  case types$1._if:
5057
- return this.parseIfStatement(node2);
5038
+ return this.parseIfStatement(node);
5058
5039
  case types$1._return:
5059
- return this.parseReturnStatement(node2);
5040
+ return this.parseReturnStatement(node);
5060
5041
  case types$1._switch:
5061
- return this.parseSwitchStatement(node2);
5042
+ return this.parseSwitchStatement(node);
5062
5043
  case types$1._throw:
5063
- return this.parseThrowStatement(node2);
5044
+ return this.parseThrowStatement(node);
5064
5045
  case types$1._try:
5065
- return this.parseTryStatement(node2);
5046
+ return this.parseTryStatement(node);
5066
5047
  case types$1._const:
5067
5048
  case types$1._var:
5068
5049
  kind = kind || this.value;
5069
5050
  if (context && kind !== "var") {
5070
5051
  this.unexpected();
5071
5052
  }
5072
- return this.parseVarStatement(node2, kind);
5053
+ return this.parseVarStatement(node, kind);
5073
5054
  case types$1._while:
5074
- return this.parseWhileStatement(node2);
5055
+ return this.parseWhileStatement(node);
5075
5056
  case types$1._with:
5076
- return this.parseWithStatement(node2);
5057
+ return this.parseWithStatement(node);
5077
5058
  case types$1.braceL:
5078
- return this.parseBlock(true, node2);
5059
+ return this.parseBlock(true, node);
5079
5060
  case types$1.semi:
5080
- return this.parseEmptyStatement(node2);
5061
+ return this.parseEmptyStatement(node);
5081
5062
  case types$1._export:
5082
5063
  case types$1._import:
5083
5064
  if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
@@ -5085,7 +5066,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
5085
5066
  var skip = skipWhiteSpace.exec(this.input);
5086
5067
  var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
5087
5068
  if (nextCh === 40 || nextCh === 46) {
5088
- return this.parseExpressionStatement(node2, this.parseExpression());
5069
+ return this.parseExpressionStatement(node, this.parseExpression());
5089
5070
  }
5090
5071
  }
5091
5072
  if (!this.options.allowImportExportEverywhere) {
@@ -5096,71 +5077,71 @@ pp$8.parseStatement = function(context, topLevel, exports) {
5096
5077
  this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
5097
5078
  }
5098
5079
  }
5099
- return starttype === types$1._import ? this.parseImport(node2) : this.parseExport(node2, exports);
5080
+ return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports2);
5100
5081
  default:
5101
5082
  if (this.isAsyncFunction()) {
5102
5083
  if (context) {
5103
5084
  this.unexpected();
5104
5085
  }
5105
5086
  this.next();
5106
- return this.parseFunctionStatement(node2, true, !context);
5087
+ return this.parseFunctionStatement(node, true, !context);
5107
5088
  }
5108
5089
  var maybeName = this.value, expr = this.parseExpression();
5109
5090
  if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) {
5110
- return this.parseLabeledStatement(node2, maybeName, expr, context);
5091
+ return this.parseLabeledStatement(node, maybeName, expr, context);
5111
5092
  } else {
5112
- return this.parseExpressionStatement(node2, expr);
5093
+ return this.parseExpressionStatement(node, expr);
5113
5094
  }
5114
5095
  }
5115
5096
  };
5116
- pp$8.parseBreakContinueStatement = function(node2, keyword) {
5097
+ pp$8.parseBreakContinueStatement = function(node, keyword) {
5117
5098
  var isBreak = keyword === "break";
5118
5099
  this.next();
5119
5100
  if (this.eat(types$1.semi) || this.insertSemicolon()) {
5120
- node2.label = null;
5101
+ node.label = null;
5121
5102
  } else if (this.type !== types$1.name) {
5122
5103
  this.unexpected();
5123
5104
  } else {
5124
- node2.label = this.parseIdent();
5105
+ node.label = this.parseIdent();
5125
5106
  this.semicolon();
5126
5107
  }
5127
5108
  var i = 0;
5128
5109
  for (; i < this.labels.length; ++i) {
5129
5110
  var lab = this.labels[i];
5130
- if (node2.label == null || lab.name === node2.label.name) {
5111
+ if (node.label == null || lab.name === node.label.name) {
5131
5112
  if (lab.kind != null && (isBreak || lab.kind === "loop")) {
5132
5113
  break;
5133
5114
  }
5134
- if (node2.label && isBreak) {
5115
+ if (node.label && isBreak) {
5135
5116
  break;
5136
5117
  }
5137
5118
  }
5138
5119
  }
5139
5120
  if (i === this.labels.length) {
5140
- this.raise(node2.start, "Unsyntactic " + keyword);
5121
+ this.raise(node.start, "Unsyntactic " + keyword);
5141
5122
  }
5142
- return this.finishNode(node2, isBreak ? "BreakStatement" : "ContinueStatement");
5123
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
5143
5124
  };
5144
- pp$8.parseDebuggerStatement = function(node2) {
5125
+ pp$8.parseDebuggerStatement = function(node) {
5145
5126
  this.next();
5146
5127
  this.semicolon();
5147
- return this.finishNode(node2, "DebuggerStatement");
5128
+ return this.finishNode(node, "DebuggerStatement");
5148
5129
  };
5149
- pp$8.parseDoStatement = function(node2) {
5130
+ pp$8.parseDoStatement = function(node) {
5150
5131
  this.next();
5151
5132
  this.labels.push(loopLabel);
5152
- node2.body = this.parseStatement("do");
5133
+ node.body = this.parseStatement("do");
5153
5134
  this.labels.pop();
5154
5135
  this.expect(types$1._while);
5155
- node2.test = this.parseParenExpression();
5136
+ node.test = this.parseParenExpression();
5156
5137
  if (this.options.ecmaVersion >= 6) {
5157
5138
  this.eat(types$1.semi);
5158
5139
  } else {
5159
5140
  this.semicolon();
5160
5141
  }
5161
- return this.finishNode(node2, "DoWhileStatement");
5142
+ return this.finishNode(node, "DoWhileStatement");
5162
5143
  };
5163
- pp$8.parseForStatement = function(node2) {
5144
+ pp$8.parseForStatement = function(node) {
5164
5145
  this.next();
5165
5146
  var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
5166
5147
  this.labels.push(loopLabel);
@@ -5170,7 +5151,7 @@ pp$8.parseForStatement = function(node2) {
5170
5151
  if (awaitAt > -1) {
5171
5152
  this.unexpected(awaitAt);
5172
5153
  }
5173
- return this.parseFor(node2, null);
5154
+ return this.parseFor(node, null);
5174
5155
  }
5175
5156
  var isLet = this.isLet();
5176
5157
  if (this.type === types$1._var || this.type === types$1._const || isLet) {
@@ -5185,15 +5166,15 @@ pp$8.parseForStatement = function(node2) {
5185
5166
  this.unexpected(awaitAt);
5186
5167
  }
5187
5168
  } else {
5188
- node2.await = awaitAt > -1;
5169
+ node.await = awaitAt > -1;
5189
5170
  }
5190
5171
  }
5191
- return this.parseForIn(node2, init$1);
5172
+ return this.parseForIn(node, init$1);
5192
5173
  }
5193
5174
  if (awaitAt > -1) {
5194
5175
  this.unexpected(awaitAt);
5195
5176
  }
5196
- return this.parseFor(node2, init$1);
5177
+ return this.parseFor(node, init$1);
5197
5178
  }
5198
5179
  var startsWithLet = this.isContextual("let"), isForOf = false;
5199
5180
  var refDestructuringErrors = new DestructuringErrors();
@@ -5205,7 +5186,7 @@ pp$8.parseForStatement = function(node2) {
5205
5186
  this.unexpected(awaitAt);
5206
5187
  }
5207
5188
  } else {
5208
- node2.await = awaitAt > -1;
5189
+ node.await = awaitAt > -1;
5209
5190
  }
5210
5191
  }
5211
5192
  if (startsWithLet && isForOf) {
@@ -5213,43 +5194,43 @@ pp$8.parseForStatement = function(node2) {
5213
5194
  }
5214
5195
  this.toAssignable(init, false, refDestructuringErrors);
5215
5196
  this.checkLValPattern(init);
5216
- return this.parseForIn(node2, init);
5197
+ return this.parseForIn(node, init);
5217
5198
  } else {
5218
5199
  this.checkExpressionErrors(refDestructuringErrors, true);
5219
5200
  }
5220
5201
  if (awaitAt > -1) {
5221
5202
  this.unexpected(awaitAt);
5222
5203
  }
5223
- return this.parseFor(node2, init);
5204
+ return this.parseFor(node, init);
5224
5205
  };
5225
- pp$8.parseFunctionStatement = function(node2, isAsync, declarationPosition) {
5206
+ pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
5226
5207
  this.next();
5227
- return this.parseFunction(node2, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
5208
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
5228
5209
  };
5229
- pp$8.parseIfStatement = function(node2) {
5210
+ pp$8.parseIfStatement = function(node) {
5230
5211
  this.next();
5231
- node2.test = this.parseParenExpression();
5232
- node2.consequent = this.parseStatement("if");
5233
- node2.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
5234
- return this.finishNode(node2, "IfStatement");
5212
+ node.test = this.parseParenExpression();
5213
+ node.consequent = this.parseStatement("if");
5214
+ node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
5215
+ return this.finishNode(node, "IfStatement");
5235
5216
  };
5236
- pp$8.parseReturnStatement = function(node2) {
5217
+ pp$8.parseReturnStatement = function(node) {
5237
5218
  if (!this.inFunction && !this.options.allowReturnOutsideFunction) {
5238
5219
  this.raise(this.start, "'return' outside of function");
5239
5220
  }
5240
5221
  this.next();
5241
5222
  if (this.eat(types$1.semi) || this.insertSemicolon()) {
5242
- node2.argument = null;
5223
+ node.argument = null;
5243
5224
  } else {
5244
- node2.argument = this.parseExpression();
5225
+ node.argument = this.parseExpression();
5245
5226
  this.semicolon();
5246
5227
  }
5247
- return this.finishNode(node2, "ReturnStatement");
5228
+ return this.finishNode(node, "ReturnStatement");
5248
5229
  };
5249
- pp$8.parseSwitchStatement = function(node2) {
5230
+ pp$8.parseSwitchStatement = function(node) {
5250
5231
  this.next();
5251
- node2.discriminant = this.parseParenExpression();
5252
- node2.cases = [];
5232
+ node.discriminant = this.parseParenExpression();
5233
+ node.cases = [];
5253
5234
  this.expect(types$1.braceL);
5254
5235
  this.labels.push(switchLabel);
5255
5236
  this.enterScope(0);
@@ -5260,7 +5241,7 @@ pp$8.parseSwitchStatement = function(node2) {
5260
5241
  if (cur) {
5261
5242
  this.finishNode(cur, "SwitchCase");
5262
5243
  }
5263
- node2.cases.push(cur = this.startNode());
5244
+ node.cases.push(cur = this.startNode());
5264
5245
  cur.consequent = [];
5265
5246
  this.next();
5266
5247
  if (isCase) {
@@ -5286,16 +5267,16 @@ pp$8.parseSwitchStatement = function(node2) {
5286
5267
  }
5287
5268
  this.next();
5288
5269
  this.labels.pop();
5289
- return this.finishNode(node2, "SwitchStatement");
5270
+ return this.finishNode(node, "SwitchStatement");
5290
5271
  };
5291
- pp$8.parseThrowStatement = function(node2) {
5272
+ pp$8.parseThrowStatement = function(node) {
5292
5273
  this.next();
5293
5274
  if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) {
5294
5275
  this.raise(this.lastTokEnd, "Illegal newline after throw");
5295
5276
  }
5296
- node2.argument = this.parseExpression();
5277
+ node.argument = this.parseExpression();
5297
5278
  this.semicolon();
5298
- return this.finishNode(node2, "ThrowStatement");
5279
+ return this.finishNode(node, "ThrowStatement");
5299
5280
  };
5300
5281
  var empty$1 = [];
5301
5282
  pp$8.parseCatchClauseParam = function() {
@@ -5306,10 +5287,10 @@ pp$8.parseCatchClauseParam = function() {
5306
5287
  this.expect(types$1.parenR);
5307
5288
  return param;
5308
5289
  };
5309
- pp$8.parseTryStatement = function(node2) {
5290
+ pp$8.parseTryStatement = function(node) {
5310
5291
  this.next();
5311
- node2.block = this.parseBlock();
5312
- node2.handler = null;
5292
+ node.block = this.parseBlock();
5293
+ node.handler = null;
5313
5294
  if (this.type === types$1._catch) {
5314
5295
  var clause = this.startNode();
5315
5296
  this.next();
@@ -5324,42 +5305,42 @@ pp$8.parseTryStatement = function(node2) {
5324
5305
  }
5325
5306
  clause.body = this.parseBlock(false);
5326
5307
  this.exitScope();
5327
- node2.handler = this.finishNode(clause, "CatchClause");
5308
+ node.handler = this.finishNode(clause, "CatchClause");
5328
5309
  }
5329
- node2.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
5330
- if (!node2.handler && !node2.finalizer) {
5331
- this.raise(node2.start, "Missing catch or finally clause");
5310
+ node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
5311
+ if (!node.handler && !node.finalizer) {
5312
+ this.raise(node.start, "Missing catch or finally clause");
5332
5313
  }
5333
- return this.finishNode(node2, "TryStatement");
5314
+ return this.finishNode(node, "TryStatement");
5334
5315
  };
5335
- pp$8.parseVarStatement = function(node2, kind, allowMissingInitializer) {
5316
+ pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
5336
5317
  this.next();
5337
- this.parseVar(node2, false, kind, allowMissingInitializer);
5318
+ this.parseVar(node, false, kind, allowMissingInitializer);
5338
5319
  this.semicolon();
5339
- return this.finishNode(node2, "VariableDeclaration");
5320
+ return this.finishNode(node, "VariableDeclaration");
5340
5321
  };
5341
- pp$8.parseWhileStatement = function(node2) {
5322
+ pp$8.parseWhileStatement = function(node) {
5342
5323
  this.next();
5343
- node2.test = this.parseParenExpression();
5324
+ node.test = this.parseParenExpression();
5344
5325
  this.labels.push(loopLabel);
5345
- node2.body = this.parseStatement("while");
5326
+ node.body = this.parseStatement("while");
5346
5327
  this.labels.pop();
5347
- return this.finishNode(node2, "WhileStatement");
5328
+ return this.finishNode(node, "WhileStatement");
5348
5329
  };
5349
- pp$8.parseWithStatement = function(node2) {
5330
+ pp$8.parseWithStatement = function(node) {
5350
5331
  if (this.strict) {
5351
5332
  this.raise(this.start, "'with' in strict mode");
5352
5333
  }
5353
5334
  this.next();
5354
- node2.object = this.parseParenExpression();
5355
- node2.body = this.parseStatement("with");
5356
- return this.finishNode(node2, "WithStatement");
5335
+ node.object = this.parseParenExpression();
5336
+ node.body = this.parseStatement("with");
5337
+ return this.finishNode(node, "WithStatement");
5357
5338
  };
5358
- pp$8.parseEmptyStatement = function(node2) {
5339
+ pp$8.parseEmptyStatement = function(node) {
5359
5340
  this.next();
5360
- return this.finishNode(node2, "EmptyStatement");
5341
+ return this.finishNode(node, "EmptyStatement");
5361
5342
  };
5362
- pp$8.parseLabeledStatement = function(node2, maybeName, expr, context) {
5343
+ pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
5363
5344
  for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) {
5364
5345
  var label = list[i$1];
5365
5346
  if (label.name === maybeName) {
@@ -5369,7 +5350,7 @@ pp$8.parseLabeledStatement = function(node2, maybeName, expr, context) {
5369
5350
  var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
5370
5351
  for (var i = this.labels.length - 1; i >= 0; i--) {
5371
5352
  var label$1 = this.labels[i];
5372
- if (label$1.statementStart === node2.start) {
5353
+ if (label$1.statementStart === node.start) {
5373
5354
  label$1.statementStart = this.start;
5374
5355
  label$1.kind = kind;
5375
5356
  } else {
@@ -5377,29 +5358,29 @@ pp$8.parseLabeledStatement = function(node2, maybeName, expr, context) {
5377
5358
  }
5378
5359
  }
5379
5360
  this.labels.push({ name: maybeName, kind, statementStart: this.start });
5380
- node2.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
5361
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
5381
5362
  this.labels.pop();
5382
- node2.label = expr;
5383
- return this.finishNode(node2, "LabeledStatement");
5363
+ node.label = expr;
5364
+ return this.finishNode(node, "LabeledStatement");
5384
5365
  };
5385
- pp$8.parseExpressionStatement = function(node2, expr) {
5386
- node2.expression = expr;
5366
+ pp$8.parseExpressionStatement = function(node, expr) {
5367
+ node.expression = expr;
5387
5368
  this.semicolon();
5388
- return this.finishNode(node2, "ExpressionStatement");
5369
+ return this.finishNode(node, "ExpressionStatement");
5389
5370
  };
5390
- pp$8.parseBlock = function(createNewLexicalScope, node2, exitStrict) {
5371
+ pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
5391
5372
  if (createNewLexicalScope === void 0)
5392
5373
  createNewLexicalScope = true;
5393
- if (node2 === void 0)
5394
- node2 = this.startNode();
5395
- node2.body = [];
5374
+ if (node === void 0)
5375
+ node = this.startNode();
5376
+ node.body = [];
5396
5377
  this.expect(types$1.braceL);
5397
5378
  if (createNewLexicalScope) {
5398
5379
  this.enterScope(0);
5399
5380
  }
5400
5381
  while (this.type !== types$1.braceR) {
5401
5382
  var stmt = this.parseStatement(null);
5402
- node2.body.push(stmt);
5383
+ node.body.push(stmt);
5403
5384
  }
5404
5385
  if (exitStrict) {
5405
5386
  this.strict = false;
@@ -5408,21 +5389,21 @@ pp$8.parseBlock = function(createNewLexicalScope, node2, exitStrict) {
5408
5389
  if (createNewLexicalScope) {
5409
5390
  this.exitScope();
5410
5391
  }
5411
- return this.finishNode(node2, "BlockStatement");
5392
+ return this.finishNode(node, "BlockStatement");
5412
5393
  };
5413
- pp$8.parseFor = function(node2, init) {
5414
- node2.init = init;
5394
+ pp$8.parseFor = function(node, init) {
5395
+ node.init = init;
5415
5396
  this.expect(types$1.semi);
5416
- node2.test = this.type === types$1.semi ? null : this.parseExpression();
5397
+ node.test = this.type === types$1.semi ? null : this.parseExpression();
5417
5398
  this.expect(types$1.semi);
5418
- node2.update = this.type === types$1.parenR ? null : this.parseExpression();
5399
+ node.update = this.type === types$1.parenR ? null : this.parseExpression();
5419
5400
  this.expect(types$1.parenR);
5420
- node2.body = this.parseStatement("for");
5401
+ node.body = this.parseStatement("for");
5421
5402
  this.exitScope();
5422
5403
  this.labels.pop();
5423
- return this.finishNode(node2, "ForStatement");
5404
+ return this.finishNode(node, "ForStatement");
5424
5405
  };
5425
- pp$8.parseForIn = function(node2, init) {
5406
+ pp$8.parseForIn = function(node, init) {
5426
5407
  var isForIn = this.type === types$1._in;
5427
5408
  this.next();
5428
5409
  if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
@@ -5431,17 +5412,17 @@ pp$8.parseForIn = function(node2, init) {
5431
5412
  (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
5432
5413
  );
5433
5414
  }
5434
- node2.left = init;
5435
- node2.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
5415
+ node.left = init;
5416
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
5436
5417
  this.expect(types$1.parenR);
5437
- node2.body = this.parseStatement("for");
5418
+ node.body = this.parseStatement("for");
5438
5419
  this.exitScope();
5439
5420
  this.labels.pop();
5440
- return this.finishNode(node2, isForIn ? "ForInStatement" : "ForOfStatement");
5421
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
5441
5422
  };
5442
- pp$8.parseVar = function(node2, isFor, kind, allowMissingInitializer) {
5443
- node2.declarations = [];
5444
- node2.kind = kind;
5423
+ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
5424
+ node.declarations = [];
5425
+ node.kind = kind;
5445
5426
  for (; ; ) {
5446
5427
  var decl = this.startNode();
5447
5428
  this.parseVarId(decl, kind);
@@ -5454,12 +5435,12 @@ pp$8.parseVar = function(node2, isFor, kind, allowMissingInitializer) {
5454
5435
  } else {
5455
5436
  decl.init = null;
5456
5437
  }
5457
- node2.declarations.push(this.finishNode(decl, "VariableDeclarator"));
5438
+ node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
5458
5439
  if (!this.eat(types$1.comma)) {
5459
5440
  break;
5460
5441
  }
5461
5442
  }
5462
- return node2;
5443
+ return node;
5463
5444
  };
5464
5445
  pp$8.parseVarId = function(decl, kind) {
5465
5446
  decl.id = this.parseBindingAtom();
@@ -5468,56 +5449,56 @@ pp$8.parseVarId = function(decl, kind) {
5468
5449
  var FUNC_STATEMENT = 1;
5469
5450
  var FUNC_HANGING_STATEMENT = 2;
5470
5451
  var FUNC_NULLABLE_ID = 4;
5471
- pp$8.parseFunction = function(node2, statement, allowExpressionBody, isAsync, forInit) {
5472
- this.initFunction(node2);
5452
+ pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
5453
+ this.initFunction(node);
5473
5454
  if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
5474
5455
  if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) {
5475
5456
  this.unexpected();
5476
5457
  }
5477
- node2.generator = this.eat(types$1.star);
5458
+ node.generator = this.eat(types$1.star);
5478
5459
  }
5479
5460
  if (this.options.ecmaVersion >= 8) {
5480
- node2.async = !!isAsync;
5461
+ node.async = !!isAsync;
5481
5462
  }
5482
5463
  if (statement & FUNC_STATEMENT) {
5483
- node2.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent();
5484
- if (node2.id && !(statement & FUNC_HANGING_STATEMENT)) {
5485
- this.checkLValSimple(node2.id, this.strict || node2.generator || node2.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);
5464
+ node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent();
5465
+ if (node.id && !(statement & FUNC_HANGING_STATEMENT)) {
5466
+ this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);
5486
5467
  }
5487
5468
  }
5488
5469
  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
5489
5470
  this.yieldPos = 0;
5490
5471
  this.awaitPos = 0;
5491
5472
  this.awaitIdentPos = 0;
5492
- this.enterScope(functionFlags(node2.async, node2.generator));
5473
+ this.enterScope(functionFlags(node.async, node.generator));
5493
5474
  if (!(statement & FUNC_STATEMENT)) {
5494
- node2.id = this.type === types$1.name ? this.parseIdent() : null;
5475
+ node.id = this.type === types$1.name ? this.parseIdent() : null;
5495
5476
  }
5496
- this.parseFunctionParams(node2);
5497
- this.parseFunctionBody(node2, allowExpressionBody, false, forInit);
5477
+ this.parseFunctionParams(node);
5478
+ this.parseFunctionBody(node, allowExpressionBody, false, forInit);
5498
5479
  this.yieldPos = oldYieldPos;
5499
5480
  this.awaitPos = oldAwaitPos;
5500
5481
  this.awaitIdentPos = oldAwaitIdentPos;
5501
- return this.finishNode(node2, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression");
5482
+ return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression");
5502
5483
  };
5503
- pp$8.parseFunctionParams = function(node2) {
5484
+ pp$8.parseFunctionParams = function(node) {
5504
5485
  this.expect(types$1.parenL);
5505
- node2.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
5486
+ node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
5506
5487
  this.checkYieldAwaitInDefaultParams();
5507
5488
  };
5508
- pp$8.parseClass = function(node2, isStatement) {
5489
+ pp$8.parseClass = function(node, isStatement) {
5509
5490
  this.next();
5510
5491
  var oldStrict = this.strict;
5511
5492
  this.strict = true;
5512
- this.parseClassId(node2, isStatement);
5513
- this.parseClassSuper(node2);
5493
+ this.parseClassId(node, isStatement);
5494
+ this.parseClassSuper(node);
5514
5495
  var privateNameMap = this.enterClassBody();
5515
5496
  var classBody = this.startNode();
5516
5497
  var hadConstructor = false;
5517
5498
  classBody.body = [];
5518
5499
  this.expect(types$1.braceL);
5519
5500
  while (this.type !== types$1.braceR) {
5520
- var element = this.parseClassElement(node2.superClass !== null);
5501
+ var element = this.parseClassElement(node.superClass !== null);
5521
5502
  if (element) {
5522
5503
  classBody.body.push(element);
5523
5504
  if (element.type === "MethodDefinition" && element.kind === "constructor") {
@@ -5532,16 +5513,16 @@ pp$8.parseClass = function(node2, isStatement) {
5532
5513
  }
5533
5514
  this.strict = oldStrict;
5534
5515
  this.next();
5535
- node2.body = this.finishNode(classBody, "ClassBody");
5516
+ node.body = this.finishNode(classBody, "ClassBody");
5536
5517
  this.exitClassBody();
5537
- return this.finishNode(node2, isStatement ? "ClassDeclaration" : "ClassExpression");
5518
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
5538
5519
  };
5539
5520
  pp$8.parseClassElement = function(constructorAllowsSuper) {
5540
5521
  if (this.eat(types$1.semi)) {
5541
5522
  return null;
5542
5523
  }
5543
5524
  var ecmaVersion = this.options.ecmaVersion;
5544
- var node2 = this.startNode();
5525
+ var node = this.startNode();
5545
5526
  var keyName = "";
5546
5527
  var isGenerator = false;
5547
5528
  var isAsync = false;
@@ -5549,8 +5530,8 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
5549
5530
  var isStatic = false;
5550
5531
  if (this.eatContextual("static")) {
5551
5532
  if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
5552
- this.parseClassStaticBlock(node2);
5553
- return node2;
5533
+ this.parseClassStaticBlock(node);
5534
+ return node;
5554
5535
  }
5555
5536
  if (this.isClassElementNameStart() || this.type === types$1.star) {
5556
5537
  isStatic = true;
@@ -5558,7 +5539,7 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
5558
5539
  keyName = "static";
5559
5540
  }
5560
5541
  }
5561
- node2.static = isStatic;
5542
+ node.static = isStatic;
5562
5543
  if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
5563
5544
  if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
5564
5545
  isAsync = true;
@@ -5580,25 +5561,25 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
5580
5561
  }
5581
5562
  }
5582
5563
  if (keyName) {
5583
- node2.computed = false;
5584
- node2.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
5585
- node2.key.name = keyName;
5586
- this.finishNode(node2.key, "Identifier");
5564
+ node.computed = false;
5565
+ node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
5566
+ node.key.name = keyName;
5567
+ this.finishNode(node.key, "Identifier");
5587
5568
  } else {
5588
- this.parseClassElementName(node2);
5569
+ this.parseClassElementName(node);
5589
5570
  }
5590
5571
  if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
5591
- var isConstructor = !node2.static && checkKeyName(node2, "constructor");
5572
+ var isConstructor = !node.static && checkKeyName(node, "constructor");
5592
5573
  var allowsDirectSuper = isConstructor && constructorAllowsSuper;
5593
5574
  if (isConstructor && kind !== "method") {
5594
- this.raise(node2.key.start, "Constructor can't have get/set modifier");
5575
+ this.raise(node.key.start, "Constructor can't have get/set modifier");
5595
5576
  }
5596
- node2.kind = isConstructor ? "constructor" : kind;
5597
- this.parseClassMethod(node2, isGenerator, isAsync, allowsDirectSuper);
5577
+ node.kind = isConstructor ? "constructor" : kind;
5578
+ this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
5598
5579
  } else {
5599
- this.parseClassField(node2);
5580
+ this.parseClassField(node);
5600
5581
  }
5601
- return node2;
5582
+ return node;
5602
5583
  };
5603
5584
  pp$8.isClassElementNameStart = function() {
5604
5585
  return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword;
@@ -5656,35 +5637,35 @@ pp$8.parseClassField = function(field) {
5656
5637
  this.semicolon();
5657
5638
  return this.finishNode(field, "PropertyDefinition");
5658
5639
  };
5659
- pp$8.parseClassStaticBlock = function(node2) {
5660
- node2.body = [];
5640
+ pp$8.parseClassStaticBlock = function(node) {
5641
+ node.body = [];
5661
5642
  var oldLabels = this.labels;
5662
5643
  this.labels = [];
5663
5644
  this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
5664
5645
  while (this.type !== types$1.braceR) {
5665
5646
  var stmt = this.parseStatement(null);
5666
- node2.body.push(stmt);
5647
+ node.body.push(stmt);
5667
5648
  }
5668
5649
  this.next();
5669
5650
  this.exitScope();
5670
5651
  this.labels = oldLabels;
5671
- return this.finishNode(node2, "StaticBlock");
5652
+ return this.finishNode(node, "StaticBlock");
5672
5653
  };
5673
- pp$8.parseClassId = function(node2, isStatement) {
5654
+ pp$8.parseClassId = function(node, isStatement) {
5674
5655
  if (this.type === types$1.name) {
5675
- node2.id = this.parseIdent();
5656
+ node.id = this.parseIdent();
5676
5657
  if (isStatement) {
5677
- this.checkLValSimple(node2.id, BIND_LEXICAL, false);
5658
+ this.checkLValSimple(node.id, BIND_LEXICAL, false);
5678
5659
  }
5679
5660
  } else {
5680
5661
  if (isStatement === true) {
5681
5662
  this.unexpected();
5682
5663
  }
5683
- node2.id = null;
5664
+ node.id = null;
5684
5665
  }
5685
5666
  };
5686
- pp$8.parseClassSuper = function(node2) {
5687
- node2.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
5667
+ pp$8.parseClassSuper = function(node) {
5668
+ node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
5688
5669
  };
5689
5670
  pp$8.enterClassBody = function() {
5690
5671
  var element = { declared: /* @__PURE__ */ Object.create(null), used: [] };
@@ -5728,57 +5709,57 @@ function isPrivateNameConflicted(privateNameMap, element) {
5728
5709
  return true;
5729
5710
  }
5730
5711
  }
5731
- function checkKeyName(node2, name) {
5732
- var computed = node2.computed;
5733
- var key = node2.key;
5712
+ function checkKeyName(node, name) {
5713
+ var computed = node.computed;
5714
+ var key = node.key;
5734
5715
  return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
5735
5716
  }
5736
- pp$8.parseExportAllDeclaration = function(node2, exports) {
5717
+ pp$8.parseExportAllDeclaration = function(node, exports2) {
5737
5718
  if (this.options.ecmaVersion >= 11) {
5738
5719
  if (this.eatContextual("as")) {
5739
- node2.exported = this.parseModuleExportName();
5740
- this.checkExport(exports, node2.exported, this.lastTokStart);
5720
+ node.exported = this.parseModuleExportName();
5721
+ this.checkExport(exports2, node.exported, this.lastTokStart);
5741
5722
  } else {
5742
- node2.exported = null;
5723
+ node.exported = null;
5743
5724
  }
5744
5725
  }
5745
5726
  this.expectContextual("from");
5746
5727
  if (this.type !== types$1.string) {
5747
5728
  this.unexpected();
5748
5729
  }
5749
- node2.source = this.parseExprAtom();
5730
+ node.source = this.parseExprAtom();
5750
5731
  this.semicolon();
5751
- return this.finishNode(node2, "ExportAllDeclaration");
5732
+ return this.finishNode(node, "ExportAllDeclaration");
5752
5733
  };
5753
- pp$8.parseExport = function(node2, exports) {
5734
+ pp$8.parseExport = function(node, exports2) {
5754
5735
  this.next();
5755
5736
  if (this.eat(types$1.star)) {
5756
- return this.parseExportAllDeclaration(node2, exports);
5737
+ return this.parseExportAllDeclaration(node, exports2);
5757
5738
  }
5758
5739
  if (this.eat(types$1._default)) {
5759
- this.checkExport(exports, "default", this.lastTokStart);
5760
- node2.declaration = this.parseExportDefaultDeclaration();
5761
- return this.finishNode(node2, "ExportDefaultDeclaration");
5740
+ this.checkExport(exports2, "default", this.lastTokStart);
5741
+ node.declaration = this.parseExportDefaultDeclaration();
5742
+ return this.finishNode(node, "ExportDefaultDeclaration");
5762
5743
  }
5763
5744
  if (this.shouldParseExportStatement()) {
5764
- node2.declaration = this.parseExportDeclaration(node2);
5765
- if (node2.declaration.type === "VariableDeclaration") {
5766
- this.checkVariableExport(exports, node2.declaration.declarations);
5745
+ node.declaration = this.parseExportDeclaration(node);
5746
+ if (node.declaration.type === "VariableDeclaration") {
5747
+ this.checkVariableExport(exports2, node.declaration.declarations);
5767
5748
  } else {
5768
- this.checkExport(exports, node2.declaration.id, node2.declaration.id.start);
5749
+ this.checkExport(exports2, node.declaration.id, node.declaration.id.start);
5769
5750
  }
5770
- node2.specifiers = [];
5771
- node2.source = null;
5751
+ node.specifiers = [];
5752
+ node.source = null;
5772
5753
  } else {
5773
- node2.declaration = null;
5774
- node2.specifiers = this.parseExportSpecifiers(exports);
5754
+ node.declaration = null;
5755
+ node.specifiers = this.parseExportSpecifiers(exports2);
5775
5756
  if (this.eatContextual("from")) {
5776
5757
  if (this.type !== types$1.string) {
5777
5758
  this.unexpected();
5778
5759
  }
5779
- node2.source = this.parseExprAtom();
5760
+ node.source = this.parseExprAtom();
5780
5761
  } else {
5781
- for (var i = 0, list = node2.specifiers; i < list.length; i += 1) {
5762
+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
5782
5763
  var spec = list[i];
5783
5764
  this.checkUnreserved(spec.local);
5784
5765
  this.checkLocalExport(spec.local);
@@ -5786,13 +5767,13 @@ pp$8.parseExport = function(node2, exports) {
5786
5767
  this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
5787
5768
  }
5788
5769
  }
5789
- node2.source = null;
5770
+ node.source = null;
5790
5771
  }
5791
5772
  this.semicolon();
5792
5773
  }
5793
- return this.finishNode(node2, "ExportNamedDeclaration");
5774
+ return this.finishNode(node, "ExportNamedDeclaration");
5794
5775
  };
5795
- pp$8.parseExportDeclaration = function(node2) {
5776
+ pp$8.parseExportDeclaration = function(node) {
5796
5777
  return this.parseStatement(null);
5797
5778
  };
5798
5779
  pp$8.parseExportDefaultDeclaration = function() {
@@ -5813,66 +5794,66 @@ pp$8.parseExportDefaultDeclaration = function() {
5813
5794
  return declaration;
5814
5795
  }
5815
5796
  };
5816
- pp$8.checkExport = function(exports, name, pos) {
5817
- if (!exports) {
5797
+ pp$8.checkExport = function(exports2, name, pos) {
5798
+ if (!exports2) {
5818
5799
  return;
5819
5800
  }
5820
5801
  if (typeof name !== "string") {
5821
5802
  name = name.type === "Identifier" ? name.name : name.value;
5822
5803
  }
5823
- if (hasOwn(exports, name)) {
5804
+ if (hasOwn(exports2, name)) {
5824
5805
  this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
5825
5806
  }
5826
- exports[name] = true;
5807
+ exports2[name] = true;
5827
5808
  };
5828
- pp$8.checkPatternExport = function(exports, pat) {
5809
+ pp$8.checkPatternExport = function(exports2, pat) {
5829
5810
  var type = pat.type;
5830
5811
  if (type === "Identifier") {
5831
- this.checkExport(exports, pat, pat.start);
5812
+ this.checkExport(exports2, pat, pat.start);
5832
5813
  } else if (type === "ObjectPattern") {
5833
5814
  for (var i = 0, list = pat.properties; i < list.length; i += 1) {
5834
5815
  var prop = list[i];
5835
- this.checkPatternExport(exports, prop);
5816
+ this.checkPatternExport(exports2, prop);
5836
5817
  }
5837
5818
  } else if (type === "ArrayPattern") {
5838
5819
  for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
5839
5820
  var elt = list$1[i$1];
5840
5821
  if (elt) {
5841
- this.checkPatternExport(exports, elt);
5822
+ this.checkPatternExport(exports2, elt);
5842
5823
  }
5843
5824
  }
5844
5825
  } else if (type === "Property") {
5845
- this.checkPatternExport(exports, pat.value);
5826
+ this.checkPatternExport(exports2, pat.value);
5846
5827
  } else if (type === "AssignmentPattern") {
5847
- this.checkPatternExport(exports, pat.left);
5828
+ this.checkPatternExport(exports2, pat.left);
5848
5829
  } else if (type === "RestElement") {
5849
- this.checkPatternExport(exports, pat.argument);
5830
+ this.checkPatternExport(exports2, pat.argument);
5850
5831
  }
5851
5832
  };
5852
- pp$8.checkVariableExport = function(exports, decls) {
5853
- if (!exports) {
5833
+ pp$8.checkVariableExport = function(exports2, decls) {
5834
+ if (!exports2) {
5854
5835
  return;
5855
5836
  }
5856
5837
  for (var i = 0, list = decls; i < list.length; i += 1) {
5857
5838
  var decl = list[i];
5858
- this.checkPatternExport(exports, decl.id);
5839
+ this.checkPatternExport(exports2, decl.id);
5859
5840
  }
5860
5841
  };
5861
5842
  pp$8.shouldParseExportStatement = function() {
5862
5843
  return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
5863
5844
  };
5864
- pp$8.parseExportSpecifier = function(exports) {
5865
- var node2 = this.startNode();
5866
- node2.local = this.parseModuleExportName();
5867
- node2.exported = this.eatContextual("as") ? this.parseModuleExportName() : node2.local;
5845
+ pp$8.parseExportSpecifier = function(exports2) {
5846
+ var node = this.startNode();
5847
+ node.local = this.parseModuleExportName();
5848
+ node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
5868
5849
  this.checkExport(
5869
- exports,
5870
- node2.exported,
5871
- node2.exported.start
5850
+ exports2,
5851
+ node.exported,
5852
+ node.exported.start
5872
5853
  );
5873
- return this.finishNode(node2, "ExportSpecifier");
5854
+ return this.finishNode(node, "ExportSpecifier");
5874
5855
  };
5875
- pp$8.parseExportSpecifiers = function(exports) {
5856
+ pp$8.parseExportSpecifiers = function(exports2) {
5876
5857
  var nodes = [], first = true;
5877
5858
  this.expect(types$1.braceL);
5878
5859
  while (!this.eat(types$1.braceR)) {
@@ -5884,48 +5865,48 @@ pp$8.parseExportSpecifiers = function(exports) {
5884
5865
  } else {
5885
5866
  first = false;
5886
5867
  }
5887
- nodes.push(this.parseExportSpecifier(exports));
5868
+ nodes.push(this.parseExportSpecifier(exports2));
5888
5869
  }
5889
5870
  return nodes;
5890
5871
  };
5891
- pp$8.parseImport = function(node2) {
5872
+ pp$8.parseImport = function(node) {
5892
5873
  this.next();
5893
5874
  if (this.type === types$1.string) {
5894
- node2.specifiers = empty$1;
5895
- node2.source = this.parseExprAtom();
5875
+ node.specifiers = empty$1;
5876
+ node.source = this.parseExprAtom();
5896
5877
  } else {
5897
- node2.specifiers = this.parseImportSpecifiers();
5878
+ node.specifiers = this.parseImportSpecifiers();
5898
5879
  this.expectContextual("from");
5899
- node2.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
5880
+ node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
5900
5881
  }
5901
5882
  this.semicolon();
5902
- return this.finishNode(node2, "ImportDeclaration");
5883
+ return this.finishNode(node, "ImportDeclaration");
5903
5884
  };
5904
5885
  pp$8.parseImportSpecifier = function() {
5905
- var node2 = this.startNode();
5906
- node2.imported = this.parseModuleExportName();
5886
+ var node = this.startNode();
5887
+ node.imported = this.parseModuleExportName();
5907
5888
  if (this.eatContextual("as")) {
5908
- node2.local = this.parseIdent();
5889
+ node.local = this.parseIdent();
5909
5890
  } else {
5910
- this.checkUnreserved(node2.imported);
5911
- node2.local = node2.imported;
5891
+ this.checkUnreserved(node.imported);
5892
+ node.local = node.imported;
5912
5893
  }
5913
- this.checkLValSimple(node2.local, BIND_LEXICAL);
5914
- return this.finishNode(node2, "ImportSpecifier");
5894
+ this.checkLValSimple(node.local, BIND_LEXICAL);
5895
+ return this.finishNode(node, "ImportSpecifier");
5915
5896
  };
5916
5897
  pp$8.parseImportDefaultSpecifier = function() {
5917
- var node2 = this.startNode();
5918
- node2.local = this.parseIdent();
5919
- this.checkLValSimple(node2.local, BIND_LEXICAL);
5920
- return this.finishNode(node2, "ImportDefaultSpecifier");
5898
+ var node = this.startNode();
5899
+ node.local = this.parseIdent();
5900
+ this.checkLValSimple(node.local, BIND_LEXICAL);
5901
+ return this.finishNode(node, "ImportDefaultSpecifier");
5921
5902
  };
5922
5903
  pp$8.parseImportNamespaceSpecifier = function() {
5923
- var node2 = this.startNode();
5904
+ var node = this.startNode();
5924
5905
  this.next();
5925
5906
  this.expectContextual("as");
5926
- node2.local = this.parseIdent();
5927
- this.checkLValSimple(node2.local, BIND_LEXICAL);
5928
- return this.finishNode(node2, "ImportNamespaceSpecifier");
5907
+ node.local = this.parseIdent();
5908
+ this.checkLValSimple(node.local, BIND_LEXICAL);
5909
+ return this.finishNode(node, "ImportNamespaceSpecifier");
5929
5910
  };
5930
5911
  pp$8.parseImportSpecifiers = function() {
5931
5912
  var nodes = [], first = true;
@@ -5973,12 +5954,12 @@ pp$8.isDirectiveCandidate = function(statement) {
5973
5954
  (this.input[statement.start] === '"' || this.input[statement.start] === "'");
5974
5955
  };
5975
5956
  var pp$7 = Parser.prototype;
5976
- pp$7.toAssignable = function(node2, isBinding, refDestructuringErrors) {
5977
- if (this.options.ecmaVersion >= 6 && node2) {
5978
- switch (node2.type) {
5957
+ pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
5958
+ if (this.options.ecmaVersion >= 6 && node) {
5959
+ switch (node.type) {
5979
5960
  case "Identifier":
5980
- if (this.inAsync && node2.name === "await") {
5981
- this.raise(node2.start, "Cannot use 'await' as identifier inside an async function");
5961
+ if (this.inAsync && node.name === "await") {
5962
+ this.raise(node.start, "Cannot use 'await' as identifier inside an async function");
5982
5963
  }
5983
5964
  break;
5984
5965
  case "ObjectPattern":
@@ -5987,11 +5968,11 @@ pp$7.toAssignable = function(node2, isBinding, refDestructuringErrors) {
5987
5968
  case "RestElement":
5988
5969
  break;
5989
5970
  case "ObjectExpression":
5990
- node2.type = "ObjectPattern";
5971
+ node.type = "ObjectPattern";
5991
5972
  if (refDestructuringErrors) {
5992
5973
  this.checkPatternErrors(refDestructuringErrors, true);
5993
5974
  }
5994
- for (var i = 0, list = node2.properties; i < list.length; i += 1) {
5975
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
5995
5976
  var prop = list[i];
5996
5977
  this.toAssignable(prop, isBinding);
5997
5978
  if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) {
@@ -6000,50 +5981,50 @@ pp$7.toAssignable = function(node2, isBinding, refDestructuringErrors) {
6000
5981
  }
6001
5982
  break;
6002
5983
  case "Property":
6003
- if (node2.kind !== "init") {
6004
- this.raise(node2.key.start, "Object pattern can't contain getter or setter");
5984
+ if (node.kind !== "init") {
5985
+ this.raise(node.key.start, "Object pattern can't contain getter or setter");
6005
5986
  }
6006
- this.toAssignable(node2.value, isBinding);
5987
+ this.toAssignable(node.value, isBinding);
6007
5988
  break;
6008
5989
  case "ArrayExpression":
6009
- node2.type = "ArrayPattern";
5990
+ node.type = "ArrayPattern";
6010
5991
  if (refDestructuringErrors) {
6011
5992
  this.checkPatternErrors(refDestructuringErrors, true);
6012
5993
  }
6013
- this.toAssignableList(node2.elements, isBinding);
5994
+ this.toAssignableList(node.elements, isBinding);
6014
5995
  break;
6015
5996
  case "SpreadElement":
6016
- node2.type = "RestElement";
6017
- this.toAssignable(node2.argument, isBinding);
6018
- if (node2.argument.type === "AssignmentPattern") {
6019
- this.raise(node2.argument.start, "Rest elements cannot have a default value");
5997
+ node.type = "RestElement";
5998
+ this.toAssignable(node.argument, isBinding);
5999
+ if (node.argument.type === "AssignmentPattern") {
6000
+ this.raise(node.argument.start, "Rest elements cannot have a default value");
6020
6001
  }
6021
6002
  break;
6022
6003
  case "AssignmentExpression":
6023
- if (node2.operator !== "=") {
6024
- this.raise(node2.left.end, "Only '=' operator can be used for specifying default value.");
6004
+ if (node.operator !== "=") {
6005
+ this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
6025
6006
  }
6026
- node2.type = "AssignmentPattern";
6027
- delete node2.operator;
6028
- this.toAssignable(node2.left, isBinding);
6007
+ node.type = "AssignmentPattern";
6008
+ delete node.operator;
6009
+ this.toAssignable(node.left, isBinding);
6029
6010
  break;
6030
6011
  case "ParenthesizedExpression":
6031
- this.toAssignable(node2.expression, isBinding, refDestructuringErrors);
6012
+ this.toAssignable(node.expression, isBinding, refDestructuringErrors);
6032
6013
  break;
6033
6014
  case "ChainExpression":
6034
- this.raiseRecoverable(node2.start, "Optional chaining cannot appear in left-hand side");
6015
+ this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
6035
6016
  break;
6036
6017
  case "MemberExpression":
6037
6018
  if (!isBinding) {
6038
6019
  break;
6039
6020
  }
6040
6021
  default:
6041
- this.raise(node2.start, "Assigning to rvalue");
6022
+ this.raise(node.start, "Assigning to rvalue");
6042
6023
  }
6043
6024
  } else if (refDestructuringErrors) {
6044
6025
  this.checkPatternErrors(refDestructuringErrors, true);
6045
6026
  }
6046
- return node2;
6027
+ return node;
6047
6028
  };
6048
6029
  pp$7.toAssignableList = function(exprList, isBinding) {
6049
6030
  var end = exprList.length;
@@ -6062,28 +6043,28 @@ pp$7.toAssignableList = function(exprList, isBinding) {
6062
6043
  return exprList;
6063
6044
  };
6064
6045
  pp$7.parseSpread = function(refDestructuringErrors) {
6065
- var node2 = this.startNode();
6046
+ var node = this.startNode();
6066
6047
  this.next();
6067
- node2.argument = this.parseMaybeAssign(false, refDestructuringErrors);
6068
- return this.finishNode(node2, "SpreadElement");
6048
+ node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
6049
+ return this.finishNode(node, "SpreadElement");
6069
6050
  };
6070
6051
  pp$7.parseRestBinding = function() {
6071
- var node2 = this.startNode();
6052
+ var node = this.startNode();
6072
6053
  this.next();
6073
6054
  if (this.options.ecmaVersion === 6 && this.type !== types$1.name) {
6074
6055
  this.unexpected();
6075
6056
  }
6076
- node2.argument = this.parseBindingAtom();
6077
- return this.finishNode(node2, "RestElement");
6057
+ node.argument = this.parseBindingAtom();
6058
+ return this.finishNode(node, "RestElement");
6078
6059
  };
6079
6060
  pp$7.parseBindingAtom = function() {
6080
6061
  if (this.options.ecmaVersion >= 6) {
6081
6062
  switch (this.type) {
6082
6063
  case types$1.bracketL:
6083
- var node2 = this.startNode();
6064
+ var node = this.startNode();
6084
6065
  this.next();
6085
- node2.elements = this.parseBindingList(types$1.bracketR, true, true);
6086
- return this.finishNode(node2, "ArrayPattern");
6066
+ node.elements = this.parseBindingList(types$1.bracketR, true, true);
6067
+ return this.finishNode(node, "ArrayPattern");
6087
6068
  case types$1.braceL:
6088
6069
  return this.parseObj(true);
6089
6070
  }
@@ -6130,10 +6111,10 @@ pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
6130
6111
  if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) {
6131
6112
  return left;
6132
6113
  }
6133
- var node2 = this.startNodeAt(startPos, startLoc);
6134
- node2.left = left;
6135
- node2.right = this.parseMaybeAssign();
6136
- return this.finishNode(node2, "AssignmentPattern");
6114
+ var node = this.startNodeAt(startPos, startLoc);
6115
+ node.left = left;
6116
+ node.right = this.parseMaybeAssign();
6117
+ return this.finishNode(node, "AssignmentPattern");
6137
6118
  };
6138
6119
  pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
6139
6120
  if (bindingType === void 0)
@@ -6418,12 +6399,12 @@ pp$5.parseExpression = function(forInit, refDestructuringErrors) {
6418
6399
  var startPos = this.start, startLoc = this.startLoc;
6419
6400
  var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
6420
6401
  if (this.type === types$1.comma) {
6421
- var node2 = this.startNodeAt(startPos, startLoc);
6422
- node2.expressions = [expr];
6402
+ var node = this.startNodeAt(startPos, startLoc);
6403
+ node.expressions = [expr];
6423
6404
  while (this.eat(types$1.comma)) {
6424
- node2.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
6405
+ node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
6425
6406
  }
6426
- return this.finishNode(node2, "SequenceExpression");
6407
+ return this.finishNode(node, "SequenceExpression");
6427
6408
  }
6428
6409
  return expr;
6429
6410
  };
@@ -6455,8 +6436,8 @@ pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse
6455
6436
  left = afterLeftParse.call(this, left, startPos, startLoc);
6456
6437
  }
6457
6438
  if (this.type.isAssign) {
6458
- var node2 = this.startNodeAt(startPos, startLoc);
6459
- node2.operator = this.value;
6439
+ var node = this.startNodeAt(startPos, startLoc);
6440
+ node.operator = this.value;
6460
6441
  if (this.type === types$1.eq) {
6461
6442
  left = this.toAssignable(left, false, refDestructuringErrors);
6462
6443
  }
@@ -6471,13 +6452,13 @@ pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse
6471
6452
  } else {
6472
6453
  this.checkLValSimple(left);
6473
6454
  }
6474
- node2.left = left;
6455
+ node.left = left;
6475
6456
  this.next();
6476
- node2.right = this.parseMaybeAssign(forInit);
6457
+ node.right = this.parseMaybeAssign(forInit);
6477
6458
  if (oldDoubleProto > -1) {
6478
6459
  refDestructuringErrors.doubleProto = oldDoubleProto;
6479
6460
  }
6480
- return this.finishNode(node2, "AssignmentExpression");
6461
+ return this.finishNode(node, "AssignmentExpression");
6481
6462
  } else {
6482
6463
  if (ownDestructuringErrors) {
6483
6464
  this.checkExpressionErrors(refDestructuringErrors, true);
@@ -6498,12 +6479,12 @@ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
6498
6479
  return expr;
6499
6480
  }
6500
6481
  if (this.eat(types$1.question)) {
6501
- var node2 = this.startNodeAt(startPos, startLoc);
6502
- node2.test = expr;
6503
- node2.consequent = this.parseMaybeAssign();
6482
+ var node = this.startNodeAt(startPos, startLoc);
6483
+ node.test = expr;
6484
+ node.consequent = this.parseMaybeAssign();
6504
6485
  this.expect(types$1.colon);
6505
- node2.alternate = this.parseMaybeAssign(forInit);
6506
- return this.finishNode(node2, "ConditionalExpression");
6486
+ node.alternate = this.parseMaybeAssign(forInit);
6487
+ return this.finishNode(node, "ConditionalExpression");
6507
6488
  }
6508
6489
  return expr;
6509
6490
  };
@@ -6528,11 +6509,11 @@ pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit)
6528
6509
  this.next();
6529
6510
  var startPos = this.start, startLoc = this.startLoc;
6530
6511
  var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
6531
- var node2 = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
6512
+ var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
6532
6513
  if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) {
6533
6514
  this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
6534
6515
  }
6535
- return this.parseExprOp(node2, leftStartPos, leftStartLoc, minPrec, forInit);
6516
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit);
6536
6517
  }
6537
6518
  }
6538
6519
  return left;
@@ -6541,11 +6522,11 @@ pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
6541
6522
  if (right.type === "PrivateIdentifier") {
6542
6523
  this.raise(right.start, "Private identifier can only be left side of binary expression");
6543
6524
  }
6544
- var node2 = this.startNodeAt(startPos, startLoc);
6545
- node2.left = left;
6546
- node2.operator = op;
6547
- node2.right = right;
6548
- return this.finishNode(node2, logical ? "LogicalExpression" : "BinaryExpression");
6525
+ var node = this.startNodeAt(startPos, startLoc);
6526
+ node.left = left;
6527
+ node.operator = op;
6528
+ node.right = right;
6529
+ return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression");
6549
6530
  };
6550
6531
  pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
6551
6532
  var startPos = this.start, startLoc = this.startLoc, expr;
@@ -6553,22 +6534,22 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
6553
6534
  expr = this.parseAwait(forInit);
6554
6535
  sawUnary = true;
6555
6536
  } else if (this.type.prefix) {
6556
- var node2 = this.startNode(), update = this.type === types$1.incDec;
6557
- node2.operator = this.value;
6558
- node2.prefix = true;
6537
+ var node = this.startNode(), update = this.type === types$1.incDec;
6538
+ node.operator = this.value;
6539
+ node.prefix = true;
6559
6540
  this.next();
6560
- node2.argument = this.parseMaybeUnary(null, true, update, forInit);
6541
+ node.argument = this.parseMaybeUnary(null, true, update, forInit);
6561
6542
  this.checkExpressionErrors(refDestructuringErrors, true);
6562
6543
  if (update) {
6563
- this.checkLValSimple(node2.argument);
6564
- } else if (this.strict && node2.operator === "delete" && node2.argument.type === "Identifier") {
6565
- this.raiseRecoverable(node2.start, "Deleting local variable in strict mode");
6566
- } else if (node2.operator === "delete" && isPrivateFieldAccess(node2.argument)) {
6567
- this.raiseRecoverable(node2.start, "Private fields can not be deleted");
6544
+ this.checkLValSimple(node.argument);
6545
+ } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") {
6546
+ this.raiseRecoverable(node.start, "Deleting local variable in strict mode");
6547
+ } else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) {
6548
+ this.raiseRecoverable(node.start, "Private fields can not be deleted");
6568
6549
  } else {
6569
6550
  sawUnary = true;
6570
6551
  }
6571
- expr = this.finishNode(node2, update ? "UpdateExpression" : "UnaryExpression");
6552
+ expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
6572
6553
  } else if (!sawUnary && this.type === types$1.privateId) {
6573
6554
  if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) {
6574
6555
  this.unexpected();
@@ -6602,8 +6583,8 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
6602
6583
  return expr;
6603
6584
  }
6604
6585
  };
6605
- function isPrivateFieldAccess(node2) {
6606
- return node2.type === "MemberExpression" && node2.property.type === "PrivateIdentifier" || node2.type === "ChainExpression" && isPrivateFieldAccess(node2.expression);
6586
+ function isPrivateFieldAccess(node) {
6587
+ return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression);
6607
6588
  }
6608
6589
  pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
6609
6590
  var startPos = this.start, startLoc = this.startLoc;
@@ -6658,21 +6639,21 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
6658
6639
  }
6659
6640
  var computed = this.eat(types$1.bracketL);
6660
6641
  if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) {
6661
- var node2 = this.startNodeAt(startPos, startLoc);
6662
- node2.object = base;
6642
+ var node = this.startNodeAt(startPos, startLoc);
6643
+ node.object = base;
6663
6644
  if (computed) {
6664
- node2.property = this.parseExpression();
6645
+ node.property = this.parseExpression();
6665
6646
  this.expect(types$1.bracketR);
6666
6647
  } else if (this.type === types$1.privateId && base.type !== "Super") {
6667
- node2.property = this.parsePrivateIdent();
6648
+ node.property = this.parsePrivateIdent();
6668
6649
  } else {
6669
- node2.property = this.parseIdent(this.options.allowReserved !== "never");
6650
+ node.property = this.parseIdent(this.options.allowReserved !== "never");
6670
6651
  }
6671
- node2.computed = !!computed;
6652
+ node.computed = !!computed;
6672
6653
  if (optionalSupported) {
6673
- node2.optional = optional;
6654
+ node.optional = optional;
6674
6655
  }
6675
- base = this.finishNode(node2, "MemberExpression");
6656
+ base = this.finishNode(node, "MemberExpression");
6676
6657
  } else if (!noCalls && this.eat(types$1.parenL)) {
6677
6658
  var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
6678
6659
  this.yieldPos = 0;
@@ -6716,25 +6697,25 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
6716
6697
  if (this.type === types$1.slash) {
6717
6698
  this.readRegexp();
6718
6699
  }
6719
- var node2, canBeArrow = this.potentialArrowAt === this.start;
6700
+ var node, canBeArrow = this.potentialArrowAt === this.start;
6720
6701
  switch (this.type) {
6721
6702
  case types$1._super:
6722
6703
  if (!this.allowSuper) {
6723
6704
  this.raise(this.start, "'super' keyword outside a method");
6724
6705
  }
6725
- node2 = this.startNode();
6706
+ node = this.startNode();
6726
6707
  this.next();
6727
6708
  if (this.type === types$1.parenL && !this.allowDirectSuper) {
6728
- this.raise(node2.start, "super() call outside constructor of a subclass");
6709
+ this.raise(node.start, "super() call outside constructor of a subclass");
6729
6710
  }
6730
6711
  if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) {
6731
6712
  this.unexpected();
6732
6713
  }
6733
- return this.finishNode(node2, "Super");
6714
+ return this.finishNode(node, "Super");
6734
6715
  case types$1._this:
6735
- node2 = this.startNode();
6716
+ node = this.startNode();
6736
6717
  this.next();
6737
- return this.finishNode(node2, "ThisExpression");
6718
+ return this.finishNode(node, "ThisExpression");
6738
6719
  case types$1.name:
6739
6720
  var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
6740
6721
  var id = this.parseIdent(false);
@@ -6757,20 +6738,20 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
6757
6738
  return id;
6758
6739
  case types$1.regexp:
6759
6740
  var value = this.value;
6760
- node2 = this.parseLiteral(value.value);
6761
- node2.regex = { pattern: value.pattern, flags: value.flags };
6762
- return node2;
6741
+ node = this.parseLiteral(value.value);
6742
+ node.regex = { pattern: value.pattern, flags: value.flags };
6743
+ return node;
6763
6744
  case types$1.num:
6764
6745
  case types$1.string:
6765
6746
  return this.parseLiteral(this.value);
6766
6747
  case types$1._null:
6767
6748
  case types$1._true:
6768
6749
  case types$1._false:
6769
- node2 = this.startNode();
6770
- node2.value = this.type === types$1._null ? null : this.type === types$1._true;
6771
- node2.raw = this.type.keyword;
6750
+ node = this.startNode();
6751
+ node.value = this.type === types$1._null ? null : this.type === types$1._true;
6752
+ node.raw = this.type.keyword;
6772
6753
  this.next();
6773
- return this.finishNode(node2, "Literal");
6754
+ return this.finishNode(node, "Literal");
6774
6755
  case types$1.parenL:
6775
6756
  var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
6776
6757
  if (refDestructuringErrors) {
@@ -6783,17 +6764,17 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
6783
6764
  }
6784
6765
  return expr;
6785
6766
  case types$1.bracketL:
6786
- node2 = this.startNode();
6767
+ node = this.startNode();
6787
6768
  this.next();
6788
- node2.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
6789
- return this.finishNode(node2, "ArrayExpression");
6769
+ node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
6770
+ return this.finishNode(node, "ArrayExpression");
6790
6771
  case types$1.braceL:
6791
6772
  this.overrideContext(types.b_expr);
6792
6773
  return this.parseObj(false, refDestructuringErrors);
6793
6774
  case types$1._function:
6794
- node2 = this.startNode();
6775
+ node = this.startNode();
6795
6776
  this.next();
6796
- return this.parseFunction(node2, 0);
6777
+ return this.parseFunction(node, 0);
6797
6778
  case types$1._class:
6798
6779
  return this.parseClass(this.startNode(), false);
6799
6780
  case types$1._new:
@@ -6814,25 +6795,25 @@ pp$5.parseExprAtomDefault = function() {
6814
6795
  this.unexpected();
6815
6796
  };
6816
6797
  pp$5.parseExprImport = function(forNew) {
6817
- var node2 = this.startNode();
6798
+ var node = this.startNode();
6818
6799
  if (this.containsEsc) {
6819
6800
  this.raiseRecoverable(this.start, "Escape sequence in keyword import");
6820
6801
  }
6821
6802
  this.next();
6822
6803
  if (this.type === types$1.parenL && !forNew) {
6823
- return this.parseDynamicImport(node2);
6804
+ return this.parseDynamicImport(node);
6824
6805
  } else if (this.type === types$1.dot) {
6825
- var meta = this.startNodeAt(node2.start, node2.loc && node2.loc.start);
6806
+ var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
6826
6807
  meta.name = "import";
6827
- node2.meta = this.finishNode(meta, "Identifier");
6828
- return this.parseImportMeta(node2);
6808
+ node.meta = this.finishNode(meta, "Identifier");
6809
+ return this.parseImportMeta(node);
6829
6810
  } else {
6830
6811
  this.unexpected();
6831
6812
  }
6832
6813
  };
6833
- pp$5.parseDynamicImport = function(node2) {
6814
+ pp$5.parseDynamicImport = function(node) {
6834
6815
  this.next();
6835
- node2.source = this.parseMaybeAssign();
6816
+ node.source = this.parseMaybeAssign();
6836
6817
  if (!this.eat(types$1.parenR)) {
6837
6818
  var errorPos = this.start;
6838
6819
  if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
@@ -6841,32 +6822,32 @@ pp$5.parseDynamicImport = function(node2) {
6841
6822
  this.unexpected(errorPos);
6842
6823
  }
6843
6824
  }
6844
- return this.finishNode(node2, "ImportExpression");
6825
+ return this.finishNode(node, "ImportExpression");
6845
6826
  };
6846
- pp$5.parseImportMeta = function(node2) {
6827
+ pp$5.parseImportMeta = function(node) {
6847
6828
  this.next();
6848
6829
  var containsEsc = this.containsEsc;
6849
- node2.property = this.parseIdent(true);
6850
- if (node2.property.name !== "meta") {
6851
- this.raiseRecoverable(node2.property.start, "The only valid meta property for import is 'import.meta'");
6830
+ node.property = this.parseIdent(true);
6831
+ if (node.property.name !== "meta") {
6832
+ this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'");
6852
6833
  }
6853
6834
  if (containsEsc) {
6854
- this.raiseRecoverable(node2.start, "'import.meta' must not contain escaped characters");
6835
+ this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters");
6855
6836
  }
6856
6837
  if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) {
6857
- this.raiseRecoverable(node2.start, "Cannot use 'import.meta' outside a module");
6838
+ this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module");
6858
6839
  }
6859
- return this.finishNode(node2, "MetaProperty");
6840
+ return this.finishNode(node, "MetaProperty");
6860
6841
  };
6861
6842
  pp$5.parseLiteral = function(value) {
6862
- var node2 = this.startNode();
6863
- node2.value = value;
6864
- node2.raw = this.input.slice(this.start, this.end);
6865
- if (node2.raw.charCodeAt(node2.raw.length - 1) === 110) {
6866
- node2.bigint = node2.raw.slice(0, -1).replace(/_/g, "");
6843
+ var node = this.startNode();
6844
+ node.value = value;
6845
+ node.raw = this.input.slice(this.start, this.end);
6846
+ if (node.raw.charCodeAt(node.raw.length - 1) === 110) {
6847
+ node.bigint = node.raw.slice(0, -1).replace(/_/g, "");
6867
6848
  }
6868
6849
  this.next();
6869
- return this.finishNode(node2, "Literal");
6850
+ return this.finishNode(node, "Literal");
6870
6851
  };
6871
6852
  pp$5.parseParenExpression = function() {
6872
6853
  this.expect(types$1.parenL);
@@ -6952,34 +6933,34 @@ pp$5.parseNew = function() {
6952
6933
  if (this.containsEsc) {
6953
6934
  this.raiseRecoverable(this.start, "Escape sequence in keyword new");
6954
6935
  }
6955
- var node2 = this.startNode();
6936
+ var node = this.startNode();
6956
6937
  this.next();
6957
6938
  if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
6958
- var meta = this.startNodeAt(node2.start, node2.loc && node2.loc.start);
6939
+ var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
6959
6940
  meta.name = "new";
6960
- node2.meta = this.finishNode(meta, "Identifier");
6941
+ node.meta = this.finishNode(meta, "Identifier");
6961
6942
  this.next();
6962
6943
  var containsEsc = this.containsEsc;
6963
- node2.property = this.parseIdent(true);
6964
- if (node2.property.name !== "target") {
6965
- this.raiseRecoverable(node2.property.start, "The only valid meta property for new is 'new.target'");
6944
+ node.property = this.parseIdent(true);
6945
+ if (node.property.name !== "target") {
6946
+ this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'");
6966
6947
  }
6967
6948
  if (containsEsc) {
6968
- this.raiseRecoverable(node2.start, "'new.target' must not contain escaped characters");
6949
+ this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters");
6969
6950
  }
6970
6951
  if (!this.allowNewDotTarget) {
6971
- this.raiseRecoverable(node2.start, "'new.target' can only be used in functions and class static block");
6952
+ this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block");
6972
6953
  }
6973
- return this.finishNode(node2, "MetaProperty");
6954
+ return this.finishNode(node, "MetaProperty");
6974
6955
  }
6975
6956
  var startPos = this.start, startLoc = this.startLoc;
6976
- node2.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
6957
+ node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
6977
6958
  if (this.eat(types$1.parenL)) {
6978
- node2.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
6959
+ node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
6979
6960
  } else {
6980
- node2.arguments = empty;
6961
+ node.arguments = empty;
6981
6962
  }
6982
- return this.finishNode(node2, "NewExpression");
6963
+ return this.finishNode(node, "NewExpression");
6983
6964
  };
6984
6965
  pp$5.parseTemplateElement = function(ref2) {
6985
6966
  var isTagged = ref2.isTagged;
@@ -7008,29 +6989,29 @@ pp$5.parseTemplate = function(ref2) {
7008
6989
  var isTagged = ref2.isTagged;
7009
6990
  if (isTagged === void 0)
7010
6991
  isTagged = false;
7011
- var node2 = this.startNode();
6992
+ var node = this.startNode();
7012
6993
  this.next();
7013
- node2.expressions = [];
6994
+ node.expressions = [];
7014
6995
  var curElt = this.parseTemplateElement({ isTagged });
7015
- node2.quasis = [curElt];
6996
+ node.quasis = [curElt];
7016
6997
  while (!curElt.tail) {
7017
6998
  if (this.type === types$1.eof) {
7018
6999
  this.raise(this.pos, "Unterminated template literal");
7019
7000
  }
7020
7001
  this.expect(types$1.dollarBraceL);
7021
- node2.expressions.push(this.parseExpression());
7002
+ node.expressions.push(this.parseExpression());
7022
7003
  this.expect(types$1.braceR);
7023
- node2.quasis.push(curElt = this.parseTemplateElement({ isTagged }));
7004
+ node.quasis.push(curElt = this.parseTemplateElement({ isTagged }));
7024
7005
  }
7025
7006
  this.next();
7026
- return this.finishNode(node2, "TemplateLiteral");
7007
+ return this.finishNode(node, "TemplateLiteral");
7027
7008
  };
7028
7009
  pp$5.isAsyncProp = function(prop) {
7029
7010
  return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start));
7030
7011
  };
7031
7012
  pp$5.parseObj = function(isPattern, refDestructuringErrors) {
7032
- var node2 = this.startNode(), first = true, propHash = {};
7033
- node2.properties = [];
7013
+ var node = this.startNode(), first = true, propHash = {};
7014
+ node.properties = [];
7034
7015
  this.next();
7035
7016
  while (!this.eat(types$1.braceR)) {
7036
7017
  if (!first) {
@@ -7045,9 +7026,9 @@ pp$5.parseObj = function(isPattern, refDestructuringErrors) {
7045
7026
  if (!isPattern) {
7046
7027
  this.checkPropClash(prop, propHash, refDestructuringErrors);
7047
7028
  }
7048
- node2.properties.push(prop);
7029
+ node.properties.push(prop);
7049
7030
  }
7050
- return this.finishNode(node2, isPattern ? "ObjectPattern" : "ObjectExpression");
7031
+ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
7051
7032
  };
7052
7033
  pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
7053
7034
  var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
@@ -7162,67 +7143,67 @@ pp$5.parsePropertyName = function(prop) {
7162
7143
  }
7163
7144
  return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
7164
7145
  };
7165
- pp$5.initFunction = function(node2) {
7166
- node2.id = null;
7146
+ pp$5.initFunction = function(node) {
7147
+ node.id = null;
7167
7148
  if (this.options.ecmaVersion >= 6) {
7168
- node2.generator = node2.expression = false;
7149
+ node.generator = node.expression = false;
7169
7150
  }
7170
7151
  if (this.options.ecmaVersion >= 8) {
7171
- node2.async = false;
7152
+ node.async = false;
7172
7153
  }
7173
7154
  };
7174
7155
  pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
7175
- var node2 = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
7176
- this.initFunction(node2);
7156
+ var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
7157
+ this.initFunction(node);
7177
7158
  if (this.options.ecmaVersion >= 6) {
7178
- node2.generator = isGenerator;
7159
+ node.generator = isGenerator;
7179
7160
  }
7180
7161
  if (this.options.ecmaVersion >= 8) {
7181
- node2.async = !!isAsync;
7162
+ node.async = !!isAsync;
7182
7163
  }
7183
7164
  this.yieldPos = 0;
7184
7165
  this.awaitPos = 0;
7185
7166
  this.awaitIdentPos = 0;
7186
- this.enterScope(functionFlags(isAsync, node2.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
7167
+ this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
7187
7168
  this.expect(types$1.parenL);
7188
- node2.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
7169
+ node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
7189
7170
  this.checkYieldAwaitInDefaultParams();
7190
- this.parseFunctionBody(node2, false, true, false);
7171
+ this.parseFunctionBody(node, false, true, false);
7191
7172
  this.yieldPos = oldYieldPos;
7192
7173
  this.awaitPos = oldAwaitPos;
7193
7174
  this.awaitIdentPos = oldAwaitIdentPos;
7194
- return this.finishNode(node2, "FunctionExpression");
7175
+ return this.finishNode(node, "FunctionExpression");
7195
7176
  };
7196
- pp$5.parseArrowExpression = function(node2, params, isAsync, forInit) {
7177
+ pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
7197
7178
  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
7198
7179
  this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
7199
- this.initFunction(node2);
7180
+ this.initFunction(node);
7200
7181
  if (this.options.ecmaVersion >= 8) {
7201
- node2.async = !!isAsync;
7182
+ node.async = !!isAsync;
7202
7183
  }
7203
7184
  this.yieldPos = 0;
7204
7185
  this.awaitPos = 0;
7205
7186
  this.awaitIdentPos = 0;
7206
- node2.params = this.toAssignableList(params, true);
7207
- this.parseFunctionBody(node2, true, false, forInit);
7187
+ node.params = this.toAssignableList(params, true);
7188
+ this.parseFunctionBody(node, true, false, forInit);
7208
7189
  this.yieldPos = oldYieldPos;
7209
7190
  this.awaitPos = oldAwaitPos;
7210
7191
  this.awaitIdentPos = oldAwaitIdentPos;
7211
- return this.finishNode(node2, "ArrowFunctionExpression");
7192
+ return this.finishNode(node, "ArrowFunctionExpression");
7212
7193
  };
7213
- pp$5.parseFunctionBody = function(node2, isArrowFunction, isMethod, forInit) {
7194
+ pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
7214
7195
  var isExpression = isArrowFunction && this.type !== types$1.braceL;
7215
7196
  var oldStrict = this.strict, useStrict = false;
7216
7197
  if (isExpression) {
7217
- node2.body = this.parseMaybeAssign(forInit);
7218
- node2.expression = true;
7219
- this.checkParams(node2, false);
7198
+ node.body = this.parseMaybeAssign(forInit);
7199
+ node.expression = true;
7200
+ this.checkParams(node, false);
7220
7201
  } else {
7221
- var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node2.params);
7202
+ var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
7222
7203
  if (!oldStrict || nonSimple) {
7223
7204
  useStrict = this.strictDirective(this.end);
7224
7205
  if (useStrict && nonSimple) {
7225
- this.raiseRecoverable(node2.start, "Illegal 'use strict' directive in function with non-simple parameter list");
7206
+ this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list");
7226
7207
  }
7227
7208
  }
7228
7209
  var oldLabels = this.labels;
@@ -7230,13 +7211,13 @@ pp$5.parseFunctionBody = function(node2, isArrowFunction, isMethod, forInit) {
7230
7211
  if (useStrict) {
7231
7212
  this.strict = true;
7232
7213
  }
7233
- this.checkParams(node2, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node2.params));
7234
- if (this.strict && node2.id) {
7235
- this.checkLValSimple(node2.id, BIND_OUTSIDE);
7214
+ this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
7215
+ if (this.strict && node.id) {
7216
+ this.checkLValSimple(node.id, BIND_OUTSIDE);
7236
7217
  }
7237
- node2.body = this.parseBlock(false, void 0, useStrict && !oldStrict);
7238
- node2.expression = false;
7239
- this.adaptDirectivePrologue(node2.body.body);
7218
+ node.body = this.parseBlock(false, void 0, useStrict && !oldStrict);
7219
+ node.expression = false;
7220
+ this.adaptDirectivePrologue(node.body.body);
7240
7221
  this.labels = oldLabels;
7241
7222
  }
7242
7223
  this.exitScope();
@@ -7250,9 +7231,9 @@ pp$5.isSimpleParamList = function(params) {
7250
7231
  }
7251
7232
  return true;
7252
7233
  };
7253
- pp$5.checkParams = function(node2, allowDuplicates) {
7234
+ pp$5.checkParams = function(node, allowDuplicates) {
7254
7235
  var nameHash = /* @__PURE__ */ Object.create(null);
7255
- for (var i = 0, list = node2.params; i < list.length; i += 1) {
7236
+ for (var i = 0, list = node.params; i < list.length; i += 1) {
7256
7237
  var param = list[i];
7257
7238
  this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
7258
7239
  }
@@ -7314,73 +7295,73 @@ pp$5.checkUnreserved = function(ref2) {
7314
7295
  }
7315
7296
  };
7316
7297
  pp$5.parseIdent = function(liberal) {
7317
- var node2 = this.parseIdentNode();
7298
+ var node = this.parseIdentNode();
7318
7299
  this.next(!!liberal);
7319
- this.finishNode(node2, "Identifier");
7300
+ this.finishNode(node, "Identifier");
7320
7301
  if (!liberal) {
7321
- this.checkUnreserved(node2);
7322
- if (node2.name === "await" && !this.awaitIdentPos) {
7323
- this.awaitIdentPos = node2.start;
7302
+ this.checkUnreserved(node);
7303
+ if (node.name === "await" && !this.awaitIdentPos) {
7304
+ this.awaitIdentPos = node.start;
7324
7305
  }
7325
7306
  }
7326
- return node2;
7307
+ return node;
7327
7308
  };
7328
7309
  pp$5.parseIdentNode = function() {
7329
- var node2 = this.startNode();
7310
+ var node = this.startNode();
7330
7311
  if (this.type === types$1.name) {
7331
- node2.name = this.value;
7312
+ node.name = this.value;
7332
7313
  } else if (this.type.keyword) {
7333
- node2.name = this.type.keyword;
7334
- if ((node2.name === "class" || node2.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
7314
+ node.name = this.type.keyword;
7315
+ if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
7335
7316
  this.context.pop();
7336
7317
  }
7337
7318
  this.type = types$1.name;
7338
7319
  } else {
7339
7320
  this.unexpected();
7340
7321
  }
7341
- return node2;
7322
+ return node;
7342
7323
  };
7343
7324
  pp$5.parsePrivateIdent = function() {
7344
- var node2 = this.startNode();
7325
+ var node = this.startNode();
7345
7326
  if (this.type === types$1.privateId) {
7346
- node2.name = this.value;
7327
+ node.name = this.value;
7347
7328
  } else {
7348
7329
  this.unexpected();
7349
7330
  }
7350
7331
  this.next();
7351
- this.finishNode(node2, "PrivateIdentifier");
7332
+ this.finishNode(node, "PrivateIdentifier");
7352
7333
  if (this.options.checkPrivateFields) {
7353
7334
  if (this.privateNameStack.length === 0) {
7354
- this.raise(node2.start, "Private field '#" + node2.name + "' must be declared in an enclosing class");
7335
+ this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class");
7355
7336
  } else {
7356
- this.privateNameStack[this.privateNameStack.length - 1].used.push(node2);
7337
+ this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
7357
7338
  }
7358
7339
  }
7359
- return node2;
7340
+ return node;
7360
7341
  };
7361
7342
  pp$5.parseYield = function(forInit) {
7362
7343
  if (!this.yieldPos) {
7363
7344
  this.yieldPos = this.start;
7364
7345
  }
7365
- var node2 = this.startNode();
7346
+ var node = this.startNode();
7366
7347
  this.next();
7367
7348
  if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) {
7368
- node2.delegate = false;
7369
- node2.argument = null;
7349
+ node.delegate = false;
7350
+ node.argument = null;
7370
7351
  } else {
7371
- node2.delegate = this.eat(types$1.star);
7372
- node2.argument = this.parseMaybeAssign(forInit);
7352
+ node.delegate = this.eat(types$1.star);
7353
+ node.argument = this.parseMaybeAssign(forInit);
7373
7354
  }
7374
- return this.finishNode(node2, "YieldExpression");
7355
+ return this.finishNode(node, "YieldExpression");
7375
7356
  };
7376
7357
  pp$5.parseAwait = function(forInit) {
7377
7358
  if (!this.awaitPos) {
7378
7359
  this.awaitPos = this.start;
7379
7360
  }
7380
- var node2 = this.startNode();
7361
+ var node = this.startNode();
7381
7362
  this.next();
7382
- node2.argument = this.parseMaybeUnary(null, true, false, forInit);
7383
- return this.finishNode(node2, "AwaitExpression");
7363
+ node.argument = this.parseMaybeUnary(null, true, false, forInit);
7364
+ return this.finishNode(node, "AwaitExpression");
7384
7365
  };
7385
7366
  var pp$4 = Parser.prototype;
7386
7367
  pp$4.raise = function(pos, message) {
@@ -7500,27 +7481,27 @@ pp$2.startNode = function() {
7500
7481
  pp$2.startNodeAt = function(pos, loc) {
7501
7482
  return new Node(this, pos, loc);
7502
7483
  };
7503
- function finishNodeAt(node2, type, pos, loc) {
7504
- node2.type = type;
7505
- node2.end = pos;
7484
+ function finishNodeAt(node, type, pos, loc) {
7485
+ node.type = type;
7486
+ node.end = pos;
7506
7487
  if (this.options.locations) {
7507
- node2.loc.end = loc;
7488
+ node.loc.end = loc;
7508
7489
  }
7509
7490
  if (this.options.ranges) {
7510
- node2.range[1] = pos;
7491
+ node.range[1] = pos;
7511
7492
  }
7512
- return node2;
7493
+ return node;
7513
7494
  }
7514
- pp$2.finishNode = function(node2, type) {
7515
- return finishNodeAt.call(this, node2, type, this.lastTokEnd, this.lastTokEndLoc);
7495
+ pp$2.finishNode = function(node, type) {
7496
+ return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc);
7516
7497
  };
7517
- pp$2.finishNodeAt = function(node2, type, pos, loc) {
7518
- return finishNodeAt.call(this, node2, type, pos, loc);
7498
+ pp$2.finishNodeAt = function(node, type, pos, loc) {
7499
+ return finishNodeAt.call(this, node, type, pos, loc);
7519
7500
  };
7520
- pp$2.copyNode = function(node2) {
7521
- var newNode = new Node(this, node2.start, this.startLoc);
7522
- for (var prop in node2) {
7523
- newNode[prop] = node2[prop];
7501
+ pp$2.copyNode = function(node) {
7502
+ var newNode = new Node(this, node.start, this.startLoc);
7503
+ for (var prop in node) {
7504
+ newNode[prop] = node[prop];
7524
7505
  }
7525
7506
  return newNode;
7526
7507
  };
@@ -8114,14 +8095,14 @@ pp$1.regexp_eatAtomEscape = function(state) {
8114
8095
  pp$1.regexp_eatBackReference = function(state) {
8115
8096
  var start = state.pos;
8116
8097
  if (this.regexp_eatDecimalEscape(state)) {
8117
- var n = state.lastIntValue;
8098
+ var n2 = state.lastIntValue;
8118
8099
  if (state.switchU) {
8119
- if (n > state.maxBackReference) {
8120
- state.maxBackReference = n;
8100
+ if (n2 > state.maxBackReference) {
8101
+ state.maxBackReference = n2;
8121
8102
  }
8122
8103
  return true;
8123
8104
  }
8124
- if (n <= state.numCapturingParens) {
8105
+ if (n2 <= state.numCapturingParens) {
8125
8106
  return true;
8126
8107
  }
8127
8108
  state.pos = start;
@@ -9564,11 +9545,11 @@ pp.readEscapedChar = function(inTemplate) {
9564
9545
  };
9565
9546
  pp.readHexChar = function(len) {
9566
9547
  var codePos = this.pos;
9567
- var n = this.readInt(16, len);
9568
- if (n === null) {
9548
+ var n2 = this.readInt(16, len);
9549
+ if (n2 === null) {
9569
9550
  this.invalidStringToken(codePos, "Bad character escape sequence");
9570
9551
  }
9571
- return n;
9552
+ return n2;
9572
9553
  };
9573
9554
  pp.readWord1 = function() {
9574
9555
  this.containsEsc = false;
@@ -9630,14 +9611,15 @@ Parser.acorn = {
9630
9611
  nonASCIIwhitespace
9631
9612
  };
9632
9613
 
9633
- // node_modules/.pnpm/mlly@1.4.2/node_modules/mlly/dist/index.mjs
9614
+ // node_modules/.pnpm/mlly@1.5.0/node_modules/mlly/dist/index.mjs
9634
9615
  var import_node_module = require("module");
9635
9616
  var import_node_fs = __toESM(require("fs"), 1);
9636
9617
  var import_node_url = require("url");
9637
9618
 
9638
- // node_modules/.pnpm/ufo@1.3.2/node_modules/ufo/dist/index.mjs
9619
+ // node_modules/.pnpm/ufo@1.4.0/node_modules/ufo/dist/index.mjs
9639
9620
  var r = String.fromCharCode;
9640
9621
  var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
9622
+ var JOIN_LEADING_SLASH_RE = /^\.?\//;
9641
9623
  function hasTrailingSlash(input = "", respectQueryAndFragment) {
9642
9624
  if (!respectQueryAndFragment) {
9643
9625
  return input.endsWith("/");
@@ -9667,7 +9649,6 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
9667
9649
  function isNonEmptyURL(url) {
9668
9650
  return url && url !== "/";
9669
9651
  }
9670
- var JOIN_LEADING_SLASH_RE = /^\.?\//;
9671
9652
  function joinURL(base, ...input) {
9672
9653
  let url = base || "";
9673
9654
  for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
@@ -9680,6 +9661,7 @@ function joinURL(base, ...input) {
9680
9661
  }
9681
9662
  return url;
9682
9663
  }
9664
+ var protocolRelative = Symbol.for("ufo:protocolRelative");
9683
9665
 
9684
9666
  // node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.mjs
9685
9667
  var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
@@ -9687,7 +9669,7 @@ var isAbsolute = function(p) {
9687
9669
  return _IS_ABSOLUTE_RE.test(p);
9688
9670
  };
9689
9671
 
9690
- // node_modules/.pnpm/mlly@1.4.2/node_modules/mlly/dist/index.mjs
9672
+ // node_modules/.pnpm/mlly@1.5.0/node_modules/mlly/dist/index.mjs
9691
9673
  var import_node_assert = __toESM(require("assert"), 1);
9692
9674
  var import_node_process3 = __toESM(require("process"), 1);
9693
9675
  var import_node_path = __toESM(require("path"), 1);
@@ -9697,7 +9679,6 @@ var BUILTIN_MODULES = new Set(import_node_module.builtinModules);
9697
9679
  function normalizeSlash(string_) {
9698
9680
  return string_.replace(/\\/g, "/");
9699
9681
  }
9700
- var isWindows = import_node_process3.default.platform === "win32";
9701
9682
  var own$1 = {}.hasOwnProperty;
9702
9683
  var classRegExp = /^([A-Z][a-z\d]*)+$/;
9703
9684
  var kTypes = /* @__PURE__ */ new Set([
@@ -9843,10 +9824,10 @@ codes.ERR_MODULE_NOT_FOUND = createError(
9843
9824
  /**
9844
9825
  * @param {string} path
9845
9826
  * @param {string} base
9846
- * @param {string} [type]
9827
+ * @param {boolean} [exactUrl]
9847
9828
  */
9848
- (path4, base, type = "package") => {
9849
- return `Cannot find ${type} '${path4}' imported from ${base}`;
9829
+ (path4, base, exactUrl = false) => {
9830
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path4}' imported from ${base}`;
9850
9831
  },
9851
9832
  Error
9852
9833
  );
@@ -9916,24 +9897,6 @@ codes.ERR_INVALID_ARG_VALUE = createError(
9916
9897
  // Note: extra classes have been shaken out.
9917
9898
  // , RangeError
9918
9899
  );
9919
- codes.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError(
9920
- "ERR_UNSUPPORTED_ESM_URL_SCHEME",
9921
- /**
9922
- * @param {URL} url
9923
- * @param {Array<string>} supported
9924
- */
9925
- (url, supported) => {
9926
- let message = `Only URLs with a scheme in: ${formatList(
9927
- supported
9928
- )} are supported by the default ESM loader`;
9929
- if (isWindows && url.protocol.length === 2) {
9930
- message += ". On Windows, absolute paths must be valid file:// URLs";
9931
- }
9932
- message += `. Received protocol '${url.protocol}'`;
9933
- return message;
9934
- },
9935
- Error
9936
- );
9937
9900
  function createError(sym, value, def) {
9938
9901
  messages.set(sym, value);
9939
9902
  return makeNodeErrorWithCode(def, sym);
@@ -10051,96 +10014,98 @@ function determineSpecificType(value) {
10051
10014
  }
10052
10015
  return `type ${typeof value} (${inspected})`;
10053
10016
  }
10017
+ var hasOwnProperty$1 = {}.hasOwnProperty;
10018
+ var { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes;
10019
+ var cache = /* @__PURE__ */ new Map();
10054
10020
  var reader = { read };
10055
10021
  var packageJsonReader = reader;
10056
- function read(jsonPath) {
10057
- try {
10058
- const string = import_node_fs.default.readFileSync(
10059
- import_node_path.default.toNamespacedPath(import_node_path.default.join(import_node_path.default.dirname(jsonPath), "package.json")),
10060
- "utf8"
10061
- );
10062
- return { string };
10063
- } catch (error) {
10064
- const exception = (
10065
- /** @type {ErrnoException} */
10066
- error
10067
- );
10068
- if (exception.code === "ENOENT") {
10069
- return { string: void 0 };
10070
- }
10071
- throw exception;
10072
- }
10073
- }
10074
- var { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes;
10075
- var packageJsonCache = /* @__PURE__ */ new Map();
10076
- function getPackageConfig(path4, specifier, base) {
10077
- const existing = packageJsonCache.get(path4);
10078
- if (existing !== void 0) {
10022
+ function read(jsonPath, { base, specifier }) {
10023
+ const existing = cache.get(jsonPath);
10024
+ if (existing) {
10079
10025
  return existing;
10080
10026
  }
10081
- const source = packageJsonReader.read(path4).string;
10082
- if (source === void 0) {
10083
- const packageConfig2 = {
10084
- pjsonPath: path4,
10085
- exists: false,
10086
- main: void 0,
10087
- name: void 0,
10088
- type: "none",
10089
- exports: void 0,
10090
- imports: void 0
10091
- };
10092
- packageJsonCache.set(path4, packageConfig2);
10093
- return packageConfig2;
10094
- }
10095
- let packageJson;
10027
+ let string;
10096
10028
  try {
10097
- packageJson = JSON.parse(source);
10029
+ string = import_node_fs.default.readFileSync(import_node_path.default.toNamespacedPath(jsonPath), "utf8");
10098
10030
  } catch (error) {
10099
10031
  const exception = (
10100
10032
  /** @type {ErrnoException} */
10101
10033
  error
10102
10034
  );
10103
- throw new ERR_INVALID_PACKAGE_CONFIG$1(
10104
- path4,
10105
- (base ? `"${specifier}" from ` : "") + (0, import_node_url.fileURLToPath)(base || specifier),
10106
- exception.message
10107
- );
10035
+ if (exception.code !== "ENOENT") {
10036
+ throw exception;
10037
+ }
10108
10038
  }
10109
- const { exports, imports: imports2, main, name, type } = packageJson;
10110
- const packageConfig = {
10111
- pjsonPath: path4,
10112
- exists: true,
10113
- main: typeof main === "string" ? main : void 0,
10114
- name: typeof name === "string" ? name : void 0,
10115
- type: type === "module" || type === "commonjs" ? type : "none",
10116
- // @ts-expect-error Assume `Record<string, unknown>`.
10117
- exports,
10118
- // @ts-expect-error Assume `Record<string, unknown>`.
10119
- imports: imports2 && typeof imports2 === "object" ? imports2 : void 0
10039
+ const result = {
10040
+ exists: false,
10041
+ pjsonPath: jsonPath,
10042
+ main: void 0,
10043
+ name: void 0,
10044
+ type: "none",
10045
+ // Ignore unknown types for forwards compatibility
10046
+ exports: void 0,
10047
+ imports: void 0
10120
10048
  };
10121
- packageJsonCache.set(path4, packageConfig);
10122
- return packageConfig;
10049
+ if (string !== void 0) {
10050
+ let parsed;
10051
+ try {
10052
+ parsed = JSON.parse(string);
10053
+ } catch (error_) {
10054
+ const cause = (
10055
+ /** @type {ErrnoException} */
10056
+ error_
10057
+ );
10058
+ const error = new ERR_INVALID_PACKAGE_CONFIG$1(
10059
+ jsonPath,
10060
+ (base ? `"${specifier}" from ` : "") + (0, import_node_url.fileURLToPath)(base || specifier),
10061
+ cause.message
10062
+ );
10063
+ error.cause = cause;
10064
+ throw error;
10065
+ }
10066
+ result.exists = true;
10067
+ if (hasOwnProperty$1.call(parsed, "name") && typeof parsed.name === "string") {
10068
+ result.name = parsed.name;
10069
+ }
10070
+ if (hasOwnProperty$1.call(parsed, "main") && typeof parsed.main === "string") {
10071
+ result.main = parsed.main;
10072
+ }
10073
+ if (hasOwnProperty$1.call(parsed, "exports")) {
10074
+ result.exports = parsed.exports;
10075
+ }
10076
+ if (hasOwnProperty$1.call(parsed, "imports")) {
10077
+ result.imports = parsed.imports;
10078
+ }
10079
+ if (hasOwnProperty$1.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) {
10080
+ result.type = parsed.type;
10081
+ }
10082
+ }
10083
+ cache.set(jsonPath, result);
10084
+ return result;
10123
10085
  }
10124
10086
  function getPackageScopeConfig(resolved) {
10125
- let packageJsonUrl = new import_node_url.URL("package.json", resolved);
10087
+ let packageJSONUrl = new import_node_url.URL("package.json", resolved);
10126
10088
  while (true) {
10127
- const packageJsonPath2 = packageJsonUrl.pathname;
10128
- if (packageJsonPath2.endsWith("node_modules/package.json"))
10089
+ const packageJSONPath2 = packageJSONUrl.pathname;
10090
+ if (packageJSONPath2.endsWith("node_modules/package.json")) {
10129
10091
  break;
10130
- const packageConfig2 = getPackageConfig(
10131
- (0, import_node_url.fileURLToPath)(packageJsonUrl),
10132
- resolved
10092
+ }
10093
+ const packageConfig = packageJsonReader.read(
10094
+ (0, import_node_url.fileURLToPath)(packageJSONUrl),
10095
+ { specifier: resolved }
10133
10096
  );
10134
- if (packageConfig2.exists)
10135
- return packageConfig2;
10136
- const lastPackageJsonUrl = packageJsonUrl;
10137
- packageJsonUrl = new import_node_url.URL("../package.json", packageJsonUrl);
10138
- if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname)
10097
+ if (packageConfig.exists) {
10098
+ return packageConfig;
10099
+ }
10100
+ const lastPackageJSONUrl = packageJSONUrl;
10101
+ packageJSONUrl = new import_node_url.URL("../package.json", packageJSONUrl);
10102
+ if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
10139
10103
  break;
10104
+ }
10140
10105
  }
10141
- const packageJsonPath = (0, import_node_url.fileURLToPath)(packageJsonUrl);
10142
- const packageConfig = {
10143
- pjsonPath: packageJsonPath,
10106
+ const packageJSONPath = (0, import_node_url.fileURLToPath)(packageJSONUrl);
10107
+ return {
10108
+ pjsonPath: packageJSONPath,
10144
10109
  exists: false,
10145
10110
  main: void 0,
10146
10111
  name: void 0,
@@ -10148,8 +10113,6 @@ function getPackageScopeConfig(resolved) {
10148
10113
  exports: void 0,
10149
10114
  imports: void 0
10150
10115
  };
10151
- packageJsonCache.set(packageJsonPath, packageConfig);
10152
- return packageConfig;
10153
10116
  }
10154
10117
  function getPackageType(url) {
10155
10118
  const packageConfig = getPackageScopeConfig(url);
@@ -10206,7 +10169,18 @@ function extname2(url) {
10206
10169
  function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
10207
10170
  const ext = extname2(url);
10208
10171
  if (ext === ".js") {
10209
- return getPackageType(url) === "module" ? "module" : "commonjs";
10172
+ const packageType = getPackageType(url);
10173
+ if (packageType !== "none") {
10174
+ return packageType;
10175
+ }
10176
+ return "commonjs";
10177
+ }
10178
+ if (ext === "") {
10179
+ const packageType = getPackageType(url);
10180
+ if (packageType === "none" || packageType === "commonjs") {
10181
+ return "commonjs";
10182
+ }
10183
+ return "module";
10210
10184
  }
10211
10185
  const format3 = extensionFormatMap[ext];
10212
10186
  if (format3)
@@ -10220,10 +10194,11 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
10220
10194
  function getHttpProtocolModuleFormat() {
10221
10195
  }
10222
10196
  function defaultGetFormatWithoutErrors(url, context) {
10223
- if (!hasOwnProperty2.call(protocolHandlers, url.protocol)) {
10197
+ const protocol = url.protocol;
10198
+ if (!hasOwnProperty2.call(protocolHandlers, protocol)) {
10224
10199
  return null;
10225
10200
  }
10226
- return protocolHandlers[url.protocol](url, context, true) || null;
10201
+ return protocolHandlers[protocol](url, context, true) || null;
10227
10202
  }
10228
10203
  var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
10229
10204
  var {
@@ -10234,8 +10209,7 @@ var {
10234
10209
  ERR_MODULE_NOT_FOUND,
10235
10210
  ERR_PACKAGE_IMPORT_NOT_DEFINED,
10236
10211
  ERR_PACKAGE_PATH_NOT_EXPORTED,
10237
- ERR_UNSUPPORTED_DIR_IMPORT,
10238
- ERR_UNSUPPORTED_ESM_URL_SCHEME
10212
+ ERR_UNSUPPORTED_DIR_IMPORT
10239
10213
  } = codes;
10240
10214
  var own = {}.hasOwnProperty;
10241
10215
  var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
@@ -10246,6 +10220,9 @@ var encodedSepRegEx = /%2f|%5c/i;
10246
10220
  var emittedPackageWarnings = /* @__PURE__ */ new Set();
10247
10221
  var doubleSlashRegEx = /[/\\]{2}/;
10248
10222
  function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
10223
+ if (import_node_process3.default.noDeprecation) {
10224
+ return;
10225
+ }
10249
10226
  const pjsonPath = (0, import_node_url.fileURLToPath)(packageJsonUrl);
10250
10227
  const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
10251
10228
  import_node_process3.default.emitWarning(
@@ -10255,30 +10232,34 @@ function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, i
10255
10232
  );
10256
10233
  }
10257
10234
  function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
10235
+ if (import_node_process3.default.noDeprecation) {
10236
+ return;
10237
+ }
10258
10238
  const format3 = defaultGetFormatWithoutErrors(url, { parentURL: base.href });
10259
10239
  if (format3 !== "module")
10260
10240
  return;
10261
- const path4 = (0, import_node_url.fileURLToPath)(url.href);
10241
+ const urlPath = (0, import_node_url.fileURLToPath)(url.href);
10262
10242
  const pkgPath = (0, import_node_url.fileURLToPath)(new import_node_url.URL(".", packageJsonUrl));
10263
10243
  const basePath = (0, import_node_url.fileURLToPath)(base);
10264
- if (main)
10244
+ if (!main) {
10265
10245
  import_node_process3.default.emitWarning(
10266
- `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path4.slice(
10246
+ `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${urlPath.slice(
10267
10247
  pkgPath.length
10268
10248
  )}", imported from ${basePath}.
10269
- Automatic extension resolution of the "main" field isdeprecated for ES modules.`,
10249
+ Default "index" lookups for the main are deprecated for ES modules.`,
10270
10250
  "DeprecationWarning",
10271
10251
  "DEP0151"
10272
10252
  );
10273
- else
10253
+ } else if (import_node_path.default.resolve(pkgPath, main) !== urlPath) {
10274
10254
  import_node_process3.default.emitWarning(
10275
- `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path4.slice(
10255
+ `Package ${pkgPath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
10276
10256
  pkgPath.length
10277
10257
  )}", imported from ${basePath}.
10278
- Default "index" lookups for the main are deprecated for ES modules.`,
10258
+ Automatic extension resolution of the "main" field is deprecated for ES modules.`,
10279
10259
  "DeprecationWarning",
10280
10260
  "DEP0151"
10281
10261
  );
10262
+ }
10282
10263
  }
10283
10264
  function tryStatSync(path4) {
10284
10265
  try {
@@ -10341,13 +10322,25 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
10341
10322
  );
10342
10323
  }
10343
10324
  function finalizeResolution(resolved, base, preserveSymlinks) {
10344
- if (encodedSepRegEx.exec(resolved.pathname) !== null)
10325
+ if (encodedSepRegEx.exec(resolved.pathname) !== null) {
10345
10326
  throw new ERR_INVALID_MODULE_SPECIFIER(
10346
10327
  resolved.pathname,
10347
10328
  'must not include encoded "/" or "\\" characters',
10348
10329
  (0, import_node_url.fileURLToPath)(base)
10349
10330
  );
10350
- const filePath = (0, import_node_url.fileURLToPath)(resolved);
10331
+ }
10332
+ let filePath;
10333
+ try {
10334
+ filePath = (0, import_node_url.fileURLToPath)(resolved);
10335
+ } catch (error) {
10336
+ const cause = (
10337
+ /** @type {ErrnoException} */
10338
+ error
10339
+ );
10340
+ Object.defineProperty(cause, "input", { value: String(resolved) });
10341
+ Object.defineProperty(cause, "module", { value: String(base) });
10342
+ throw cause;
10343
+ }
10351
10344
  const stats = tryStatSync(
10352
10345
  filePath.endsWith("/") ? filePath.slice(-1) : filePath
10353
10346
  );
@@ -10357,11 +10350,13 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
10357
10350
  throw error;
10358
10351
  }
10359
10352
  if (!stats.isFile()) {
10360
- throw new ERR_MODULE_NOT_FOUND(
10353
+ const error = new ERR_MODULE_NOT_FOUND(
10361
10354
  filePath || resolved.pathname,
10362
10355
  base && (0, import_node_url.fileURLToPath)(base),
10363
- "module"
10356
+ true
10364
10357
  );
10358
+ error.url = String(resolved);
10359
+ throw error;
10365
10360
  }
10366
10361
  if (!preserveSymlinks) {
10367
10362
  const real = (0, import_node_fs.realpathSync)(filePath);
@@ -10604,12 +10599,12 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
10604
10599
  base
10605
10600
  );
10606
10601
  }
10607
- function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
10608
- if (typeof exports === "string" || Array.isArray(exports))
10602
+ function isConditionalExportsMainSugar(exports2, packageJsonUrl, base) {
10603
+ if (typeof exports2 === "string" || Array.isArray(exports2))
10609
10604
  return true;
10610
- if (typeof exports !== "object" || exports === null)
10605
+ if (typeof exports2 !== "object" || exports2 === null)
10611
10606
  return false;
10612
- const keys = Object.getOwnPropertyNames(exports);
10607
+ const keys = Object.getOwnPropertyNames(exports2);
10613
10608
  let isConditionalSugar = false;
10614
10609
  let i = 0;
10615
10610
  let j = -1;
@@ -10629,6 +10624,9 @@ function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
10629
10624
  return isConditionalSugar;
10630
10625
  }
10631
10626
  function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
10627
+ if (import_node_process3.default.noDeprecation) {
10628
+ return;
10629
+ }
10632
10630
  const pjsonPath = (0, import_node_url.fileURLToPath)(pjsonUrl);
10633
10631
  if (emittedPackageWarnings.has(pjsonPath + "|" + match))
10634
10632
  return;
@@ -10640,12 +10638,12 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
10640
10638
  );
10641
10639
  }
10642
10640
  function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
10643
- let exports = packageConfig.exports;
10644
- if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {
10645
- exports = { ".": exports };
10641
+ let exports2 = packageConfig.exports;
10642
+ if (isConditionalExportsMainSugar(exports2, packageJsonUrl, base)) {
10643
+ exports2 = { ".": exports2 };
10646
10644
  }
10647
- if (own.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
10648
- const target = exports[packageSubpath];
10645
+ if (own.call(exports2, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
10646
+ const target = exports2[packageSubpath];
10649
10647
  const resolveResult = resolvePackageTarget(
10650
10648
  packageJsonUrl,
10651
10649
  target,
@@ -10664,7 +10662,7 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
10664
10662
  }
10665
10663
  let bestMatch = "";
10666
10664
  let bestMatchSubpath = "";
10667
- const keys = Object.getOwnPropertyNames(exports);
10665
+ const keys = Object.getOwnPropertyNames(exports2);
10668
10666
  let i = -1;
10669
10667
  while (++i < keys.length) {
10670
10668
  const key = keys[i];
@@ -10690,7 +10688,7 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
10690
10688
  if (bestMatch) {
10691
10689
  const target = (
10692
10690
  /** @type {unknown} */
10693
- exports[bestMatch]
10691
+ exports2[bestMatch]
10694
10692
  );
10695
10693
  const resolveResult = resolvePackageTarget(
10696
10694
  packageJsonUrl,
@@ -10860,7 +10858,10 @@ function packageResolve(specifier, base, conditions) {
10860
10858
  packageJsonPath = (0, import_node_url.fileURLToPath)(packageJsonUrl);
10861
10859
  continue;
10862
10860
  }
10863
- const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base);
10861
+ const packageConfig2 = packageJsonReader.read(packageJsonPath, {
10862
+ base,
10863
+ specifier
10864
+ });
10864
10865
  if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
10865
10866
  return packageExportsResolve(
10866
10867
  packageJsonUrl,
@@ -10875,7 +10876,7 @@ function packageResolve(specifier, base, conditions) {
10875
10876
  }
10876
10877
  return new import_node_url.URL(packageSubpath, packageJsonUrl);
10877
10878
  } while (packageJsonPath.length !== lastPath.length);
10878
- throw new ERR_MODULE_NOT_FOUND(packageName, (0, import_node_url.fileURLToPath)(base));
10879
+ throw new ERR_MODULE_NOT_FOUND(packageName, (0, import_node_url.fileURLToPath)(base), false);
10879
10880
  }
10880
10881
  function isRelativeSpecifier(specifier) {
10881
10882
  if (specifier[0] === ".") {
@@ -11025,60 +11026,6 @@ function resolvePathSync(id, options) {
11025
11026
 
11026
11027
  // node_modules/.pnpm/local-pkg@0.5.0/node_modules/local-pkg/dist/index.mjs
11027
11028
  var import_node_url2 = require("url");
11028
- var Node3 = class {
11029
- constructor(value) {
11030
- __publicField(this, "value");
11031
- __publicField(this, "next");
11032
- this.value = value;
11033
- }
11034
- };
11035
- var _head, _tail, _size;
11036
- var Queue = class {
11037
- constructor() {
11038
- __privateAdd(this, _head, void 0);
11039
- __privateAdd(this, _tail, void 0);
11040
- __privateAdd(this, _size, void 0);
11041
- this.clear();
11042
- }
11043
- enqueue(value) {
11044
- const node2 = new Node3(value);
11045
- if (__privateGet(this, _head)) {
11046
- __privateGet(this, _tail).next = node2;
11047
- __privateSet(this, _tail, node2);
11048
- } else {
11049
- __privateSet(this, _head, node2);
11050
- __privateSet(this, _tail, node2);
11051
- }
11052
- __privateWrapper(this, _size)._++;
11053
- }
11054
- dequeue() {
11055
- const current2 = __privateGet(this, _head);
11056
- if (!current2) {
11057
- return;
11058
- }
11059
- __privateSet(this, _head, __privateGet(this, _head).next);
11060
- __privateWrapper(this, _size)._--;
11061
- return current2.value;
11062
- }
11063
- clear() {
11064
- __privateSet(this, _head, void 0);
11065
- __privateSet(this, _tail, void 0);
11066
- __privateSet(this, _size, 0);
11067
- }
11068
- get size() {
11069
- return __privateGet(this, _size);
11070
- }
11071
- *[Symbol.iterator]() {
11072
- let current2 = __privateGet(this, _head);
11073
- while (current2) {
11074
- yield current2.value;
11075
- current2 = current2.next;
11076
- }
11077
- }
11078
- };
11079
- _head = new WeakMap();
11080
- _tail = new WeakMap();
11081
- _size = new WeakMap();
11082
11029
  var findUpStop = Symbol("findUpStop");
11083
11030
  function _resolve2(path4, options = {}) {
11084
11031
  if (options.platform === "auto" || !options.platform)
@@ -11107,23 +11054,101 @@ function resolvePackage(name, options = {}) {
11107
11054
  }
11108
11055
  }
11109
11056
 
11110
- // src/configs/tailwind.ts
11111
- function tailwind() {
11057
+ // src/configs/antfu.ts
11058
+ var antfu = async () => {
11112
11059
  return [
11113
11060
  {
11114
- name: "jsse:tailwind",
11061
+ name: "jsse:antfu",
11115
11062
  plugins: {
11116
11063
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11117
- tailwindcss: import_eslint_plugin_tailwindcss.default
11064
+ antfu: import_eslint_plugin_antfu.default
11118
11065
  },
11119
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11120
11066
  rules: {
11121
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11122
- ...import_eslint_plugin_tailwindcss.default.configs.recommended.rules
11067
+ "antfu/no-import-node-modules-by-path": "error",
11068
+ "antfu/top-level-function": "error"
11069
+ }
11070
+ },
11071
+ {
11072
+ files: ["**/src/**/*"],
11073
+ name: "jsse:antfu:bin",
11074
+ rules: {
11075
+ "antfu/no-import-dist": "error"
11076
+ }
11077
+ },
11078
+ {
11079
+ files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
11080
+ name: "jsse:antfu:bin",
11081
+ rules: {
11082
+ "antfu/no-import-dist": "off",
11083
+ "antfu/no-import-node-modules-by-path": "off"
11123
11084
  }
11124
11085
  }
11125
11086
  ];
11126
- }
11087
+ };
11088
+
11089
+ // src/configs/md.ts
11090
+ var markdown = async (options) => {
11091
+ const { componentExts = [], overrides = {} } = options ?? {};
11092
+ const tsRulesOff = Object.fromEntries(
11093
+ // @ts-expect-error - undefined
11094
+ Object.keys(typescriptRulesTypeAware()).map((key) => [
11095
+ `@typescript-eslint/${key}`,
11096
+ "off"
11097
+ ])
11098
+ );
11099
+ return [
11100
+ {
11101
+ name: "jsse:markdown:setup",
11102
+ plugins: {
11103
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11104
+ markdown: import_eslint_plugin_markdown.default
11105
+ }
11106
+ },
11107
+ {
11108
+ files: [GLOB_MARKDOWN],
11109
+ name: "jsse:markdown:processor",
11110
+ processor: "markdown/markdown"
11111
+ },
11112
+ {
11113
+ files: [
11114
+ GLOB_MARKDOWN_CODE,
11115
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
11116
+ ],
11117
+ languageOptions: {
11118
+ parserOptions: {
11119
+ ecmaFeatures: {
11120
+ impliedStrict: true
11121
+ }
11122
+ }
11123
+ },
11124
+ name: "jsse:markdown:rules",
11125
+ rules: {
11126
+ "@typescript-eslint/consistent-type-imports": "off",
11127
+ "@typescript-eslint/no-namespace": "off",
11128
+ "@typescript-eslint/no-redeclare": "off",
11129
+ "@typescript-eslint/no-require-imports": "off",
11130
+ "@typescript-eslint/no-unused-vars": "off",
11131
+ "@typescript-eslint/no-use-before-define": "off",
11132
+ "@typescript-eslint/no-var-requires": "off",
11133
+ "no-alert": "off",
11134
+ "no-console": "off",
11135
+ "no-undef": "off",
11136
+ "no-unused-expressions": "off",
11137
+ "no-unused-vars": "off",
11138
+ "node/prefer-global/process": "off",
11139
+ // Type aware rules
11140
+ "object-curly-newline": "off",
11141
+ "style/comma-dangle": "off",
11142
+ "style/eol-last": "off",
11143
+ "unicode-bom": "off",
11144
+ "unused-imports/no-unused-imports": "off",
11145
+ "unused-imports/no-unused-vars": "off",
11146
+ ...tsRulesOff,
11147
+ ...overrides
11148
+ }
11149
+ }
11150
+ ];
11151
+ };
11127
11152
 
11128
11153
  // src/configs/stylistic.ts
11129
11154
  function jsxStylistic({
@@ -11142,8 +11167,8 @@ function jsxStylistic({
11142
11167
  "@stylistic/jsx-quotes": "error"
11143
11168
  };
11144
11169
  }
11145
- function stylistic(options = {}) {
11146
- const { indent = 2, jsx = true, quotes = "double" } = options;
11170
+ var stylistic = async (options) => {
11171
+ const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
11147
11172
  return [
11148
11173
  {
11149
11174
  name: "jsse:stylistic",
@@ -11162,7 +11187,78 @@ function stylistic(options = {}) {
11162
11187
  }
11163
11188
  }
11164
11189
  ];
11165
- }
11190
+ };
11191
+
11192
+ // src/configs/tailwind.ts
11193
+ var tailwind = async () => {
11194
+ return [
11195
+ {
11196
+ name: "jsse:tailwind",
11197
+ plugins: {
11198
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11199
+ tailwindcss: import_eslint_plugin_tailwindcss.default
11200
+ },
11201
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11202
+ rules: {
11203
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11204
+ ...import_eslint_plugin_tailwindcss.default.configs.recommended.rules
11205
+ }
11206
+ }
11207
+ ];
11208
+ };
11209
+
11210
+ // src/configs/yml.ts
11211
+ var yml = async (options) => {
11212
+ const {
11213
+ files = [GLOB_YAML],
11214
+ overrides = {},
11215
+ stylistic: stylistic2 = true
11216
+ } = options ?? {};
11217
+ const { indent = 2, quotes = "single" } = typeof stylistic2 === "boolean" ? {} : stylistic2;
11218
+ const [pluginYaml, parserYaml] = await Promise.all([
11219
+ interopDefault(import("eslint-plugin-yml")),
11220
+ interopDefault(import("yaml-eslint-parser"))
11221
+ ]);
11222
+ return [
11223
+ {
11224
+ name: "jsse:yaml:setup",
11225
+ plugins: {
11226
+ yaml: pluginYaml
11227
+ }
11228
+ },
11229
+ {
11230
+ files,
11231
+ languageOptions: {
11232
+ parser: parserYaml
11233
+ },
11234
+ name: "antfu:yaml:rules",
11235
+ rules: {
11236
+ "style/spaced-comment": "off",
11237
+ "yaml/block-mapping": "error",
11238
+ "yaml/block-sequence": "error",
11239
+ "yaml/no-empty-key": "error",
11240
+ "yaml/no-empty-sequence-entry": "error",
11241
+ "yaml/no-irregular-whitespace": "error",
11242
+ "yaml/plain-scalar": "error",
11243
+ "yaml/vue-custom-block/no-parsing-error": "error",
11244
+ ...stylistic2 ? {
11245
+ "yaml/block-mapping-question-indicator-newline": "error",
11246
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
11247
+ "yaml/flow-mapping-curly-newline": "error",
11248
+ "yaml/flow-mapping-curly-spacing": "error",
11249
+ "yaml/flow-sequence-bracket-newline": "error",
11250
+ "yaml/flow-sequence-bracket-spacing": "error",
11251
+ "yaml/indent": ["error", indent === "tab" ? 2 : indent],
11252
+ "yaml/key-spacing": "error",
11253
+ "yaml/no-tab-indent": "error",
11254
+ "yaml/quotes": ["error", { avoidEscape: false, prefer: quotes }],
11255
+ "yaml/spaced-comment": "error"
11256
+ } : {},
11257
+ ...overrides
11258
+ }
11259
+ }
11260
+ ];
11261
+ };
11166
11262
 
11167
11263
  // src/slow.ts
11168
11264
  var slowRules = [
@@ -11192,6 +11288,7 @@ function defaultOptions2() {
11192
11288
  gitignore: true,
11193
11289
  isInEditor: isInEditor(),
11194
11290
  jsonc: true,
11291
+ markdown: false,
11195
11292
  off: [],
11196
11293
  overrides: {},
11197
11294
  prettier: true,
@@ -11224,7 +11321,7 @@ function normalizeOptions(options = {}) {
11224
11321
  stylistic: stylisticOptions
11225
11322
  };
11226
11323
  }
11227
- function jsse(options = {}, ...userConfigs) {
11324
+ async function jsse(options = {}, ...userConfigs) {
11228
11325
  const normalizedOptions = normalizeOptions(options);
11229
11326
  const {
11230
11327
  componentExts,
@@ -11258,35 +11355,41 @@ function jsse(options = {}, ...userConfigs) {
11258
11355
  reportUnusedDisableDirectives
11259
11356
  }),
11260
11357
  comments(),
11261
- node(),
11262
- jsdoc({
11263
- stylistic: stylisticOptions
11264
- }),
11358
+ n(),
11359
+ jsdoc(),
11265
11360
  imports({
11266
11361
  stylistic: stylisticOptions
11267
11362
  }),
11268
11363
  unicorn(),
11364
+ antfu(),
11269
11365
  perfectionist()
11270
11366
  );
11271
11367
  if (enableTypeScript) {
11272
- configs.push(
11273
- typescript({
11274
- ...typeof enableTypeScript === "boolean" ? {} : enableTypeScript,
11275
- componentExts,
11276
- overrides: overrides.typescript,
11277
- prefix: {
11278
- from: "@typescript-eslint",
11279
- to: tsPrefix ?? "@typescript-eslint"
11280
- },
11281
- react: enableReact,
11282
- typeAware
11283
- })
11284
- );
11368
+ const tscfg = await typescript({
11369
+ ...typeof enableTypeScript === "boolean" ? {} : enableTypeScript,
11370
+ componentExts,
11371
+ overrides: overrides.typescript,
11372
+ prefix: {
11373
+ from: "@typescript-eslint",
11374
+ to: tsPrefix ?? "@typescript-eslint"
11375
+ },
11376
+ react: enableReact,
11377
+ typeAware
11378
+ });
11379
+ configs.push(tscfg);
11380
+ }
11381
+ if (normalizedOptions.markdown) {
11382
+ configs.push(markdown());
11383
+ }
11384
+ if (normalizedOptions.yaml) {
11385
+ const ymlConfig = await yml();
11386
+ configs.push(ymlConfig);
11285
11387
  }
11286
11388
  if (normalizedOptions.react) {
11287
11389
  configs.push(
11288
11390
  react({
11289
- reactRefresh: options.reactRefresh
11391
+ // use react refresh if not explicitly disabled w/ 'false'
11392
+ reactRefresh: normalizedOptions.reactRefresh !== false
11290
11393
  })
11291
11394
  );
11292
11395
  }
@@ -11298,7 +11401,7 @@ function jsse(options = {}, ...userConfigs) {
11298
11401
  }
11299
11402
  if (normalizedOptions.test) {
11300
11403
  configs.push(
11301
- test({
11404
+ await test({
11302
11405
  isInEditor: isInEditor2,
11303
11406
  overrides: overrides.test
11304
11407
  })
@@ -11336,7 +11439,15 @@ function jsse(options = {}, ...userConfigs) {
11336
11439
  }))
11337
11440
  );
11338
11441
  }
11339
- return combine(...configs, ...userConfigs);
11442
+ const combinedConfigs = await combineAsync(...configs, ...userConfigs);
11443
+ if (normalizedOptions.preReturn) {
11444
+ const preReturned = normalizedOptions.preReturn(combinedConfigs);
11445
+ if (preReturned instanceof Promise) {
11446
+ return await preReturned;
11447
+ }
11448
+ return preReturned;
11449
+ }
11450
+ return combinedConfigs;
11340
11451
  }
11341
11452
 
11342
11453
  // src/presets.ts
@@ -11378,10 +11489,12 @@ function jsseReact() {
11378
11489
  GLOB_TSX,
11379
11490
  GLOB_YAML,
11380
11491
  combine,
11492
+ combineAsync,
11381
11493
  comments,
11382
11494
  eslintConfigPrettierRules,
11383
11495
  ignores,
11384
11496
  imports,
11497
+ interopDefault,
11385
11498
  isCI,
11386
11499
  isInEditor,
11387
11500
  javascript,
@@ -11390,17 +11503,18 @@ function jsseReact() {
11390
11503
  jsse,
11391
11504
  jsseReact,
11392
11505
  jssestd,
11393
- node,
11506
+ n,
11394
11507
  parserJsonc,
11395
11508
  parserTs,
11396
11509
  perfectionist,
11510
+ pluginAntfu,
11397
11511
  pluginEslintComments,
11398
11512
  pluginImport,
11399
11513
  pluginJsdoc,
11400
11514
  pluginJsonc,
11401
11515
  pluginMarkdown,
11516
+ pluginN,
11402
11517
  pluginNoOnlyTests,
11403
- pluginNode,
11404
11518
  pluginPerfectionist,
11405
11519
  pluginReact,
11406
11520
  pluginReactHooks,