@jsse/eslint-config 0.1.2 → 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/README.md +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +658 -602
- package/dist/index.d.cts +40 -25
- package/dist/index.d.ts +40 -25
- package/dist/index.js +689 -635
- package/package.json +12 -7
package/dist/index.js
CHANGED
|
@@ -112,8 +112,8 @@ var require_sort_keys_fix = __commonJS({
|
|
|
112
112
|
const isValidOrder = isValidOrders[order + (insensitive ? "I" : "") + (natural ? "N" : "")];
|
|
113
113
|
const minKeys = Number(options && options.minKeys) || 2;
|
|
114
114
|
let stack = null;
|
|
115
|
-
const SpreadElement = (
|
|
116
|
-
if (
|
|
115
|
+
const SpreadElement = (node) => {
|
|
116
|
+
if (node.parent.type === "ObjectExpression") {
|
|
117
117
|
stack.prevName = null;
|
|
118
118
|
}
|
|
119
119
|
};
|
|
@@ -130,27 +130,27 @@ var require_sort_keys_fix = __commonJS({
|
|
|
130
130
|
"ObjectExpression:exit"() {
|
|
131
131
|
stack = stack.upper;
|
|
132
132
|
},
|
|
133
|
-
Property(
|
|
134
|
-
if (
|
|
133
|
+
Property(node) {
|
|
134
|
+
if (node.parent.type === "ObjectPattern") {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
if (
|
|
137
|
+
if (node.parent.properties.length < minKeys) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
const prevName = stack.prevName;
|
|
141
141
|
const prevNode = stack.prevNode;
|
|
142
|
-
const thisName = getPropertyName(
|
|
142
|
+
const thisName = getPropertyName(node);
|
|
143
143
|
if (thisName !== null) {
|
|
144
144
|
stack.prevName = thisName;
|
|
145
|
-
stack.prevNode =
|
|
145
|
+
stack.prevNode = node || prevNode;
|
|
146
146
|
}
|
|
147
147
|
if (prevName === null || thisName === null) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
if (!isValidOrder(prevName, thisName)) {
|
|
151
151
|
ctx.report({
|
|
152
|
-
node
|
|
153
|
-
loc:
|
|
152
|
+
node,
|
|
153
|
+
loc: node.key.loc,
|
|
154
154
|
messageId: "sortKeys",
|
|
155
155
|
data: {
|
|
156
156
|
thisName,
|
|
@@ -160,13 +160,13 @@ var require_sort_keys_fix = __commonJS({
|
|
|
160
160
|
natural: natural ? "natural " : ""
|
|
161
161
|
},
|
|
162
162
|
fix(fixer) {
|
|
163
|
-
if (
|
|
163
|
+
if (node.parent.__alreadySorted || node.parent.properties.__alreadySorted) {
|
|
164
164
|
return [];
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
node.parent.__alreadySorted = true;
|
|
167
|
+
node.parent.properties.__alreadySorted = true;
|
|
168
168
|
const src = ctx.getSourceCode();
|
|
169
|
-
const props =
|
|
169
|
+
const props = node.parent.properties;
|
|
170
170
|
const parts = [];
|
|
171
171
|
let part = [];
|
|
172
172
|
props.forEach((p) => {
|
|
@@ -237,21 +237,21 @@ var require_sort_keys_fix = __commonJS({
|
|
|
237
237
|
}
|
|
238
238
|
return fixes;
|
|
239
239
|
};
|
|
240
|
-
var findTokenPrevLine = (
|
|
241
|
-
let t = src.getTokenBefore(
|
|
240
|
+
var findTokenPrevLine = (node, src) => {
|
|
241
|
+
let t = src.getTokenBefore(node);
|
|
242
242
|
while (true) {
|
|
243
|
-
if (!t || t.range[0] <
|
|
243
|
+
if (!t || t.range[0] < node.parent.range[0]) {
|
|
244
244
|
return null;
|
|
245
245
|
}
|
|
246
|
-
if (t.loc.end.line <
|
|
246
|
+
if (t.loc.end.line < node.loc.start.line) {
|
|
247
247
|
return t;
|
|
248
248
|
}
|
|
249
249
|
t = src.getTokenBefore(t);
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var findCommaSameLine = (
|
|
253
|
-
const t = src.getTokenAfter(
|
|
254
|
-
return t && t.value === "," &&
|
|
252
|
+
var findCommaSameLine = (node, src) => {
|
|
253
|
+
const t = src.getTokenAfter(node);
|
|
254
|
+
return t && t.value === "," && node.loc.end.line === t.loc.start.line ? t : null;
|
|
255
255
|
};
|
|
256
256
|
var isValidOrders = {
|
|
257
257
|
asc: (a, b) => a <= b,
|
|
@@ -263,15 +263,15 @@ var require_sort_keys_fix = __commonJS({
|
|
|
263
263
|
descN: (a, b) => isValidOrders.ascN(b, a),
|
|
264
264
|
descIN: (a, b) => isValidOrders.ascIN(b, a)
|
|
265
265
|
};
|
|
266
|
-
var getPropertyName = (
|
|
266
|
+
var getPropertyName = (node) => {
|
|
267
267
|
let prop;
|
|
268
|
-
switch (
|
|
268
|
+
switch (node && node.type) {
|
|
269
269
|
case "Property":
|
|
270
270
|
case "MethodDefinition":
|
|
271
|
-
prop =
|
|
271
|
+
prop = node.key;
|
|
272
272
|
break;
|
|
273
273
|
case "MemberExpression":
|
|
274
|
-
prop =
|
|
274
|
+
prop = node.property;
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
switch (prop && prop.type) {
|
|
@@ -283,12 +283,12 @@ var require_sort_keys_fix = __commonJS({
|
|
|
283
283
|
}
|
|
284
284
|
break;
|
|
285
285
|
case "Identifier":
|
|
286
|
-
if (!
|
|
286
|
+
if (!node.computed) {
|
|
287
287
|
return prop.name;
|
|
288
288
|
}
|
|
289
289
|
break;
|
|
290
290
|
}
|
|
291
|
-
return
|
|
291
|
+
return node.key && node.key.name || null;
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
294
|
});
|
|
@@ -2320,41 +2320,40 @@ var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
|
|
|
2320
2320
|
import { default as default2 } from "@stylistic/eslint-plugin";
|
|
2321
2321
|
import { default as default3 } from "@typescript-eslint/eslint-plugin";
|
|
2322
2322
|
import * as parserTs from "@typescript-eslint/parser";
|
|
2323
|
-
import { default as default4 } from "eslint-plugin-
|
|
2323
|
+
import { default as default4 } from "eslint-plugin-antfu";
|
|
2324
|
+
import { default as default5 } from "eslint-plugin-eslint-comments";
|
|
2324
2325
|
import * as pluginImport from "eslint-plugin-i";
|
|
2325
|
-
import { default as
|
|
2326
|
+
import { default as default6 } from "eslint-plugin-jsdoc";
|
|
2326
2327
|
import * as pluginJsonc from "eslint-plugin-jsonc";
|
|
2327
|
-
import { default as
|
|
2328
|
-
import { default as
|
|
2329
|
-
import { default as
|
|
2330
|
-
import { default as
|
|
2328
|
+
import { default as default7 } from "eslint-plugin-markdown";
|
|
2329
|
+
import { default as default8 } from "eslint-plugin-n";
|
|
2330
|
+
import { default as default9 } from "eslint-plugin-no-only-tests";
|
|
2331
|
+
import { default as default10 } from "eslint-plugin-perfectionist";
|
|
2332
|
+
import { default as default11 } from "eslint-plugin-react";
|
|
2333
|
+
import { default as default12 } from "eslint-plugin-react-hooks";
|
|
2331
2334
|
import * as pluginReactRefresh from "eslint-plugin-react-refresh";
|
|
2332
|
-
import { default as
|
|
2333
|
-
import { default as
|
|
2334
|
-
import { default as
|
|
2335
|
-
import { default as
|
|
2336
|
-
import { default as
|
|
2337
|
-
import { default as default15 } from "eslint-plugin-markdown";
|
|
2338
|
-
import { default as default16 } from "eslint-plugin-perfectionist";
|
|
2335
|
+
import { default as default13 } from "eslint-plugin-tailwindcss";
|
|
2336
|
+
import { default as default14 } from "eslint-plugin-unicorn";
|
|
2337
|
+
import { default as default15 } from "eslint-plugin-unused-imports";
|
|
2338
|
+
import { default as default16 } from "eslint-plugin-vitest";
|
|
2339
|
+
import { default as default17 } from "jsonc-eslint-parser";
|
|
2339
2340
|
|
|
2340
2341
|
// src/configs/comments.ts
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
"eslint-comments/no-unused-enable": "error"
|
|
2354
|
-
}
|
|
2342
|
+
var comments = async () => [
|
|
2343
|
+
{
|
|
2344
|
+
name: "jsse:eslint-comments",
|
|
2345
|
+
plugins: {
|
|
2346
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2347
|
+
"eslint-comments": default5
|
|
2348
|
+
},
|
|
2349
|
+
rules: {
|
|
2350
|
+
"eslint-comments/no-aggregating-enable": "error",
|
|
2351
|
+
"eslint-comments/no-duplicate-disable": "error",
|
|
2352
|
+
"eslint-comments/no-unlimited-disable": "error",
|
|
2353
|
+
"eslint-comments/no-unused-enable": "error"
|
|
2355
2354
|
}
|
|
2356
|
-
|
|
2357
|
-
|
|
2355
|
+
}
|
|
2356
|
+
];
|
|
2358
2357
|
|
|
2359
2358
|
// src/globs.ts
|
|
2360
2359
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -2425,17 +2424,17 @@ var GLOB_EXCLUDE = [
|
|
|
2425
2424
|
];
|
|
2426
2425
|
|
|
2427
2426
|
// src/configs/ignores.ts
|
|
2428
|
-
|
|
2427
|
+
var ignores = async () => {
|
|
2429
2428
|
return [
|
|
2430
2429
|
{
|
|
2431
2430
|
ignores: GLOB_EXCLUDE
|
|
2432
2431
|
}
|
|
2433
2432
|
];
|
|
2434
|
-
}
|
|
2433
|
+
};
|
|
2435
2434
|
|
|
2436
2435
|
// src/configs/imports.ts
|
|
2437
|
-
|
|
2438
|
-
const { stylistic: stylistic2 = true } = options;
|
|
2436
|
+
var imports = async (options) => {
|
|
2437
|
+
const { stylistic: stylistic2 = true } = options ?? {};
|
|
2439
2438
|
return [
|
|
2440
2439
|
{
|
|
2441
2440
|
name: "jsse:imports",
|
|
@@ -2460,13 +2459,17 @@ function imports(options = {}) {
|
|
|
2460
2459
|
}
|
|
2461
2460
|
}
|
|
2462
2461
|
];
|
|
2463
|
-
}
|
|
2462
|
+
};
|
|
2464
2463
|
|
|
2465
2464
|
// src/configs/javascript.ts
|
|
2466
2465
|
var import_globals = __toESM(require_globals2(), 1);
|
|
2467
2466
|
import eslintjs from "@eslint/js";
|
|
2468
|
-
|
|
2469
|
-
const {
|
|
2467
|
+
var javascript = async (options) => {
|
|
2468
|
+
const {
|
|
2469
|
+
isInEditor: isInEditor2 = false,
|
|
2470
|
+
overrides = {},
|
|
2471
|
+
reportUnusedDisableDirectives = true
|
|
2472
|
+
} = options ?? {};
|
|
2470
2473
|
return [
|
|
2471
2474
|
{
|
|
2472
2475
|
languageOptions: {
|
|
@@ -2489,12 +2492,12 @@ function javascript(options = {}) {
|
|
|
2489
2492
|
sourceType: "module"
|
|
2490
2493
|
},
|
|
2491
2494
|
linterOptions: {
|
|
2492
|
-
reportUnusedDisableDirectives
|
|
2495
|
+
reportUnusedDisableDirectives
|
|
2493
2496
|
},
|
|
2494
2497
|
name: "jsse:javascript",
|
|
2495
2498
|
plugins: {
|
|
2496
2499
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2497
|
-
"unused-imports":
|
|
2500
|
+
"unused-imports": default15
|
|
2498
2501
|
},
|
|
2499
2502
|
rules: {
|
|
2500
2503
|
...eslintjs.configs.recommended.rules,
|
|
@@ -2717,16 +2720,16 @@ function javascript(options = {}) {
|
|
|
2717
2720
|
}
|
|
2718
2721
|
}
|
|
2719
2722
|
];
|
|
2720
|
-
}
|
|
2723
|
+
};
|
|
2721
2724
|
|
|
2722
2725
|
// src/configs/jsdoc.ts
|
|
2723
|
-
|
|
2726
|
+
var jsdoc = async () => {
|
|
2724
2727
|
return [
|
|
2725
2728
|
{
|
|
2726
2729
|
name: "jsse:jsdoc",
|
|
2727
2730
|
plugins: {
|
|
2728
2731
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2729
|
-
jsdoc:
|
|
2732
|
+
jsdoc: default6
|
|
2730
2733
|
},
|
|
2731
2734
|
rules: {
|
|
2732
2735
|
"jsdoc/check-access": "warn",
|
|
@@ -2749,11 +2752,11 @@ function jsdoc() {
|
|
|
2749
2752
|
}
|
|
2750
2753
|
}
|
|
2751
2754
|
];
|
|
2752
|
-
}
|
|
2755
|
+
};
|
|
2753
2756
|
|
|
2754
2757
|
// src/configs/jsonc.ts
|
|
2755
|
-
|
|
2756
|
-
const { overrides = {}, stylistic: stylistic2 = true } = options;
|
|
2758
|
+
var jsonc = async (options) => {
|
|
2759
|
+
const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
|
|
2757
2760
|
const { indent = 2 } = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
2758
2761
|
return [
|
|
2759
2762
|
{
|
|
@@ -2766,7 +2769,7 @@ function jsonc(options = {}) {
|
|
|
2766
2769
|
{
|
|
2767
2770
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
2768
2771
|
languageOptions: {
|
|
2769
|
-
parser:
|
|
2772
|
+
parser: default17
|
|
2770
2773
|
},
|
|
2771
2774
|
name: "jsse:jsonc:rules",
|
|
2772
2775
|
rules: {
|
|
@@ -2821,30 +2824,42 @@ function jsonc(options = {}) {
|
|
|
2821
2824
|
}
|
|
2822
2825
|
}
|
|
2823
2826
|
];
|
|
2824
|
-
}
|
|
2827
|
+
};
|
|
2825
2828
|
|
|
2826
2829
|
// src/configs/n.ts
|
|
2827
|
-
|
|
2830
|
+
var n = async () => {
|
|
2828
2831
|
return [
|
|
2829
2832
|
{
|
|
2830
2833
|
name: "jsse:n",
|
|
2831
2834
|
plugins: {
|
|
2832
2835
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2833
|
-
|
|
2836
|
+
n: default8
|
|
2834
2837
|
},
|
|
2835
2838
|
rules: {
|
|
2836
|
-
"
|
|
2837
|
-
"
|
|
2838
|
-
"
|
|
2839
|
-
"
|
|
2840
|
-
"
|
|
2841
|
-
"
|
|
2842
|
-
"
|
|
2843
|
-
"
|
|
2839
|
+
"n/handle-callback-err": ["error", "^(err|error)$"],
|
|
2840
|
+
"n/no-deprecated-api": "error",
|
|
2841
|
+
"n/no-exports-assign": "error",
|
|
2842
|
+
"n/no-new-require": "error",
|
|
2843
|
+
"n/no-path-concat": "error",
|
|
2844
|
+
"n/prefer-global/buffer": ["error", "never"],
|
|
2845
|
+
"n/prefer-global/process": ["error", "never"],
|
|
2846
|
+
"n/process-exit-as-throw": "error"
|
|
2844
2847
|
}
|
|
2845
2848
|
}
|
|
2846
2849
|
];
|
|
2847
|
-
}
|
|
2850
|
+
};
|
|
2851
|
+
|
|
2852
|
+
// src/configs/perfectionist.ts
|
|
2853
|
+
var perfectionist = async () => {
|
|
2854
|
+
return [
|
|
2855
|
+
{
|
|
2856
|
+
name: "jsse:perfectionist",
|
|
2857
|
+
plugins: {
|
|
2858
|
+
perfectionist: default10
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
];
|
|
2862
|
+
};
|
|
2848
2863
|
|
|
2849
2864
|
// src/configs/prettier.ts
|
|
2850
2865
|
function eslintConfigPrettierRules() {
|
|
@@ -2961,16 +2976,14 @@ function eslintConfigPrettierRules() {
|
|
|
2961
2976
|
"yield-star-spacing": "off"
|
|
2962
2977
|
};
|
|
2963
2978
|
}
|
|
2964
|
-
|
|
2979
|
+
var prettier = async () => {
|
|
2965
2980
|
return [
|
|
2966
2981
|
{
|
|
2967
2982
|
name: "jsse:prettier",
|
|
2968
|
-
rules:
|
|
2969
|
-
...eslintConfigPrettierRules()
|
|
2970
|
-
}
|
|
2983
|
+
rules: eslintConfigPrettierRules()
|
|
2971
2984
|
}
|
|
2972
2985
|
];
|
|
2973
|
-
}
|
|
2986
|
+
};
|
|
2974
2987
|
|
|
2975
2988
|
// src/configs/ts/typescript-language-options.ts
|
|
2976
2989
|
import process2 from "process";
|
|
@@ -3174,7 +3187,7 @@ function reactHooks() {
|
|
|
3174
3187
|
{
|
|
3175
3188
|
files: [GLOB_SRC],
|
|
3176
3189
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
3177
|
-
plugins: { "react-hooks":
|
|
3190
|
+
plugins: { "react-hooks": default12 },
|
|
3178
3191
|
rules: {
|
|
3179
3192
|
"react-hooks/exhaustive-deps": "error",
|
|
3180
3193
|
"react-hooks/rules-of-hooks": "error"
|
|
@@ -3229,7 +3242,7 @@ function reactRecomendedRules() {
|
|
|
3229
3242
|
"react/require-render-return": 2
|
|
3230
3243
|
};
|
|
3231
3244
|
}
|
|
3232
|
-
|
|
3245
|
+
var react = async (options) => {
|
|
3233
3246
|
const {
|
|
3234
3247
|
componentExts,
|
|
3235
3248
|
parserOptions = {},
|
|
@@ -3249,9 +3262,9 @@ function react(options) {
|
|
|
3249
3262
|
name: "jsse:react:setup",
|
|
3250
3263
|
plugins: {
|
|
3251
3264
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
3252
|
-
react:
|
|
3265
|
+
react: default11,
|
|
3253
3266
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
3254
|
-
"react-hooks":
|
|
3267
|
+
"react-hooks": default12
|
|
3255
3268
|
}
|
|
3256
3269
|
},
|
|
3257
3270
|
{
|
|
@@ -3260,7 +3273,7 @@ function react(options) {
|
|
|
3260
3273
|
rules: {
|
|
3261
3274
|
...reactRecomendedRules(),
|
|
3262
3275
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3263
|
-
...
|
|
3276
|
+
...default11.configs["jsx-runtime"].rules,
|
|
3264
3277
|
...reactRules()
|
|
3265
3278
|
},
|
|
3266
3279
|
settings: {
|
|
@@ -3274,10 +3287,10 @@ function react(options) {
|
|
|
3274
3287
|
config.push(...reactRefreshFlatConfigs());
|
|
3275
3288
|
}
|
|
3276
3289
|
return config;
|
|
3277
|
-
}
|
|
3290
|
+
};
|
|
3278
3291
|
|
|
3279
3292
|
// src/configs/sort.ts
|
|
3280
|
-
|
|
3293
|
+
var sortPackageJson = async () => {
|
|
3281
3294
|
return [
|
|
3282
3295
|
{
|
|
3283
3296
|
files: ["**/package.json"],
|
|
@@ -3360,8 +3373,8 @@ function sortPackageJson() {
|
|
|
3360
3373
|
}
|
|
3361
3374
|
}
|
|
3362
3375
|
];
|
|
3363
|
-
}
|
|
3364
|
-
|
|
3376
|
+
};
|
|
3377
|
+
var sortTsconfig = async () => {
|
|
3365
3378
|
return [
|
|
3366
3379
|
{
|
|
3367
3380
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
@@ -3485,7 +3498,7 @@ function sortTsconfig() {
|
|
|
3485
3498
|
}
|
|
3486
3499
|
}
|
|
3487
3500
|
];
|
|
3488
|
-
}
|
|
3501
|
+
};
|
|
3489
3502
|
|
|
3490
3503
|
// src/utils.ts
|
|
3491
3504
|
import process3 from "process";
|
|
@@ -3494,6 +3507,12 @@ function combine(...configs) {
|
|
|
3494
3507
|
(config) => Array.isArray(config) ? config : [config]
|
|
3495
3508
|
);
|
|
3496
3509
|
}
|
|
3510
|
+
async function combineAsync(...configs) {
|
|
3511
|
+
const resolved = await Promise.all(configs);
|
|
3512
|
+
return resolved.flatMap(
|
|
3513
|
+
(config) => Array.isArray(config) ? config : [config]
|
|
3514
|
+
);
|
|
3515
|
+
}
|
|
3497
3516
|
function renameRules(rules, from, to) {
|
|
3498
3517
|
if (from === to) {
|
|
3499
3518
|
return rules;
|
|
@@ -3519,14 +3538,14 @@ function isInEditor() {
|
|
|
3519
3538
|
}
|
|
3520
3539
|
|
|
3521
3540
|
// src/configs/test.ts
|
|
3522
|
-
|
|
3541
|
+
var test = async (options = {}) => {
|
|
3523
3542
|
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
3524
3543
|
return [
|
|
3525
3544
|
{
|
|
3526
3545
|
name: "jsse:test:setup",
|
|
3527
3546
|
plugins: {
|
|
3528
|
-
"no-only-tests":
|
|
3529
|
-
vitest:
|
|
3547
|
+
"no-only-tests": default9,
|
|
3548
|
+
vitest: default16
|
|
3530
3549
|
}
|
|
3531
3550
|
},
|
|
3532
3551
|
{
|
|
@@ -3546,7 +3565,7 @@ function test(options = {}) {
|
|
|
3546
3565
|
}
|
|
3547
3566
|
}
|
|
3548
3567
|
];
|
|
3549
|
-
}
|
|
3568
|
+
};
|
|
3550
3569
|
|
|
3551
3570
|
// src/configs/ts/typescript-rules.ts
|
|
3552
3571
|
function typescriptRulesTypeAware() {
|
|
@@ -4073,13 +4092,13 @@ function unicornOff() {
|
|
|
4073
4092
|
// Super insanely annoying rule
|
|
4074
4093
|
};
|
|
4075
4094
|
}
|
|
4076
|
-
|
|
4095
|
+
var unicorn = async () => {
|
|
4077
4096
|
return [
|
|
4078
4097
|
{
|
|
4079
4098
|
name: "jsse:unicorn",
|
|
4080
4099
|
plugins: {
|
|
4081
4100
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
4082
|
-
unicorn:
|
|
4101
|
+
unicorn: default14
|
|
4083
4102
|
},
|
|
4084
4103
|
rules: {
|
|
4085
4104
|
...unicornOff(),
|
|
@@ -4154,19 +4173,7 @@ function unicorn() {
|
|
|
4154
4173
|
}
|
|
4155
4174
|
}
|
|
4156
4175
|
];
|
|
4157
|
-
}
|
|
4158
|
-
|
|
4159
|
-
// src/configs/perfectionist.ts
|
|
4160
|
-
function perfectionist() {
|
|
4161
|
-
return [
|
|
4162
|
-
{
|
|
4163
|
-
name: "jsse:perfectionist",
|
|
4164
|
-
plugins: {
|
|
4165
|
-
perfectionist: default16
|
|
4166
|
-
}
|
|
4167
|
-
}
|
|
4168
|
-
];
|
|
4169
|
-
}
|
|
4176
|
+
};
|
|
4170
4177
|
|
|
4171
4178
|
// src/factory.ts
|
|
4172
4179
|
import fs2 from "fs";
|
|
@@ -4422,8 +4429,8 @@ var Position = function Position2(line, col) {
|
|
|
4422
4429
|
this.line = line;
|
|
4423
4430
|
this.column = col;
|
|
4424
4431
|
};
|
|
4425
|
-
Position.prototype.offset = function offset(
|
|
4426
|
-
return new Position(this.line, this.column +
|
|
4432
|
+
Position.prototype.offset = function offset(n2) {
|
|
4433
|
+
return new Position(this.line, this.column + n2);
|
|
4427
4434
|
};
|
|
4428
4435
|
var SourceLocation = function SourceLocation2(p, start, end) {
|
|
4429
4436
|
this.start = start;
|
|
@@ -4659,9 +4666,9 @@ var Parser = function Parser2(options, input, startPos) {
|
|
|
4659
4666
|
};
|
|
4660
4667
|
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 } };
|
|
4661
4668
|
Parser.prototype.parse = function parse() {
|
|
4662
|
-
var
|
|
4669
|
+
var node = this.options.program || this.startNode();
|
|
4663
4670
|
this.nextToken();
|
|
4664
|
-
return this.parseTopLevel(
|
|
4671
|
+
return this.parseTopLevel(node);
|
|
4665
4672
|
};
|
|
4666
4673
|
prototypeAccessors.inFunction.get = function() {
|
|
4667
4674
|
return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
|
|
@@ -4856,14 +4863,14 @@ pp$9.isSimpleAssignTarget = function(expr) {
|
|
|
4856
4863
|
return expr.type === "Identifier" || expr.type === "MemberExpression";
|
|
4857
4864
|
};
|
|
4858
4865
|
var pp$8 = Parser.prototype;
|
|
4859
|
-
pp$8.parseTopLevel = function(
|
|
4866
|
+
pp$8.parseTopLevel = function(node) {
|
|
4860
4867
|
var exports = /* @__PURE__ */ Object.create(null);
|
|
4861
|
-
if (!
|
|
4862
|
-
|
|
4868
|
+
if (!node.body) {
|
|
4869
|
+
node.body = [];
|
|
4863
4870
|
}
|
|
4864
4871
|
while (this.type !== types$1.eof) {
|
|
4865
4872
|
var stmt = this.parseStatement(null, true, exports);
|
|
4866
|
-
|
|
4873
|
+
node.body.push(stmt);
|
|
4867
4874
|
}
|
|
4868
4875
|
if (this.inModule) {
|
|
4869
4876
|
for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {
|
|
@@ -4871,10 +4878,10 @@ pp$8.parseTopLevel = function(node2) {
|
|
|
4871
4878
|
this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined");
|
|
4872
4879
|
}
|
|
4873
4880
|
}
|
|
4874
|
-
this.adaptDirectivePrologue(
|
|
4881
|
+
this.adaptDirectivePrologue(node.body);
|
|
4875
4882
|
this.next();
|
|
4876
|
-
|
|
4877
|
-
return this.finishNode(
|
|
4883
|
+
node.sourceType = this.options.sourceType;
|
|
4884
|
+
return this.finishNode(node, "Program");
|
|
4878
4885
|
};
|
|
4879
4886
|
var loopLabel = { kind: "loop" };
|
|
4880
4887
|
var switchLabel = { kind: "switch" };
|
|
@@ -4919,7 +4926,7 @@ pp$8.isAsyncFunction = function() {
|
|
|
4919
4926
|
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));
|
|
4920
4927
|
};
|
|
4921
4928
|
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
4922
|
-
var starttype = this.type,
|
|
4929
|
+
var starttype = this.type, node = this.startNode(), kind;
|
|
4923
4930
|
if (this.isLet(context)) {
|
|
4924
4931
|
starttype = types$1._var;
|
|
4925
4932
|
kind = "let";
|
|
@@ -4927,48 +4934,48 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
4927
4934
|
switch (starttype) {
|
|
4928
4935
|
case types$1._break:
|
|
4929
4936
|
case types$1._continue:
|
|
4930
|
-
return this.parseBreakContinueStatement(
|
|
4937
|
+
return this.parseBreakContinueStatement(node, starttype.keyword);
|
|
4931
4938
|
case types$1._debugger:
|
|
4932
|
-
return this.parseDebuggerStatement(
|
|
4939
|
+
return this.parseDebuggerStatement(node);
|
|
4933
4940
|
case types$1._do:
|
|
4934
|
-
return this.parseDoStatement(
|
|
4941
|
+
return this.parseDoStatement(node);
|
|
4935
4942
|
case types$1._for:
|
|
4936
|
-
return this.parseForStatement(
|
|
4943
|
+
return this.parseForStatement(node);
|
|
4937
4944
|
case types$1._function:
|
|
4938
4945
|
if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) {
|
|
4939
4946
|
this.unexpected();
|
|
4940
4947
|
}
|
|
4941
|
-
return this.parseFunctionStatement(
|
|
4948
|
+
return this.parseFunctionStatement(node, false, !context);
|
|
4942
4949
|
case types$1._class:
|
|
4943
4950
|
if (context) {
|
|
4944
4951
|
this.unexpected();
|
|
4945
4952
|
}
|
|
4946
|
-
return this.parseClass(
|
|
4953
|
+
return this.parseClass(node, true);
|
|
4947
4954
|
case types$1._if:
|
|
4948
|
-
return this.parseIfStatement(
|
|
4955
|
+
return this.parseIfStatement(node);
|
|
4949
4956
|
case types$1._return:
|
|
4950
|
-
return this.parseReturnStatement(
|
|
4957
|
+
return this.parseReturnStatement(node);
|
|
4951
4958
|
case types$1._switch:
|
|
4952
|
-
return this.parseSwitchStatement(
|
|
4959
|
+
return this.parseSwitchStatement(node);
|
|
4953
4960
|
case types$1._throw:
|
|
4954
|
-
return this.parseThrowStatement(
|
|
4961
|
+
return this.parseThrowStatement(node);
|
|
4955
4962
|
case types$1._try:
|
|
4956
|
-
return this.parseTryStatement(
|
|
4963
|
+
return this.parseTryStatement(node);
|
|
4957
4964
|
case types$1._const:
|
|
4958
4965
|
case types$1._var:
|
|
4959
4966
|
kind = kind || this.value;
|
|
4960
4967
|
if (context && kind !== "var") {
|
|
4961
4968
|
this.unexpected();
|
|
4962
4969
|
}
|
|
4963
|
-
return this.parseVarStatement(
|
|
4970
|
+
return this.parseVarStatement(node, kind);
|
|
4964
4971
|
case types$1._while:
|
|
4965
|
-
return this.parseWhileStatement(
|
|
4972
|
+
return this.parseWhileStatement(node);
|
|
4966
4973
|
case types$1._with:
|
|
4967
|
-
return this.parseWithStatement(
|
|
4974
|
+
return this.parseWithStatement(node);
|
|
4968
4975
|
case types$1.braceL:
|
|
4969
|
-
return this.parseBlock(true,
|
|
4976
|
+
return this.parseBlock(true, node);
|
|
4970
4977
|
case types$1.semi:
|
|
4971
|
-
return this.parseEmptyStatement(
|
|
4978
|
+
return this.parseEmptyStatement(node);
|
|
4972
4979
|
case types$1._export:
|
|
4973
4980
|
case types$1._import:
|
|
4974
4981
|
if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
|
|
@@ -4976,7 +4983,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
4976
4983
|
var skip = skipWhiteSpace.exec(this.input);
|
|
4977
4984
|
var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
|
|
4978
4985
|
if (nextCh === 40 || nextCh === 46) {
|
|
4979
|
-
return this.parseExpressionStatement(
|
|
4986
|
+
return this.parseExpressionStatement(node, this.parseExpression());
|
|
4980
4987
|
}
|
|
4981
4988
|
}
|
|
4982
4989
|
if (!this.options.allowImportExportEverywhere) {
|
|
@@ -4987,71 +4994,71 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
4987
4994
|
this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
|
4988
4995
|
}
|
|
4989
4996
|
}
|
|
4990
|
-
return starttype === types$1._import ? this.parseImport(
|
|
4997
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
|
|
4991
4998
|
default:
|
|
4992
4999
|
if (this.isAsyncFunction()) {
|
|
4993
5000
|
if (context) {
|
|
4994
5001
|
this.unexpected();
|
|
4995
5002
|
}
|
|
4996
5003
|
this.next();
|
|
4997
|
-
return this.parseFunctionStatement(
|
|
5004
|
+
return this.parseFunctionStatement(node, true, !context);
|
|
4998
5005
|
}
|
|
4999
5006
|
var maybeName = this.value, expr = this.parseExpression();
|
|
5000
5007
|
if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) {
|
|
5001
|
-
return this.parseLabeledStatement(
|
|
5008
|
+
return this.parseLabeledStatement(node, maybeName, expr, context);
|
|
5002
5009
|
} else {
|
|
5003
|
-
return this.parseExpressionStatement(
|
|
5010
|
+
return this.parseExpressionStatement(node, expr);
|
|
5004
5011
|
}
|
|
5005
5012
|
}
|
|
5006
5013
|
};
|
|
5007
|
-
pp$8.parseBreakContinueStatement = function(
|
|
5014
|
+
pp$8.parseBreakContinueStatement = function(node, keyword) {
|
|
5008
5015
|
var isBreak = keyword === "break";
|
|
5009
5016
|
this.next();
|
|
5010
5017
|
if (this.eat(types$1.semi) || this.insertSemicolon()) {
|
|
5011
|
-
|
|
5018
|
+
node.label = null;
|
|
5012
5019
|
} else if (this.type !== types$1.name) {
|
|
5013
5020
|
this.unexpected();
|
|
5014
5021
|
} else {
|
|
5015
|
-
|
|
5022
|
+
node.label = this.parseIdent();
|
|
5016
5023
|
this.semicolon();
|
|
5017
5024
|
}
|
|
5018
5025
|
var i = 0;
|
|
5019
5026
|
for (; i < this.labels.length; ++i) {
|
|
5020
5027
|
var lab = this.labels[i];
|
|
5021
|
-
if (
|
|
5028
|
+
if (node.label == null || lab.name === node.label.name) {
|
|
5022
5029
|
if (lab.kind != null && (isBreak || lab.kind === "loop")) {
|
|
5023
5030
|
break;
|
|
5024
5031
|
}
|
|
5025
|
-
if (
|
|
5032
|
+
if (node.label && isBreak) {
|
|
5026
5033
|
break;
|
|
5027
5034
|
}
|
|
5028
5035
|
}
|
|
5029
5036
|
}
|
|
5030
5037
|
if (i === this.labels.length) {
|
|
5031
|
-
this.raise(
|
|
5038
|
+
this.raise(node.start, "Unsyntactic " + keyword);
|
|
5032
5039
|
}
|
|
5033
|
-
return this.finishNode(
|
|
5040
|
+
return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
|
|
5034
5041
|
};
|
|
5035
|
-
pp$8.parseDebuggerStatement = function(
|
|
5042
|
+
pp$8.parseDebuggerStatement = function(node) {
|
|
5036
5043
|
this.next();
|
|
5037
5044
|
this.semicolon();
|
|
5038
|
-
return this.finishNode(
|
|
5045
|
+
return this.finishNode(node, "DebuggerStatement");
|
|
5039
5046
|
};
|
|
5040
|
-
pp$8.parseDoStatement = function(
|
|
5047
|
+
pp$8.parseDoStatement = function(node) {
|
|
5041
5048
|
this.next();
|
|
5042
5049
|
this.labels.push(loopLabel);
|
|
5043
|
-
|
|
5050
|
+
node.body = this.parseStatement("do");
|
|
5044
5051
|
this.labels.pop();
|
|
5045
5052
|
this.expect(types$1._while);
|
|
5046
|
-
|
|
5053
|
+
node.test = this.parseParenExpression();
|
|
5047
5054
|
if (this.options.ecmaVersion >= 6) {
|
|
5048
5055
|
this.eat(types$1.semi);
|
|
5049
5056
|
} else {
|
|
5050
5057
|
this.semicolon();
|
|
5051
5058
|
}
|
|
5052
|
-
return this.finishNode(
|
|
5059
|
+
return this.finishNode(node, "DoWhileStatement");
|
|
5053
5060
|
};
|
|
5054
|
-
pp$8.parseForStatement = function(
|
|
5061
|
+
pp$8.parseForStatement = function(node) {
|
|
5055
5062
|
this.next();
|
|
5056
5063
|
var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
5057
5064
|
this.labels.push(loopLabel);
|
|
@@ -5061,7 +5068,7 @@ pp$8.parseForStatement = function(node2) {
|
|
|
5061
5068
|
if (awaitAt > -1) {
|
|
5062
5069
|
this.unexpected(awaitAt);
|
|
5063
5070
|
}
|
|
5064
|
-
return this.parseFor(
|
|
5071
|
+
return this.parseFor(node, null);
|
|
5065
5072
|
}
|
|
5066
5073
|
var isLet = this.isLet();
|
|
5067
5074
|
if (this.type === types$1._var || this.type === types$1._const || isLet) {
|
|
@@ -5076,15 +5083,15 @@ pp$8.parseForStatement = function(node2) {
|
|
|
5076
5083
|
this.unexpected(awaitAt);
|
|
5077
5084
|
}
|
|
5078
5085
|
} else {
|
|
5079
|
-
|
|
5086
|
+
node.await = awaitAt > -1;
|
|
5080
5087
|
}
|
|
5081
5088
|
}
|
|
5082
|
-
return this.parseForIn(
|
|
5089
|
+
return this.parseForIn(node, init$1);
|
|
5083
5090
|
}
|
|
5084
5091
|
if (awaitAt > -1) {
|
|
5085
5092
|
this.unexpected(awaitAt);
|
|
5086
5093
|
}
|
|
5087
|
-
return this.parseFor(
|
|
5094
|
+
return this.parseFor(node, init$1);
|
|
5088
5095
|
}
|
|
5089
5096
|
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
5090
5097
|
var refDestructuringErrors = new DestructuringErrors();
|
|
@@ -5096,7 +5103,7 @@ pp$8.parseForStatement = function(node2) {
|
|
|
5096
5103
|
this.unexpected(awaitAt);
|
|
5097
5104
|
}
|
|
5098
5105
|
} else {
|
|
5099
|
-
|
|
5106
|
+
node.await = awaitAt > -1;
|
|
5100
5107
|
}
|
|
5101
5108
|
}
|
|
5102
5109
|
if (startsWithLet && isForOf) {
|
|
@@ -5104,43 +5111,43 @@ pp$8.parseForStatement = function(node2) {
|
|
|
5104
5111
|
}
|
|
5105
5112
|
this.toAssignable(init, false, refDestructuringErrors);
|
|
5106
5113
|
this.checkLValPattern(init);
|
|
5107
|
-
return this.parseForIn(
|
|
5114
|
+
return this.parseForIn(node, init);
|
|
5108
5115
|
} else {
|
|
5109
5116
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
5110
5117
|
}
|
|
5111
5118
|
if (awaitAt > -1) {
|
|
5112
5119
|
this.unexpected(awaitAt);
|
|
5113
5120
|
}
|
|
5114
|
-
return this.parseFor(
|
|
5121
|
+
return this.parseFor(node, init);
|
|
5115
5122
|
};
|
|
5116
|
-
pp$8.parseFunctionStatement = function(
|
|
5123
|
+
pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
|
|
5117
5124
|
this.next();
|
|
5118
|
-
return this.parseFunction(
|
|
5125
|
+
return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
|
|
5119
5126
|
};
|
|
5120
|
-
pp$8.parseIfStatement = function(
|
|
5127
|
+
pp$8.parseIfStatement = function(node) {
|
|
5121
5128
|
this.next();
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
return this.finishNode(
|
|
5129
|
+
node.test = this.parseParenExpression();
|
|
5130
|
+
node.consequent = this.parseStatement("if");
|
|
5131
|
+
node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
|
|
5132
|
+
return this.finishNode(node, "IfStatement");
|
|
5126
5133
|
};
|
|
5127
|
-
pp$8.parseReturnStatement = function(
|
|
5134
|
+
pp$8.parseReturnStatement = function(node) {
|
|
5128
5135
|
if (!this.inFunction && !this.options.allowReturnOutsideFunction) {
|
|
5129
5136
|
this.raise(this.start, "'return' outside of function");
|
|
5130
5137
|
}
|
|
5131
5138
|
this.next();
|
|
5132
5139
|
if (this.eat(types$1.semi) || this.insertSemicolon()) {
|
|
5133
|
-
|
|
5140
|
+
node.argument = null;
|
|
5134
5141
|
} else {
|
|
5135
|
-
|
|
5142
|
+
node.argument = this.parseExpression();
|
|
5136
5143
|
this.semicolon();
|
|
5137
5144
|
}
|
|
5138
|
-
return this.finishNode(
|
|
5145
|
+
return this.finishNode(node, "ReturnStatement");
|
|
5139
5146
|
};
|
|
5140
|
-
pp$8.parseSwitchStatement = function(
|
|
5147
|
+
pp$8.parseSwitchStatement = function(node) {
|
|
5141
5148
|
this.next();
|
|
5142
|
-
|
|
5143
|
-
|
|
5149
|
+
node.discriminant = this.parseParenExpression();
|
|
5150
|
+
node.cases = [];
|
|
5144
5151
|
this.expect(types$1.braceL);
|
|
5145
5152
|
this.labels.push(switchLabel);
|
|
5146
5153
|
this.enterScope(0);
|
|
@@ -5151,7 +5158,7 @@ pp$8.parseSwitchStatement = function(node2) {
|
|
|
5151
5158
|
if (cur) {
|
|
5152
5159
|
this.finishNode(cur, "SwitchCase");
|
|
5153
5160
|
}
|
|
5154
|
-
|
|
5161
|
+
node.cases.push(cur = this.startNode());
|
|
5155
5162
|
cur.consequent = [];
|
|
5156
5163
|
this.next();
|
|
5157
5164
|
if (isCase) {
|
|
@@ -5177,16 +5184,16 @@ pp$8.parseSwitchStatement = function(node2) {
|
|
|
5177
5184
|
}
|
|
5178
5185
|
this.next();
|
|
5179
5186
|
this.labels.pop();
|
|
5180
|
-
return this.finishNode(
|
|
5187
|
+
return this.finishNode(node, "SwitchStatement");
|
|
5181
5188
|
};
|
|
5182
|
-
pp$8.parseThrowStatement = function(
|
|
5189
|
+
pp$8.parseThrowStatement = function(node) {
|
|
5183
5190
|
this.next();
|
|
5184
5191
|
if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) {
|
|
5185
5192
|
this.raise(this.lastTokEnd, "Illegal newline after throw");
|
|
5186
5193
|
}
|
|
5187
|
-
|
|
5194
|
+
node.argument = this.parseExpression();
|
|
5188
5195
|
this.semicolon();
|
|
5189
|
-
return this.finishNode(
|
|
5196
|
+
return this.finishNode(node, "ThrowStatement");
|
|
5190
5197
|
};
|
|
5191
5198
|
var empty$1 = [];
|
|
5192
5199
|
pp$8.parseCatchClauseParam = function() {
|
|
@@ -5197,10 +5204,10 @@ pp$8.parseCatchClauseParam = function() {
|
|
|
5197
5204
|
this.expect(types$1.parenR);
|
|
5198
5205
|
return param;
|
|
5199
5206
|
};
|
|
5200
|
-
pp$8.parseTryStatement = function(
|
|
5207
|
+
pp$8.parseTryStatement = function(node) {
|
|
5201
5208
|
this.next();
|
|
5202
|
-
|
|
5203
|
-
|
|
5209
|
+
node.block = this.parseBlock();
|
|
5210
|
+
node.handler = null;
|
|
5204
5211
|
if (this.type === types$1._catch) {
|
|
5205
5212
|
var clause = this.startNode();
|
|
5206
5213
|
this.next();
|
|
@@ -5215,42 +5222,42 @@ pp$8.parseTryStatement = function(node2) {
|
|
|
5215
5222
|
}
|
|
5216
5223
|
clause.body = this.parseBlock(false);
|
|
5217
5224
|
this.exitScope();
|
|
5218
|
-
|
|
5225
|
+
node.handler = this.finishNode(clause, "CatchClause");
|
|
5219
5226
|
}
|
|
5220
|
-
|
|
5221
|
-
if (!
|
|
5222
|
-
this.raise(
|
|
5227
|
+
node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
|
|
5228
|
+
if (!node.handler && !node.finalizer) {
|
|
5229
|
+
this.raise(node.start, "Missing catch or finally clause");
|
|
5223
5230
|
}
|
|
5224
|
-
return this.finishNode(
|
|
5231
|
+
return this.finishNode(node, "TryStatement");
|
|
5225
5232
|
};
|
|
5226
|
-
pp$8.parseVarStatement = function(
|
|
5233
|
+
pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
|
|
5227
5234
|
this.next();
|
|
5228
|
-
this.parseVar(
|
|
5235
|
+
this.parseVar(node, false, kind, allowMissingInitializer);
|
|
5229
5236
|
this.semicolon();
|
|
5230
|
-
return this.finishNode(
|
|
5237
|
+
return this.finishNode(node, "VariableDeclaration");
|
|
5231
5238
|
};
|
|
5232
|
-
pp$8.parseWhileStatement = function(
|
|
5239
|
+
pp$8.parseWhileStatement = function(node) {
|
|
5233
5240
|
this.next();
|
|
5234
|
-
|
|
5241
|
+
node.test = this.parseParenExpression();
|
|
5235
5242
|
this.labels.push(loopLabel);
|
|
5236
|
-
|
|
5243
|
+
node.body = this.parseStatement("while");
|
|
5237
5244
|
this.labels.pop();
|
|
5238
|
-
return this.finishNode(
|
|
5245
|
+
return this.finishNode(node, "WhileStatement");
|
|
5239
5246
|
};
|
|
5240
|
-
pp$8.parseWithStatement = function(
|
|
5247
|
+
pp$8.parseWithStatement = function(node) {
|
|
5241
5248
|
if (this.strict) {
|
|
5242
5249
|
this.raise(this.start, "'with' in strict mode");
|
|
5243
5250
|
}
|
|
5244
5251
|
this.next();
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
return this.finishNode(
|
|
5252
|
+
node.object = this.parseParenExpression();
|
|
5253
|
+
node.body = this.parseStatement("with");
|
|
5254
|
+
return this.finishNode(node, "WithStatement");
|
|
5248
5255
|
};
|
|
5249
|
-
pp$8.parseEmptyStatement = function(
|
|
5256
|
+
pp$8.parseEmptyStatement = function(node) {
|
|
5250
5257
|
this.next();
|
|
5251
|
-
return this.finishNode(
|
|
5258
|
+
return this.finishNode(node, "EmptyStatement");
|
|
5252
5259
|
};
|
|
5253
|
-
pp$8.parseLabeledStatement = function(
|
|
5260
|
+
pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
|
|
5254
5261
|
for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) {
|
|
5255
5262
|
var label = list[i$1];
|
|
5256
5263
|
if (label.name === maybeName) {
|
|
@@ -5260,7 +5267,7 @@ pp$8.parseLabeledStatement = function(node2, maybeName, expr, context) {
|
|
|
5260
5267
|
var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
|
|
5261
5268
|
for (var i = this.labels.length - 1; i >= 0; i--) {
|
|
5262
5269
|
var label$1 = this.labels[i];
|
|
5263
|
-
if (label$1.statementStart ===
|
|
5270
|
+
if (label$1.statementStart === node.start) {
|
|
5264
5271
|
label$1.statementStart = this.start;
|
|
5265
5272
|
label$1.kind = kind;
|
|
5266
5273
|
} else {
|
|
@@ -5268,29 +5275,29 @@ pp$8.parseLabeledStatement = function(node2, maybeName, expr, context) {
|
|
|
5268
5275
|
}
|
|
5269
5276
|
}
|
|
5270
5277
|
this.labels.push({ name: maybeName, kind, statementStart: this.start });
|
|
5271
|
-
|
|
5278
|
+
node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
|
|
5272
5279
|
this.labels.pop();
|
|
5273
|
-
|
|
5274
|
-
return this.finishNode(
|
|
5280
|
+
node.label = expr;
|
|
5281
|
+
return this.finishNode(node, "LabeledStatement");
|
|
5275
5282
|
};
|
|
5276
|
-
pp$8.parseExpressionStatement = function(
|
|
5277
|
-
|
|
5283
|
+
pp$8.parseExpressionStatement = function(node, expr) {
|
|
5284
|
+
node.expression = expr;
|
|
5278
5285
|
this.semicolon();
|
|
5279
|
-
return this.finishNode(
|
|
5286
|
+
return this.finishNode(node, "ExpressionStatement");
|
|
5280
5287
|
};
|
|
5281
|
-
pp$8.parseBlock = function(createNewLexicalScope,
|
|
5288
|
+
pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
|
|
5282
5289
|
if (createNewLexicalScope === void 0)
|
|
5283
5290
|
createNewLexicalScope = true;
|
|
5284
|
-
if (
|
|
5285
|
-
|
|
5286
|
-
|
|
5291
|
+
if (node === void 0)
|
|
5292
|
+
node = this.startNode();
|
|
5293
|
+
node.body = [];
|
|
5287
5294
|
this.expect(types$1.braceL);
|
|
5288
5295
|
if (createNewLexicalScope) {
|
|
5289
5296
|
this.enterScope(0);
|
|
5290
5297
|
}
|
|
5291
5298
|
while (this.type !== types$1.braceR) {
|
|
5292
5299
|
var stmt = this.parseStatement(null);
|
|
5293
|
-
|
|
5300
|
+
node.body.push(stmt);
|
|
5294
5301
|
}
|
|
5295
5302
|
if (exitStrict) {
|
|
5296
5303
|
this.strict = false;
|
|
@@ -5299,21 +5306,21 @@ pp$8.parseBlock = function(createNewLexicalScope, node2, exitStrict) {
|
|
|
5299
5306
|
if (createNewLexicalScope) {
|
|
5300
5307
|
this.exitScope();
|
|
5301
5308
|
}
|
|
5302
|
-
return this.finishNode(
|
|
5309
|
+
return this.finishNode(node, "BlockStatement");
|
|
5303
5310
|
};
|
|
5304
|
-
pp$8.parseFor = function(
|
|
5305
|
-
|
|
5311
|
+
pp$8.parseFor = function(node, init) {
|
|
5312
|
+
node.init = init;
|
|
5306
5313
|
this.expect(types$1.semi);
|
|
5307
|
-
|
|
5314
|
+
node.test = this.type === types$1.semi ? null : this.parseExpression();
|
|
5308
5315
|
this.expect(types$1.semi);
|
|
5309
|
-
|
|
5316
|
+
node.update = this.type === types$1.parenR ? null : this.parseExpression();
|
|
5310
5317
|
this.expect(types$1.parenR);
|
|
5311
|
-
|
|
5318
|
+
node.body = this.parseStatement("for");
|
|
5312
5319
|
this.exitScope();
|
|
5313
5320
|
this.labels.pop();
|
|
5314
|
-
return this.finishNode(
|
|
5321
|
+
return this.finishNode(node, "ForStatement");
|
|
5315
5322
|
};
|
|
5316
|
-
pp$8.parseForIn = function(
|
|
5323
|
+
pp$8.parseForIn = function(node, init) {
|
|
5317
5324
|
var isForIn = this.type === types$1._in;
|
|
5318
5325
|
this.next();
|
|
5319
5326
|
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")) {
|
|
@@ -5322,17 +5329,17 @@ pp$8.parseForIn = function(node2, init) {
|
|
|
5322
5329
|
(isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
|
|
5323
5330
|
);
|
|
5324
5331
|
}
|
|
5325
|
-
|
|
5326
|
-
|
|
5332
|
+
node.left = init;
|
|
5333
|
+
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
|
|
5327
5334
|
this.expect(types$1.parenR);
|
|
5328
|
-
|
|
5335
|
+
node.body = this.parseStatement("for");
|
|
5329
5336
|
this.exitScope();
|
|
5330
5337
|
this.labels.pop();
|
|
5331
|
-
return this.finishNode(
|
|
5338
|
+
return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
|
|
5332
5339
|
};
|
|
5333
|
-
pp$8.parseVar = function(
|
|
5334
|
-
|
|
5335
|
-
|
|
5340
|
+
pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
5341
|
+
node.declarations = [];
|
|
5342
|
+
node.kind = kind;
|
|
5336
5343
|
for (; ; ) {
|
|
5337
5344
|
var decl = this.startNode();
|
|
5338
5345
|
this.parseVarId(decl, kind);
|
|
@@ -5345,12 +5352,12 @@ pp$8.parseVar = function(node2, isFor, kind, allowMissingInitializer) {
|
|
|
5345
5352
|
} else {
|
|
5346
5353
|
decl.init = null;
|
|
5347
5354
|
}
|
|
5348
|
-
|
|
5355
|
+
node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
|
|
5349
5356
|
if (!this.eat(types$1.comma)) {
|
|
5350
5357
|
break;
|
|
5351
5358
|
}
|
|
5352
5359
|
}
|
|
5353
|
-
return
|
|
5360
|
+
return node;
|
|
5354
5361
|
};
|
|
5355
5362
|
pp$8.parseVarId = function(decl, kind) {
|
|
5356
5363
|
decl.id = this.parseBindingAtom();
|
|
@@ -5359,56 +5366,56 @@ pp$8.parseVarId = function(decl, kind) {
|
|
|
5359
5366
|
var FUNC_STATEMENT = 1;
|
|
5360
5367
|
var FUNC_HANGING_STATEMENT = 2;
|
|
5361
5368
|
var FUNC_NULLABLE_ID = 4;
|
|
5362
|
-
pp$8.parseFunction = function(
|
|
5363
|
-
this.initFunction(
|
|
5369
|
+
pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
|
|
5370
|
+
this.initFunction(node);
|
|
5364
5371
|
if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
|
|
5365
5372
|
if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) {
|
|
5366
5373
|
this.unexpected();
|
|
5367
5374
|
}
|
|
5368
|
-
|
|
5375
|
+
node.generator = this.eat(types$1.star);
|
|
5369
5376
|
}
|
|
5370
5377
|
if (this.options.ecmaVersion >= 8) {
|
|
5371
|
-
|
|
5378
|
+
node.async = !!isAsync;
|
|
5372
5379
|
}
|
|
5373
5380
|
if (statement & FUNC_STATEMENT) {
|
|
5374
|
-
|
|
5375
|
-
if (
|
|
5376
|
-
this.checkLValSimple(
|
|
5381
|
+
node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent();
|
|
5382
|
+
if (node.id && !(statement & FUNC_HANGING_STATEMENT)) {
|
|
5383
|
+
this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION);
|
|
5377
5384
|
}
|
|
5378
5385
|
}
|
|
5379
5386
|
var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
|
|
5380
5387
|
this.yieldPos = 0;
|
|
5381
5388
|
this.awaitPos = 0;
|
|
5382
5389
|
this.awaitIdentPos = 0;
|
|
5383
|
-
this.enterScope(functionFlags(
|
|
5390
|
+
this.enterScope(functionFlags(node.async, node.generator));
|
|
5384
5391
|
if (!(statement & FUNC_STATEMENT)) {
|
|
5385
|
-
|
|
5392
|
+
node.id = this.type === types$1.name ? this.parseIdent() : null;
|
|
5386
5393
|
}
|
|
5387
|
-
this.parseFunctionParams(
|
|
5388
|
-
this.parseFunctionBody(
|
|
5394
|
+
this.parseFunctionParams(node);
|
|
5395
|
+
this.parseFunctionBody(node, allowExpressionBody, false, forInit);
|
|
5389
5396
|
this.yieldPos = oldYieldPos;
|
|
5390
5397
|
this.awaitPos = oldAwaitPos;
|
|
5391
5398
|
this.awaitIdentPos = oldAwaitIdentPos;
|
|
5392
|
-
return this.finishNode(
|
|
5399
|
+
return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression");
|
|
5393
5400
|
};
|
|
5394
|
-
pp$8.parseFunctionParams = function(
|
|
5401
|
+
pp$8.parseFunctionParams = function(node) {
|
|
5395
5402
|
this.expect(types$1.parenL);
|
|
5396
|
-
|
|
5403
|
+
node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
|
|
5397
5404
|
this.checkYieldAwaitInDefaultParams();
|
|
5398
5405
|
};
|
|
5399
|
-
pp$8.parseClass = function(
|
|
5406
|
+
pp$8.parseClass = function(node, isStatement) {
|
|
5400
5407
|
this.next();
|
|
5401
5408
|
var oldStrict = this.strict;
|
|
5402
5409
|
this.strict = true;
|
|
5403
|
-
this.parseClassId(
|
|
5404
|
-
this.parseClassSuper(
|
|
5410
|
+
this.parseClassId(node, isStatement);
|
|
5411
|
+
this.parseClassSuper(node);
|
|
5405
5412
|
var privateNameMap = this.enterClassBody();
|
|
5406
5413
|
var classBody = this.startNode();
|
|
5407
5414
|
var hadConstructor = false;
|
|
5408
5415
|
classBody.body = [];
|
|
5409
5416
|
this.expect(types$1.braceL);
|
|
5410
5417
|
while (this.type !== types$1.braceR) {
|
|
5411
|
-
var element = this.parseClassElement(
|
|
5418
|
+
var element = this.parseClassElement(node.superClass !== null);
|
|
5412
5419
|
if (element) {
|
|
5413
5420
|
classBody.body.push(element);
|
|
5414
5421
|
if (element.type === "MethodDefinition" && element.kind === "constructor") {
|
|
@@ -5423,16 +5430,16 @@ pp$8.parseClass = function(node2, isStatement) {
|
|
|
5423
5430
|
}
|
|
5424
5431
|
this.strict = oldStrict;
|
|
5425
5432
|
this.next();
|
|
5426
|
-
|
|
5433
|
+
node.body = this.finishNode(classBody, "ClassBody");
|
|
5427
5434
|
this.exitClassBody();
|
|
5428
|
-
return this.finishNode(
|
|
5435
|
+
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
|
|
5429
5436
|
};
|
|
5430
5437
|
pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
5431
5438
|
if (this.eat(types$1.semi)) {
|
|
5432
5439
|
return null;
|
|
5433
5440
|
}
|
|
5434
5441
|
var ecmaVersion = this.options.ecmaVersion;
|
|
5435
|
-
var
|
|
5442
|
+
var node = this.startNode();
|
|
5436
5443
|
var keyName = "";
|
|
5437
5444
|
var isGenerator = false;
|
|
5438
5445
|
var isAsync = false;
|
|
@@ -5440,8 +5447,8 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
|
5440
5447
|
var isStatic = false;
|
|
5441
5448
|
if (this.eatContextual("static")) {
|
|
5442
5449
|
if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
|
|
5443
|
-
this.parseClassStaticBlock(
|
|
5444
|
-
return
|
|
5450
|
+
this.parseClassStaticBlock(node);
|
|
5451
|
+
return node;
|
|
5445
5452
|
}
|
|
5446
5453
|
if (this.isClassElementNameStart() || this.type === types$1.star) {
|
|
5447
5454
|
isStatic = true;
|
|
@@ -5449,7 +5456,7 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
|
5449
5456
|
keyName = "static";
|
|
5450
5457
|
}
|
|
5451
5458
|
}
|
|
5452
|
-
|
|
5459
|
+
node.static = isStatic;
|
|
5453
5460
|
if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
|
|
5454
5461
|
if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
|
|
5455
5462
|
isAsync = true;
|
|
@@ -5471,25 +5478,25 @@ pp$8.parseClassElement = function(constructorAllowsSuper) {
|
|
|
5471
5478
|
}
|
|
5472
5479
|
}
|
|
5473
5480
|
if (keyName) {
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
this.finishNode(
|
|
5481
|
+
node.computed = false;
|
|
5482
|
+
node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
|
|
5483
|
+
node.key.name = keyName;
|
|
5484
|
+
this.finishNode(node.key, "Identifier");
|
|
5478
5485
|
} else {
|
|
5479
|
-
this.parseClassElementName(
|
|
5486
|
+
this.parseClassElementName(node);
|
|
5480
5487
|
}
|
|
5481
5488
|
if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
|
|
5482
|
-
var isConstructor = !
|
|
5489
|
+
var isConstructor = !node.static && checkKeyName(node, "constructor");
|
|
5483
5490
|
var allowsDirectSuper = isConstructor && constructorAllowsSuper;
|
|
5484
5491
|
if (isConstructor && kind !== "method") {
|
|
5485
|
-
this.raise(
|
|
5492
|
+
this.raise(node.key.start, "Constructor can't have get/set modifier");
|
|
5486
5493
|
}
|
|
5487
|
-
|
|
5488
|
-
this.parseClassMethod(
|
|
5494
|
+
node.kind = isConstructor ? "constructor" : kind;
|
|
5495
|
+
this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
|
|
5489
5496
|
} else {
|
|
5490
|
-
this.parseClassField(
|
|
5497
|
+
this.parseClassField(node);
|
|
5491
5498
|
}
|
|
5492
|
-
return
|
|
5499
|
+
return node;
|
|
5493
5500
|
};
|
|
5494
5501
|
pp$8.isClassElementNameStart = function() {
|
|
5495
5502
|
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;
|
|
@@ -5547,35 +5554,35 @@ pp$8.parseClassField = function(field) {
|
|
|
5547
5554
|
this.semicolon();
|
|
5548
5555
|
return this.finishNode(field, "PropertyDefinition");
|
|
5549
5556
|
};
|
|
5550
|
-
pp$8.parseClassStaticBlock = function(
|
|
5551
|
-
|
|
5557
|
+
pp$8.parseClassStaticBlock = function(node) {
|
|
5558
|
+
node.body = [];
|
|
5552
5559
|
var oldLabels = this.labels;
|
|
5553
5560
|
this.labels = [];
|
|
5554
5561
|
this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
|
|
5555
5562
|
while (this.type !== types$1.braceR) {
|
|
5556
5563
|
var stmt = this.parseStatement(null);
|
|
5557
|
-
|
|
5564
|
+
node.body.push(stmt);
|
|
5558
5565
|
}
|
|
5559
5566
|
this.next();
|
|
5560
5567
|
this.exitScope();
|
|
5561
5568
|
this.labels = oldLabels;
|
|
5562
|
-
return this.finishNode(
|
|
5569
|
+
return this.finishNode(node, "StaticBlock");
|
|
5563
5570
|
};
|
|
5564
|
-
pp$8.parseClassId = function(
|
|
5571
|
+
pp$8.parseClassId = function(node, isStatement) {
|
|
5565
5572
|
if (this.type === types$1.name) {
|
|
5566
|
-
|
|
5573
|
+
node.id = this.parseIdent();
|
|
5567
5574
|
if (isStatement) {
|
|
5568
|
-
this.checkLValSimple(
|
|
5575
|
+
this.checkLValSimple(node.id, BIND_LEXICAL, false);
|
|
5569
5576
|
}
|
|
5570
5577
|
} else {
|
|
5571
5578
|
if (isStatement === true) {
|
|
5572
5579
|
this.unexpected();
|
|
5573
5580
|
}
|
|
5574
|
-
|
|
5581
|
+
node.id = null;
|
|
5575
5582
|
}
|
|
5576
5583
|
};
|
|
5577
|
-
pp$8.parseClassSuper = function(
|
|
5578
|
-
|
|
5584
|
+
pp$8.parseClassSuper = function(node) {
|
|
5585
|
+
node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
|
|
5579
5586
|
};
|
|
5580
5587
|
pp$8.enterClassBody = function() {
|
|
5581
5588
|
var element = { declared: /* @__PURE__ */ Object.create(null), used: [] };
|
|
@@ -5619,57 +5626,57 @@ function isPrivateNameConflicted(privateNameMap, element) {
|
|
|
5619
5626
|
return true;
|
|
5620
5627
|
}
|
|
5621
5628
|
}
|
|
5622
|
-
function checkKeyName(
|
|
5623
|
-
var computed =
|
|
5624
|
-
var key =
|
|
5629
|
+
function checkKeyName(node, name) {
|
|
5630
|
+
var computed = node.computed;
|
|
5631
|
+
var key = node.key;
|
|
5625
5632
|
return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
|
|
5626
5633
|
}
|
|
5627
|
-
pp$8.parseExportAllDeclaration = function(
|
|
5634
|
+
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
5628
5635
|
if (this.options.ecmaVersion >= 11) {
|
|
5629
5636
|
if (this.eatContextual("as")) {
|
|
5630
|
-
|
|
5631
|
-
this.checkExport(exports,
|
|
5637
|
+
node.exported = this.parseModuleExportName();
|
|
5638
|
+
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
5632
5639
|
} else {
|
|
5633
|
-
|
|
5640
|
+
node.exported = null;
|
|
5634
5641
|
}
|
|
5635
5642
|
}
|
|
5636
5643
|
this.expectContextual("from");
|
|
5637
5644
|
if (this.type !== types$1.string) {
|
|
5638
5645
|
this.unexpected();
|
|
5639
5646
|
}
|
|
5640
|
-
|
|
5647
|
+
node.source = this.parseExprAtom();
|
|
5641
5648
|
this.semicolon();
|
|
5642
|
-
return this.finishNode(
|
|
5649
|
+
return this.finishNode(node, "ExportAllDeclaration");
|
|
5643
5650
|
};
|
|
5644
|
-
pp$8.parseExport = function(
|
|
5651
|
+
pp$8.parseExport = function(node, exports) {
|
|
5645
5652
|
this.next();
|
|
5646
5653
|
if (this.eat(types$1.star)) {
|
|
5647
|
-
return this.parseExportAllDeclaration(
|
|
5654
|
+
return this.parseExportAllDeclaration(node, exports);
|
|
5648
5655
|
}
|
|
5649
5656
|
if (this.eat(types$1._default)) {
|
|
5650
5657
|
this.checkExport(exports, "default", this.lastTokStart);
|
|
5651
|
-
|
|
5652
|
-
return this.finishNode(
|
|
5658
|
+
node.declaration = this.parseExportDefaultDeclaration();
|
|
5659
|
+
return this.finishNode(node, "ExportDefaultDeclaration");
|
|
5653
5660
|
}
|
|
5654
5661
|
if (this.shouldParseExportStatement()) {
|
|
5655
|
-
|
|
5656
|
-
if (
|
|
5657
|
-
this.checkVariableExport(exports,
|
|
5662
|
+
node.declaration = this.parseExportDeclaration(node);
|
|
5663
|
+
if (node.declaration.type === "VariableDeclaration") {
|
|
5664
|
+
this.checkVariableExport(exports, node.declaration.declarations);
|
|
5658
5665
|
} else {
|
|
5659
|
-
this.checkExport(exports,
|
|
5666
|
+
this.checkExport(exports, node.declaration.id, node.declaration.id.start);
|
|
5660
5667
|
}
|
|
5661
|
-
|
|
5662
|
-
|
|
5668
|
+
node.specifiers = [];
|
|
5669
|
+
node.source = null;
|
|
5663
5670
|
} else {
|
|
5664
|
-
|
|
5665
|
-
|
|
5671
|
+
node.declaration = null;
|
|
5672
|
+
node.specifiers = this.parseExportSpecifiers(exports);
|
|
5666
5673
|
if (this.eatContextual("from")) {
|
|
5667
5674
|
if (this.type !== types$1.string) {
|
|
5668
5675
|
this.unexpected();
|
|
5669
5676
|
}
|
|
5670
|
-
|
|
5677
|
+
node.source = this.parseExprAtom();
|
|
5671
5678
|
} else {
|
|
5672
|
-
for (var i = 0, list =
|
|
5679
|
+
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
|
|
5673
5680
|
var spec = list[i];
|
|
5674
5681
|
this.checkUnreserved(spec.local);
|
|
5675
5682
|
this.checkLocalExport(spec.local);
|
|
@@ -5677,13 +5684,13 @@ pp$8.parseExport = function(node2, exports) {
|
|
|
5677
5684
|
this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
5678
5685
|
}
|
|
5679
5686
|
}
|
|
5680
|
-
|
|
5687
|
+
node.source = null;
|
|
5681
5688
|
}
|
|
5682
5689
|
this.semicolon();
|
|
5683
5690
|
}
|
|
5684
|
-
return this.finishNode(
|
|
5691
|
+
return this.finishNode(node, "ExportNamedDeclaration");
|
|
5685
5692
|
};
|
|
5686
|
-
pp$8.parseExportDeclaration = function(
|
|
5693
|
+
pp$8.parseExportDeclaration = function(node) {
|
|
5687
5694
|
return this.parseStatement(null);
|
|
5688
5695
|
};
|
|
5689
5696
|
pp$8.parseExportDefaultDeclaration = function() {
|
|
@@ -5753,15 +5760,15 @@ pp$8.shouldParseExportStatement = function() {
|
|
|
5753
5760
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
5754
5761
|
};
|
|
5755
5762
|
pp$8.parseExportSpecifier = function(exports) {
|
|
5756
|
-
var
|
|
5757
|
-
|
|
5758
|
-
|
|
5763
|
+
var node = this.startNode();
|
|
5764
|
+
node.local = this.parseModuleExportName();
|
|
5765
|
+
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
5759
5766
|
this.checkExport(
|
|
5760
5767
|
exports,
|
|
5761
|
-
|
|
5762
|
-
|
|
5768
|
+
node.exported,
|
|
5769
|
+
node.exported.start
|
|
5763
5770
|
);
|
|
5764
|
-
return this.finishNode(
|
|
5771
|
+
return this.finishNode(node, "ExportSpecifier");
|
|
5765
5772
|
};
|
|
5766
5773
|
pp$8.parseExportSpecifiers = function(exports) {
|
|
5767
5774
|
var nodes = [], first = true;
|
|
@@ -5779,44 +5786,44 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
5779
5786
|
}
|
|
5780
5787
|
return nodes;
|
|
5781
5788
|
};
|
|
5782
|
-
pp$8.parseImport = function(
|
|
5789
|
+
pp$8.parseImport = function(node) {
|
|
5783
5790
|
this.next();
|
|
5784
5791
|
if (this.type === types$1.string) {
|
|
5785
|
-
|
|
5786
|
-
|
|
5792
|
+
node.specifiers = empty$1;
|
|
5793
|
+
node.source = this.parseExprAtom();
|
|
5787
5794
|
} else {
|
|
5788
|
-
|
|
5795
|
+
node.specifiers = this.parseImportSpecifiers();
|
|
5789
5796
|
this.expectContextual("from");
|
|
5790
|
-
|
|
5797
|
+
node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
|
|
5791
5798
|
}
|
|
5792
5799
|
this.semicolon();
|
|
5793
|
-
return this.finishNode(
|
|
5800
|
+
return this.finishNode(node, "ImportDeclaration");
|
|
5794
5801
|
};
|
|
5795
5802
|
pp$8.parseImportSpecifier = function() {
|
|
5796
|
-
var
|
|
5797
|
-
|
|
5803
|
+
var node = this.startNode();
|
|
5804
|
+
node.imported = this.parseModuleExportName();
|
|
5798
5805
|
if (this.eatContextual("as")) {
|
|
5799
|
-
|
|
5806
|
+
node.local = this.parseIdent();
|
|
5800
5807
|
} else {
|
|
5801
|
-
this.checkUnreserved(
|
|
5802
|
-
|
|
5808
|
+
this.checkUnreserved(node.imported);
|
|
5809
|
+
node.local = node.imported;
|
|
5803
5810
|
}
|
|
5804
|
-
this.checkLValSimple(
|
|
5805
|
-
return this.finishNode(
|
|
5811
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
5812
|
+
return this.finishNode(node, "ImportSpecifier");
|
|
5806
5813
|
};
|
|
5807
5814
|
pp$8.parseImportDefaultSpecifier = function() {
|
|
5808
|
-
var
|
|
5809
|
-
|
|
5810
|
-
this.checkLValSimple(
|
|
5811
|
-
return this.finishNode(
|
|
5815
|
+
var node = this.startNode();
|
|
5816
|
+
node.local = this.parseIdent();
|
|
5817
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
5818
|
+
return this.finishNode(node, "ImportDefaultSpecifier");
|
|
5812
5819
|
};
|
|
5813
5820
|
pp$8.parseImportNamespaceSpecifier = function() {
|
|
5814
|
-
var
|
|
5821
|
+
var node = this.startNode();
|
|
5815
5822
|
this.next();
|
|
5816
5823
|
this.expectContextual("as");
|
|
5817
|
-
|
|
5818
|
-
this.checkLValSimple(
|
|
5819
|
-
return this.finishNode(
|
|
5824
|
+
node.local = this.parseIdent();
|
|
5825
|
+
this.checkLValSimple(node.local, BIND_LEXICAL);
|
|
5826
|
+
return this.finishNode(node, "ImportNamespaceSpecifier");
|
|
5820
5827
|
};
|
|
5821
5828
|
pp$8.parseImportSpecifiers = function() {
|
|
5822
5829
|
var nodes = [], first = true;
|
|
@@ -5864,12 +5871,12 @@ pp$8.isDirectiveCandidate = function(statement) {
|
|
|
5864
5871
|
(this.input[statement.start] === '"' || this.input[statement.start] === "'");
|
|
5865
5872
|
};
|
|
5866
5873
|
var pp$7 = Parser.prototype;
|
|
5867
|
-
pp$7.toAssignable = function(
|
|
5868
|
-
if (this.options.ecmaVersion >= 6 &&
|
|
5869
|
-
switch (
|
|
5874
|
+
pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
|
|
5875
|
+
if (this.options.ecmaVersion >= 6 && node) {
|
|
5876
|
+
switch (node.type) {
|
|
5870
5877
|
case "Identifier":
|
|
5871
|
-
if (this.inAsync &&
|
|
5872
|
-
this.raise(
|
|
5878
|
+
if (this.inAsync && node.name === "await") {
|
|
5879
|
+
this.raise(node.start, "Cannot use 'await' as identifier inside an async function");
|
|
5873
5880
|
}
|
|
5874
5881
|
break;
|
|
5875
5882
|
case "ObjectPattern":
|
|
@@ -5878,11 +5885,11 @@ pp$7.toAssignable = function(node2, isBinding, refDestructuringErrors) {
|
|
|
5878
5885
|
case "RestElement":
|
|
5879
5886
|
break;
|
|
5880
5887
|
case "ObjectExpression":
|
|
5881
|
-
|
|
5888
|
+
node.type = "ObjectPattern";
|
|
5882
5889
|
if (refDestructuringErrors) {
|
|
5883
5890
|
this.checkPatternErrors(refDestructuringErrors, true);
|
|
5884
5891
|
}
|
|
5885
|
-
for (var i = 0, list =
|
|
5892
|
+
for (var i = 0, list = node.properties; i < list.length; i += 1) {
|
|
5886
5893
|
var prop = list[i];
|
|
5887
5894
|
this.toAssignable(prop, isBinding);
|
|
5888
5895
|
if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) {
|
|
@@ -5891,50 +5898,50 @@ pp$7.toAssignable = function(node2, isBinding, refDestructuringErrors) {
|
|
|
5891
5898
|
}
|
|
5892
5899
|
break;
|
|
5893
5900
|
case "Property":
|
|
5894
|
-
if (
|
|
5895
|
-
this.raise(
|
|
5901
|
+
if (node.kind !== "init") {
|
|
5902
|
+
this.raise(node.key.start, "Object pattern can't contain getter or setter");
|
|
5896
5903
|
}
|
|
5897
|
-
this.toAssignable(
|
|
5904
|
+
this.toAssignable(node.value, isBinding);
|
|
5898
5905
|
break;
|
|
5899
5906
|
case "ArrayExpression":
|
|
5900
|
-
|
|
5907
|
+
node.type = "ArrayPattern";
|
|
5901
5908
|
if (refDestructuringErrors) {
|
|
5902
5909
|
this.checkPatternErrors(refDestructuringErrors, true);
|
|
5903
5910
|
}
|
|
5904
|
-
this.toAssignableList(
|
|
5911
|
+
this.toAssignableList(node.elements, isBinding);
|
|
5905
5912
|
break;
|
|
5906
5913
|
case "SpreadElement":
|
|
5907
|
-
|
|
5908
|
-
this.toAssignable(
|
|
5909
|
-
if (
|
|
5910
|
-
this.raise(
|
|
5914
|
+
node.type = "RestElement";
|
|
5915
|
+
this.toAssignable(node.argument, isBinding);
|
|
5916
|
+
if (node.argument.type === "AssignmentPattern") {
|
|
5917
|
+
this.raise(node.argument.start, "Rest elements cannot have a default value");
|
|
5911
5918
|
}
|
|
5912
5919
|
break;
|
|
5913
5920
|
case "AssignmentExpression":
|
|
5914
|
-
if (
|
|
5915
|
-
this.raise(
|
|
5921
|
+
if (node.operator !== "=") {
|
|
5922
|
+
this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
|
|
5916
5923
|
}
|
|
5917
|
-
|
|
5918
|
-
delete
|
|
5919
|
-
this.toAssignable(
|
|
5924
|
+
node.type = "AssignmentPattern";
|
|
5925
|
+
delete node.operator;
|
|
5926
|
+
this.toAssignable(node.left, isBinding);
|
|
5920
5927
|
break;
|
|
5921
5928
|
case "ParenthesizedExpression":
|
|
5922
|
-
this.toAssignable(
|
|
5929
|
+
this.toAssignable(node.expression, isBinding, refDestructuringErrors);
|
|
5923
5930
|
break;
|
|
5924
5931
|
case "ChainExpression":
|
|
5925
|
-
this.raiseRecoverable(
|
|
5932
|
+
this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
|
|
5926
5933
|
break;
|
|
5927
5934
|
case "MemberExpression":
|
|
5928
5935
|
if (!isBinding) {
|
|
5929
5936
|
break;
|
|
5930
5937
|
}
|
|
5931
5938
|
default:
|
|
5932
|
-
this.raise(
|
|
5939
|
+
this.raise(node.start, "Assigning to rvalue");
|
|
5933
5940
|
}
|
|
5934
5941
|
} else if (refDestructuringErrors) {
|
|
5935
5942
|
this.checkPatternErrors(refDestructuringErrors, true);
|
|
5936
5943
|
}
|
|
5937
|
-
return
|
|
5944
|
+
return node;
|
|
5938
5945
|
};
|
|
5939
5946
|
pp$7.toAssignableList = function(exprList, isBinding) {
|
|
5940
5947
|
var end = exprList.length;
|
|
@@ -5953,28 +5960,28 @@ pp$7.toAssignableList = function(exprList, isBinding) {
|
|
|
5953
5960
|
return exprList;
|
|
5954
5961
|
};
|
|
5955
5962
|
pp$7.parseSpread = function(refDestructuringErrors) {
|
|
5956
|
-
var
|
|
5963
|
+
var node = this.startNode();
|
|
5957
5964
|
this.next();
|
|
5958
|
-
|
|
5959
|
-
return this.finishNode(
|
|
5965
|
+
node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
|
|
5966
|
+
return this.finishNode(node, "SpreadElement");
|
|
5960
5967
|
};
|
|
5961
5968
|
pp$7.parseRestBinding = function() {
|
|
5962
|
-
var
|
|
5969
|
+
var node = this.startNode();
|
|
5963
5970
|
this.next();
|
|
5964
5971
|
if (this.options.ecmaVersion === 6 && this.type !== types$1.name) {
|
|
5965
5972
|
this.unexpected();
|
|
5966
5973
|
}
|
|
5967
|
-
|
|
5968
|
-
return this.finishNode(
|
|
5974
|
+
node.argument = this.parseBindingAtom();
|
|
5975
|
+
return this.finishNode(node, "RestElement");
|
|
5969
5976
|
};
|
|
5970
5977
|
pp$7.parseBindingAtom = function() {
|
|
5971
5978
|
if (this.options.ecmaVersion >= 6) {
|
|
5972
5979
|
switch (this.type) {
|
|
5973
5980
|
case types$1.bracketL:
|
|
5974
|
-
var
|
|
5981
|
+
var node = this.startNode();
|
|
5975
5982
|
this.next();
|
|
5976
|
-
|
|
5977
|
-
return this.finishNode(
|
|
5983
|
+
node.elements = this.parseBindingList(types$1.bracketR, true, true);
|
|
5984
|
+
return this.finishNode(node, "ArrayPattern");
|
|
5978
5985
|
case types$1.braceL:
|
|
5979
5986
|
return this.parseObj(true);
|
|
5980
5987
|
}
|
|
@@ -6021,10 +6028,10 @@ pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
|
|
|
6021
6028
|
if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) {
|
|
6022
6029
|
return left;
|
|
6023
6030
|
}
|
|
6024
|
-
var
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
return this.finishNode(
|
|
6031
|
+
var node = this.startNodeAt(startPos, startLoc);
|
|
6032
|
+
node.left = left;
|
|
6033
|
+
node.right = this.parseMaybeAssign();
|
|
6034
|
+
return this.finishNode(node, "AssignmentPattern");
|
|
6028
6035
|
};
|
|
6029
6036
|
pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
|
|
6030
6037
|
if (bindingType === void 0)
|
|
@@ -6309,12 +6316,12 @@ pp$5.parseExpression = function(forInit, refDestructuringErrors) {
|
|
|
6309
6316
|
var startPos = this.start, startLoc = this.startLoc;
|
|
6310
6317
|
var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
|
|
6311
6318
|
if (this.type === types$1.comma) {
|
|
6312
|
-
var
|
|
6313
|
-
|
|
6319
|
+
var node = this.startNodeAt(startPos, startLoc);
|
|
6320
|
+
node.expressions = [expr];
|
|
6314
6321
|
while (this.eat(types$1.comma)) {
|
|
6315
|
-
|
|
6322
|
+
node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
|
|
6316
6323
|
}
|
|
6317
|
-
return this.finishNode(
|
|
6324
|
+
return this.finishNode(node, "SequenceExpression");
|
|
6318
6325
|
}
|
|
6319
6326
|
return expr;
|
|
6320
6327
|
};
|
|
@@ -6346,8 +6353,8 @@ pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse
|
|
|
6346
6353
|
left = afterLeftParse.call(this, left, startPos, startLoc);
|
|
6347
6354
|
}
|
|
6348
6355
|
if (this.type.isAssign) {
|
|
6349
|
-
var
|
|
6350
|
-
|
|
6356
|
+
var node = this.startNodeAt(startPos, startLoc);
|
|
6357
|
+
node.operator = this.value;
|
|
6351
6358
|
if (this.type === types$1.eq) {
|
|
6352
6359
|
left = this.toAssignable(left, false, refDestructuringErrors);
|
|
6353
6360
|
}
|
|
@@ -6362,13 +6369,13 @@ pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse
|
|
|
6362
6369
|
} else {
|
|
6363
6370
|
this.checkLValSimple(left);
|
|
6364
6371
|
}
|
|
6365
|
-
|
|
6372
|
+
node.left = left;
|
|
6366
6373
|
this.next();
|
|
6367
|
-
|
|
6374
|
+
node.right = this.parseMaybeAssign(forInit);
|
|
6368
6375
|
if (oldDoubleProto > -1) {
|
|
6369
6376
|
refDestructuringErrors.doubleProto = oldDoubleProto;
|
|
6370
6377
|
}
|
|
6371
|
-
return this.finishNode(
|
|
6378
|
+
return this.finishNode(node, "AssignmentExpression");
|
|
6372
6379
|
} else {
|
|
6373
6380
|
if (ownDestructuringErrors) {
|
|
6374
6381
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
@@ -6389,12 +6396,12 @@ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
|
|
|
6389
6396
|
return expr;
|
|
6390
6397
|
}
|
|
6391
6398
|
if (this.eat(types$1.question)) {
|
|
6392
|
-
var
|
|
6393
|
-
|
|
6394
|
-
|
|
6399
|
+
var node = this.startNodeAt(startPos, startLoc);
|
|
6400
|
+
node.test = expr;
|
|
6401
|
+
node.consequent = this.parseMaybeAssign();
|
|
6395
6402
|
this.expect(types$1.colon);
|
|
6396
|
-
|
|
6397
|
-
return this.finishNode(
|
|
6403
|
+
node.alternate = this.parseMaybeAssign(forInit);
|
|
6404
|
+
return this.finishNode(node, "ConditionalExpression");
|
|
6398
6405
|
}
|
|
6399
6406
|
return expr;
|
|
6400
6407
|
};
|
|
@@ -6419,11 +6426,11 @@ pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit)
|
|
|
6419
6426
|
this.next();
|
|
6420
6427
|
var startPos = this.start, startLoc = this.startLoc;
|
|
6421
6428
|
var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
|
|
6422
|
-
var
|
|
6429
|
+
var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
|
|
6423
6430
|
if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) {
|
|
6424
6431
|
this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
|
|
6425
6432
|
}
|
|
6426
|
-
return this.parseExprOp(
|
|
6433
|
+
return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit);
|
|
6427
6434
|
}
|
|
6428
6435
|
}
|
|
6429
6436
|
return left;
|
|
@@ -6432,11 +6439,11 @@ pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
|
|
|
6432
6439
|
if (right.type === "PrivateIdentifier") {
|
|
6433
6440
|
this.raise(right.start, "Private identifier can only be left side of binary expression");
|
|
6434
6441
|
}
|
|
6435
|
-
var
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
return this.finishNode(
|
|
6442
|
+
var node = this.startNodeAt(startPos, startLoc);
|
|
6443
|
+
node.left = left;
|
|
6444
|
+
node.operator = op;
|
|
6445
|
+
node.right = right;
|
|
6446
|
+
return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression");
|
|
6440
6447
|
};
|
|
6441
6448
|
pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
|
|
6442
6449
|
var startPos = this.start, startLoc = this.startLoc, expr;
|
|
@@ -6444,22 +6451,22 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
6444
6451
|
expr = this.parseAwait(forInit);
|
|
6445
6452
|
sawUnary = true;
|
|
6446
6453
|
} else if (this.type.prefix) {
|
|
6447
|
-
var
|
|
6448
|
-
|
|
6449
|
-
|
|
6454
|
+
var node = this.startNode(), update = this.type === types$1.incDec;
|
|
6455
|
+
node.operator = this.value;
|
|
6456
|
+
node.prefix = true;
|
|
6450
6457
|
this.next();
|
|
6451
|
-
|
|
6458
|
+
node.argument = this.parseMaybeUnary(null, true, update, forInit);
|
|
6452
6459
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
6453
6460
|
if (update) {
|
|
6454
|
-
this.checkLValSimple(
|
|
6455
|
-
} else if (this.strict &&
|
|
6456
|
-
this.raiseRecoverable(
|
|
6457
|
-
} else if (
|
|
6458
|
-
this.raiseRecoverable(
|
|
6461
|
+
this.checkLValSimple(node.argument);
|
|
6462
|
+
} else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") {
|
|
6463
|
+
this.raiseRecoverable(node.start, "Deleting local variable in strict mode");
|
|
6464
|
+
} else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) {
|
|
6465
|
+
this.raiseRecoverable(node.start, "Private fields can not be deleted");
|
|
6459
6466
|
} else {
|
|
6460
6467
|
sawUnary = true;
|
|
6461
6468
|
}
|
|
6462
|
-
expr = this.finishNode(
|
|
6469
|
+
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
|
|
6463
6470
|
} else if (!sawUnary && this.type === types$1.privateId) {
|
|
6464
6471
|
if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) {
|
|
6465
6472
|
this.unexpected();
|
|
@@ -6493,8 +6500,8 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
6493
6500
|
return expr;
|
|
6494
6501
|
}
|
|
6495
6502
|
};
|
|
6496
|
-
function isPrivateFieldAccess(
|
|
6497
|
-
return
|
|
6503
|
+
function isPrivateFieldAccess(node) {
|
|
6504
|
+
return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression);
|
|
6498
6505
|
}
|
|
6499
6506
|
pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
|
|
6500
6507
|
var startPos = this.start, startLoc = this.startLoc;
|
|
@@ -6549,21 +6556,21 @@ pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
|
|
|
6549
6556
|
}
|
|
6550
6557
|
var computed = this.eat(types$1.bracketL);
|
|
6551
6558
|
if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) {
|
|
6552
|
-
var
|
|
6553
|
-
|
|
6559
|
+
var node = this.startNodeAt(startPos, startLoc);
|
|
6560
|
+
node.object = base;
|
|
6554
6561
|
if (computed) {
|
|
6555
|
-
|
|
6562
|
+
node.property = this.parseExpression();
|
|
6556
6563
|
this.expect(types$1.bracketR);
|
|
6557
6564
|
} else if (this.type === types$1.privateId && base.type !== "Super") {
|
|
6558
|
-
|
|
6565
|
+
node.property = this.parsePrivateIdent();
|
|
6559
6566
|
} else {
|
|
6560
|
-
|
|
6567
|
+
node.property = this.parseIdent(this.options.allowReserved !== "never");
|
|
6561
6568
|
}
|
|
6562
|
-
|
|
6569
|
+
node.computed = !!computed;
|
|
6563
6570
|
if (optionalSupported) {
|
|
6564
|
-
|
|
6571
|
+
node.optional = optional;
|
|
6565
6572
|
}
|
|
6566
|
-
base = this.finishNode(
|
|
6573
|
+
base = this.finishNode(node, "MemberExpression");
|
|
6567
6574
|
} else if (!noCalls && this.eat(types$1.parenL)) {
|
|
6568
6575
|
var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
|
|
6569
6576
|
this.yieldPos = 0;
|
|
@@ -6607,25 +6614,25 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
|
|
|
6607
6614
|
if (this.type === types$1.slash) {
|
|
6608
6615
|
this.readRegexp();
|
|
6609
6616
|
}
|
|
6610
|
-
var
|
|
6617
|
+
var node, canBeArrow = this.potentialArrowAt === this.start;
|
|
6611
6618
|
switch (this.type) {
|
|
6612
6619
|
case types$1._super:
|
|
6613
6620
|
if (!this.allowSuper) {
|
|
6614
6621
|
this.raise(this.start, "'super' keyword outside a method");
|
|
6615
6622
|
}
|
|
6616
|
-
|
|
6623
|
+
node = this.startNode();
|
|
6617
6624
|
this.next();
|
|
6618
6625
|
if (this.type === types$1.parenL && !this.allowDirectSuper) {
|
|
6619
|
-
this.raise(
|
|
6626
|
+
this.raise(node.start, "super() call outside constructor of a subclass");
|
|
6620
6627
|
}
|
|
6621
6628
|
if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) {
|
|
6622
6629
|
this.unexpected();
|
|
6623
6630
|
}
|
|
6624
|
-
return this.finishNode(
|
|
6631
|
+
return this.finishNode(node, "Super");
|
|
6625
6632
|
case types$1._this:
|
|
6626
|
-
|
|
6633
|
+
node = this.startNode();
|
|
6627
6634
|
this.next();
|
|
6628
|
-
return this.finishNode(
|
|
6635
|
+
return this.finishNode(node, "ThisExpression");
|
|
6629
6636
|
case types$1.name:
|
|
6630
6637
|
var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
|
|
6631
6638
|
var id = this.parseIdent(false);
|
|
@@ -6648,20 +6655,20 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
|
|
|
6648
6655
|
return id;
|
|
6649
6656
|
case types$1.regexp:
|
|
6650
6657
|
var value = this.value;
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
return
|
|
6658
|
+
node = this.parseLiteral(value.value);
|
|
6659
|
+
node.regex = { pattern: value.pattern, flags: value.flags };
|
|
6660
|
+
return node;
|
|
6654
6661
|
case types$1.num:
|
|
6655
6662
|
case types$1.string:
|
|
6656
6663
|
return this.parseLiteral(this.value);
|
|
6657
6664
|
case types$1._null:
|
|
6658
6665
|
case types$1._true:
|
|
6659
6666
|
case types$1._false:
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6667
|
+
node = this.startNode();
|
|
6668
|
+
node.value = this.type === types$1._null ? null : this.type === types$1._true;
|
|
6669
|
+
node.raw = this.type.keyword;
|
|
6663
6670
|
this.next();
|
|
6664
|
-
return this.finishNode(
|
|
6671
|
+
return this.finishNode(node, "Literal");
|
|
6665
6672
|
case types$1.parenL:
|
|
6666
6673
|
var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
|
|
6667
6674
|
if (refDestructuringErrors) {
|
|
@@ -6674,17 +6681,17 @@ pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
|
|
|
6674
6681
|
}
|
|
6675
6682
|
return expr;
|
|
6676
6683
|
case types$1.bracketL:
|
|
6677
|
-
|
|
6684
|
+
node = this.startNode();
|
|
6678
6685
|
this.next();
|
|
6679
|
-
|
|
6680
|
-
return this.finishNode(
|
|
6686
|
+
node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
|
|
6687
|
+
return this.finishNode(node, "ArrayExpression");
|
|
6681
6688
|
case types$1.braceL:
|
|
6682
6689
|
this.overrideContext(types.b_expr);
|
|
6683
6690
|
return this.parseObj(false, refDestructuringErrors);
|
|
6684
6691
|
case types$1._function:
|
|
6685
|
-
|
|
6692
|
+
node = this.startNode();
|
|
6686
6693
|
this.next();
|
|
6687
|
-
return this.parseFunction(
|
|
6694
|
+
return this.parseFunction(node, 0);
|
|
6688
6695
|
case types$1._class:
|
|
6689
6696
|
return this.parseClass(this.startNode(), false);
|
|
6690
6697
|
case types$1._new:
|
|
@@ -6705,25 +6712,25 @@ pp$5.parseExprAtomDefault = function() {
|
|
|
6705
6712
|
this.unexpected();
|
|
6706
6713
|
};
|
|
6707
6714
|
pp$5.parseExprImport = function(forNew) {
|
|
6708
|
-
var
|
|
6715
|
+
var node = this.startNode();
|
|
6709
6716
|
if (this.containsEsc) {
|
|
6710
6717
|
this.raiseRecoverable(this.start, "Escape sequence in keyword import");
|
|
6711
6718
|
}
|
|
6712
6719
|
this.next();
|
|
6713
6720
|
if (this.type === types$1.parenL && !forNew) {
|
|
6714
|
-
return this.parseDynamicImport(
|
|
6721
|
+
return this.parseDynamicImport(node);
|
|
6715
6722
|
} else if (this.type === types$1.dot) {
|
|
6716
|
-
var meta = this.startNodeAt(
|
|
6723
|
+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
6717
6724
|
meta.name = "import";
|
|
6718
|
-
|
|
6719
|
-
return this.parseImportMeta(
|
|
6725
|
+
node.meta = this.finishNode(meta, "Identifier");
|
|
6726
|
+
return this.parseImportMeta(node);
|
|
6720
6727
|
} else {
|
|
6721
6728
|
this.unexpected();
|
|
6722
6729
|
}
|
|
6723
6730
|
};
|
|
6724
|
-
pp$5.parseDynamicImport = function(
|
|
6731
|
+
pp$5.parseDynamicImport = function(node) {
|
|
6725
6732
|
this.next();
|
|
6726
|
-
|
|
6733
|
+
node.source = this.parseMaybeAssign();
|
|
6727
6734
|
if (!this.eat(types$1.parenR)) {
|
|
6728
6735
|
var errorPos = this.start;
|
|
6729
6736
|
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
|
|
@@ -6732,32 +6739,32 @@ pp$5.parseDynamicImport = function(node2) {
|
|
|
6732
6739
|
this.unexpected(errorPos);
|
|
6733
6740
|
}
|
|
6734
6741
|
}
|
|
6735
|
-
return this.finishNode(
|
|
6742
|
+
return this.finishNode(node, "ImportExpression");
|
|
6736
6743
|
};
|
|
6737
|
-
pp$5.parseImportMeta = function(
|
|
6744
|
+
pp$5.parseImportMeta = function(node) {
|
|
6738
6745
|
this.next();
|
|
6739
6746
|
var containsEsc = this.containsEsc;
|
|
6740
|
-
|
|
6741
|
-
if (
|
|
6742
|
-
this.raiseRecoverable(
|
|
6747
|
+
node.property = this.parseIdent(true);
|
|
6748
|
+
if (node.property.name !== "meta") {
|
|
6749
|
+
this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'");
|
|
6743
6750
|
}
|
|
6744
6751
|
if (containsEsc) {
|
|
6745
|
-
this.raiseRecoverable(
|
|
6752
|
+
this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters");
|
|
6746
6753
|
}
|
|
6747
6754
|
if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) {
|
|
6748
|
-
this.raiseRecoverable(
|
|
6755
|
+
this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module");
|
|
6749
6756
|
}
|
|
6750
|
-
return this.finishNode(
|
|
6757
|
+
return this.finishNode(node, "MetaProperty");
|
|
6751
6758
|
};
|
|
6752
6759
|
pp$5.parseLiteral = function(value) {
|
|
6753
|
-
var
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
if (
|
|
6757
|
-
|
|
6760
|
+
var node = this.startNode();
|
|
6761
|
+
node.value = value;
|
|
6762
|
+
node.raw = this.input.slice(this.start, this.end);
|
|
6763
|
+
if (node.raw.charCodeAt(node.raw.length - 1) === 110) {
|
|
6764
|
+
node.bigint = node.raw.slice(0, -1).replace(/_/g, "");
|
|
6758
6765
|
}
|
|
6759
6766
|
this.next();
|
|
6760
|
-
return this.finishNode(
|
|
6767
|
+
return this.finishNode(node, "Literal");
|
|
6761
6768
|
};
|
|
6762
6769
|
pp$5.parseParenExpression = function() {
|
|
6763
6770
|
this.expect(types$1.parenL);
|
|
@@ -6843,34 +6850,34 @@ pp$5.parseNew = function() {
|
|
|
6843
6850
|
if (this.containsEsc) {
|
|
6844
6851
|
this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
6845
6852
|
}
|
|
6846
|
-
var
|
|
6853
|
+
var node = this.startNode();
|
|
6847
6854
|
this.next();
|
|
6848
6855
|
if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
|
|
6849
|
-
var meta = this.startNodeAt(
|
|
6856
|
+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
6850
6857
|
meta.name = "new";
|
|
6851
|
-
|
|
6858
|
+
node.meta = this.finishNode(meta, "Identifier");
|
|
6852
6859
|
this.next();
|
|
6853
6860
|
var containsEsc = this.containsEsc;
|
|
6854
|
-
|
|
6855
|
-
if (
|
|
6856
|
-
this.raiseRecoverable(
|
|
6861
|
+
node.property = this.parseIdent(true);
|
|
6862
|
+
if (node.property.name !== "target") {
|
|
6863
|
+
this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'");
|
|
6857
6864
|
}
|
|
6858
6865
|
if (containsEsc) {
|
|
6859
|
-
this.raiseRecoverable(
|
|
6866
|
+
this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters");
|
|
6860
6867
|
}
|
|
6861
6868
|
if (!this.allowNewDotTarget) {
|
|
6862
|
-
this.raiseRecoverable(
|
|
6869
|
+
this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block");
|
|
6863
6870
|
}
|
|
6864
|
-
return this.finishNode(
|
|
6871
|
+
return this.finishNode(node, "MetaProperty");
|
|
6865
6872
|
}
|
|
6866
6873
|
var startPos = this.start, startLoc = this.startLoc;
|
|
6867
|
-
|
|
6874
|
+
node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
|
|
6868
6875
|
if (this.eat(types$1.parenL)) {
|
|
6869
|
-
|
|
6876
|
+
node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
|
|
6870
6877
|
} else {
|
|
6871
|
-
|
|
6878
|
+
node.arguments = empty;
|
|
6872
6879
|
}
|
|
6873
|
-
return this.finishNode(
|
|
6880
|
+
return this.finishNode(node, "NewExpression");
|
|
6874
6881
|
};
|
|
6875
6882
|
pp$5.parseTemplateElement = function(ref2) {
|
|
6876
6883
|
var isTagged = ref2.isTagged;
|
|
@@ -6899,29 +6906,29 @@ pp$5.parseTemplate = function(ref2) {
|
|
|
6899
6906
|
var isTagged = ref2.isTagged;
|
|
6900
6907
|
if (isTagged === void 0)
|
|
6901
6908
|
isTagged = false;
|
|
6902
|
-
var
|
|
6909
|
+
var node = this.startNode();
|
|
6903
6910
|
this.next();
|
|
6904
|
-
|
|
6911
|
+
node.expressions = [];
|
|
6905
6912
|
var curElt = this.parseTemplateElement({ isTagged });
|
|
6906
|
-
|
|
6913
|
+
node.quasis = [curElt];
|
|
6907
6914
|
while (!curElt.tail) {
|
|
6908
6915
|
if (this.type === types$1.eof) {
|
|
6909
6916
|
this.raise(this.pos, "Unterminated template literal");
|
|
6910
6917
|
}
|
|
6911
6918
|
this.expect(types$1.dollarBraceL);
|
|
6912
|
-
|
|
6919
|
+
node.expressions.push(this.parseExpression());
|
|
6913
6920
|
this.expect(types$1.braceR);
|
|
6914
|
-
|
|
6921
|
+
node.quasis.push(curElt = this.parseTemplateElement({ isTagged }));
|
|
6915
6922
|
}
|
|
6916
6923
|
this.next();
|
|
6917
|
-
return this.finishNode(
|
|
6924
|
+
return this.finishNode(node, "TemplateLiteral");
|
|
6918
6925
|
};
|
|
6919
6926
|
pp$5.isAsyncProp = function(prop) {
|
|
6920
6927
|
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));
|
|
6921
6928
|
};
|
|
6922
6929
|
pp$5.parseObj = function(isPattern, refDestructuringErrors) {
|
|
6923
|
-
var
|
|
6924
|
-
|
|
6930
|
+
var node = this.startNode(), first = true, propHash = {};
|
|
6931
|
+
node.properties = [];
|
|
6925
6932
|
this.next();
|
|
6926
6933
|
while (!this.eat(types$1.braceR)) {
|
|
6927
6934
|
if (!first) {
|
|
@@ -6936,9 +6943,9 @@ pp$5.parseObj = function(isPattern, refDestructuringErrors) {
|
|
|
6936
6943
|
if (!isPattern) {
|
|
6937
6944
|
this.checkPropClash(prop, propHash, refDestructuringErrors);
|
|
6938
6945
|
}
|
|
6939
|
-
|
|
6946
|
+
node.properties.push(prop);
|
|
6940
6947
|
}
|
|
6941
|
-
return this.finishNode(
|
|
6948
|
+
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
|
|
6942
6949
|
};
|
|
6943
6950
|
pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
6944
6951
|
var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
|
|
@@ -7053,67 +7060,67 @@ pp$5.parsePropertyName = function(prop) {
|
|
|
7053
7060
|
}
|
|
7054
7061
|
return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
7055
7062
|
};
|
|
7056
|
-
pp$5.initFunction = function(
|
|
7057
|
-
|
|
7063
|
+
pp$5.initFunction = function(node) {
|
|
7064
|
+
node.id = null;
|
|
7058
7065
|
if (this.options.ecmaVersion >= 6) {
|
|
7059
|
-
|
|
7066
|
+
node.generator = node.expression = false;
|
|
7060
7067
|
}
|
|
7061
7068
|
if (this.options.ecmaVersion >= 8) {
|
|
7062
|
-
|
|
7069
|
+
node.async = false;
|
|
7063
7070
|
}
|
|
7064
7071
|
};
|
|
7065
7072
|
pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
|
|
7066
|
-
var
|
|
7067
|
-
this.initFunction(
|
|
7073
|
+
var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
|
|
7074
|
+
this.initFunction(node);
|
|
7068
7075
|
if (this.options.ecmaVersion >= 6) {
|
|
7069
|
-
|
|
7076
|
+
node.generator = isGenerator;
|
|
7070
7077
|
}
|
|
7071
7078
|
if (this.options.ecmaVersion >= 8) {
|
|
7072
|
-
|
|
7079
|
+
node.async = !!isAsync;
|
|
7073
7080
|
}
|
|
7074
7081
|
this.yieldPos = 0;
|
|
7075
7082
|
this.awaitPos = 0;
|
|
7076
7083
|
this.awaitIdentPos = 0;
|
|
7077
|
-
this.enterScope(functionFlags(isAsync,
|
|
7084
|
+
this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
|
|
7078
7085
|
this.expect(types$1.parenL);
|
|
7079
|
-
|
|
7086
|
+
node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
|
|
7080
7087
|
this.checkYieldAwaitInDefaultParams();
|
|
7081
|
-
this.parseFunctionBody(
|
|
7088
|
+
this.parseFunctionBody(node, false, true, false);
|
|
7082
7089
|
this.yieldPos = oldYieldPos;
|
|
7083
7090
|
this.awaitPos = oldAwaitPos;
|
|
7084
7091
|
this.awaitIdentPos = oldAwaitIdentPos;
|
|
7085
|
-
return this.finishNode(
|
|
7092
|
+
return this.finishNode(node, "FunctionExpression");
|
|
7086
7093
|
};
|
|
7087
|
-
pp$5.parseArrowExpression = function(
|
|
7094
|
+
pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
|
|
7088
7095
|
var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
|
|
7089
7096
|
this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
|
|
7090
|
-
this.initFunction(
|
|
7097
|
+
this.initFunction(node);
|
|
7091
7098
|
if (this.options.ecmaVersion >= 8) {
|
|
7092
|
-
|
|
7099
|
+
node.async = !!isAsync;
|
|
7093
7100
|
}
|
|
7094
7101
|
this.yieldPos = 0;
|
|
7095
7102
|
this.awaitPos = 0;
|
|
7096
7103
|
this.awaitIdentPos = 0;
|
|
7097
|
-
|
|
7098
|
-
this.parseFunctionBody(
|
|
7104
|
+
node.params = this.toAssignableList(params, true);
|
|
7105
|
+
this.parseFunctionBody(node, true, false, forInit);
|
|
7099
7106
|
this.yieldPos = oldYieldPos;
|
|
7100
7107
|
this.awaitPos = oldAwaitPos;
|
|
7101
7108
|
this.awaitIdentPos = oldAwaitIdentPos;
|
|
7102
|
-
return this.finishNode(
|
|
7109
|
+
return this.finishNode(node, "ArrowFunctionExpression");
|
|
7103
7110
|
};
|
|
7104
|
-
pp$5.parseFunctionBody = function(
|
|
7111
|
+
pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
|
|
7105
7112
|
var isExpression = isArrowFunction && this.type !== types$1.braceL;
|
|
7106
7113
|
var oldStrict = this.strict, useStrict = false;
|
|
7107
7114
|
if (isExpression) {
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
this.checkParams(
|
|
7115
|
+
node.body = this.parseMaybeAssign(forInit);
|
|
7116
|
+
node.expression = true;
|
|
7117
|
+
this.checkParams(node, false);
|
|
7111
7118
|
} else {
|
|
7112
|
-
var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(
|
|
7119
|
+
var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
|
|
7113
7120
|
if (!oldStrict || nonSimple) {
|
|
7114
7121
|
useStrict = this.strictDirective(this.end);
|
|
7115
7122
|
if (useStrict && nonSimple) {
|
|
7116
|
-
this.raiseRecoverable(
|
|
7123
|
+
this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list");
|
|
7117
7124
|
}
|
|
7118
7125
|
}
|
|
7119
7126
|
var oldLabels = this.labels;
|
|
@@ -7121,13 +7128,13 @@ pp$5.parseFunctionBody = function(node2, isArrowFunction, isMethod, forInit) {
|
|
|
7121
7128
|
if (useStrict) {
|
|
7122
7129
|
this.strict = true;
|
|
7123
7130
|
}
|
|
7124
|
-
this.checkParams(
|
|
7125
|
-
if (this.strict &&
|
|
7126
|
-
this.checkLValSimple(
|
|
7131
|
+
this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
|
|
7132
|
+
if (this.strict && node.id) {
|
|
7133
|
+
this.checkLValSimple(node.id, BIND_OUTSIDE);
|
|
7127
7134
|
}
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
this.adaptDirectivePrologue(
|
|
7135
|
+
node.body = this.parseBlock(false, void 0, useStrict && !oldStrict);
|
|
7136
|
+
node.expression = false;
|
|
7137
|
+
this.adaptDirectivePrologue(node.body.body);
|
|
7131
7138
|
this.labels = oldLabels;
|
|
7132
7139
|
}
|
|
7133
7140
|
this.exitScope();
|
|
@@ -7141,9 +7148,9 @@ pp$5.isSimpleParamList = function(params) {
|
|
|
7141
7148
|
}
|
|
7142
7149
|
return true;
|
|
7143
7150
|
};
|
|
7144
|
-
pp$5.checkParams = function(
|
|
7151
|
+
pp$5.checkParams = function(node, allowDuplicates) {
|
|
7145
7152
|
var nameHash = /* @__PURE__ */ Object.create(null);
|
|
7146
|
-
for (var i = 0, list =
|
|
7153
|
+
for (var i = 0, list = node.params; i < list.length; i += 1) {
|
|
7147
7154
|
var param = list[i];
|
|
7148
7155
|
this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
|
|
7149
7156
|
}
|
|
@@ -7205,73 +7212,73 @@ pp$5.checkUnreserved = function(ref2) {
|
|
|
7205
7212
|
}
|
|
7206
7213
|
};
|
|
7207
7214
|
pp$5.parseIdent = function(liberal) {
|
|
7208
|
-
var
|
|
7215
|
+
var node = this.parseIdentNode();
|
|
7209
7216
|
this.next(!!liberal);
|
|
7210
|
-
this.finishNode(
|
|
7217
|
+
this.finishNode(node, "Identifier");
|
|
7211
7218
|
if (!liberal) {
|
|
7212
|
-
this.checkUnreserved(
|
|
7213
|
-
if (
|
|
7214
|
-
this.awaitIdentPos =
|
|
7219
|
+
this.checkUnreserved(node);
|
|
7220
|
+
if (node.name === "await" && !this.awaitIdentPos) {
|
|
7221
|
+
this.awaitIdentPos = node.start;
|
|
7215
7222
|
}
|
|
7216
7223
|
}
|
|
7217
|
-
return
|
|
7224
|
+
return node;
|
|
7218
7225
|
};
|
|
7219
7226
|
pp$5.parseIdentNode = function() {
|
|
7220
|
-
var
|
|
7227
|
+
var node = this.startNode();
|
|
7221
7228
|
if (this.type === types$1.name) {
|
|
7222
|
-
|
|
7229
|
+
node.name = this.value;
|
|
7223
7230
|
} else if (this.type.keyword) {
|
|
7224
|
-
|
|
7225
|
-
if ((
|
|
7231
|
+
node.name = this.type.keyword;
|
|
7232
|
+
if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
|
|
7226
7233
|
this.context.pop();
|
|
7227
7234
|
}
|
|
7228
7235
|
this.type = types$1.name;
|
|
7229
7236
|
} else {
|
|
7230
7237
|
this.unexpected();
|
|
7231
7238
|
}
|
|
7232
|
-
return
|
|
7239
|
+
return node;
|
|
7233
7240
|
};
|
|
7234
7241
|
pp$5.parsePrivateIdent = function() {
|
|
7235
|
-
var
|
|
7242
|
+
var node = this.startNode();
|
|
7236
7243
|
if (this.type === types$1.privateId) {
|
|
7237
|
-
|
|
7244
|
+
node.name = this.value;
|
|
7238
7245
|
} else {
|
|
7239
7246
|
this.unexpected();
|
|
7240
7247
|
}
|
|
7241
7248
|
this.next();
|
|
7242
|
-
this.finishNode(
|
|
7249
|
+
this.finishNode(node, "PrivateIdentifier");
|
|
7243
7250
|
if (this.options.checkPrivateFields) {
|
|
7244
7251
|
if (this.privateNameStack.length === 0) {
|
|
7245
|
-
this.raise(
|
|
7252
|
+
this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class");
|
|
7246
7253
|
} else {
|
|
7247
|
-
this.privateNameStack[this.privateNameStack.length - 1].used.push(
|
|
7254
|
+
this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
|
|
7248
7255
|
}
|
|
7249
7256
|
}
|
|
7250
|
-
return
|
|
7257
|
+
return node;
|
|
7251
7258
|
};
|
|
7252
7259
|
pp$5.parseYield = function(forInit) {
|
|
7253
7260
|
if (!this.yieldPos) {
|
|
7254
7261
|
this.yieldPos = this.start;
|
|
7255
7262
|
}
|
|
7256
|
-
var
|
|
7263
|
+
var node = this.startNode();
|
|
7257
7264
|
this.next();
|
|
7258
7265
|
if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) {
|
|
7259
|
-
|
|
7260
|
-
|
|
7266
|
+
node.delegate = false;
|
|
7267
|
+
node.argument = null;
|
|
7261
7268
|
} else {
|
|
7262
|
-
|
|
7263
|
-
|
|
7269
|
+
node.delegate = this.eat(types$1.star);
|
|
7270
|
+
node.argument = this.parseMaybeAssign(forInit);
|
|
7264
7271
|
}
|
|
7265
|
-
return this.finishNode(
|
|
7272
|
+
return this.finishNode(node, "YieldExpression");
|
|
7266
7273
|
};
|
|
7267
7274
|
pp$5.parseAwait = function(forInit) {
|
|
7268
7275
|
if (!this.awaitPos) {
|
|
7269
7276
|
this.awaitPos = this.start;
|
|
7270
7277
|
}
|
|
7271
|
-
var
|
|
7278
|
+
var node = this.startNode();
|
|
7272
7279
|
this.next();
|
|
7273
|
-
|
|
7274
|
-
return this.finishNode(
|
|
7280
|
+
node.argument = this.parseMaybeUnary(null, true, false, forInit);
|
|
7281
|
+
return this.finishNode(node, "AwaitExpression");
|
|
7275
7282
|
};
|
|
7276
7283
|
var pp$4 = Parser.prototype;
|
|
7277
7284
|
pp$4.raise = function(pos, message) {
|
|
@@ -7391,27 +7398,27 @@ pp$2.startNode = function() {
|
|
|
7391
7398
|
pp$2.startNodeAt = function(pos, loc) {
|
|
7392
7399
|
return new Node(this, pos, loc);
|
|
7393
7400
|
};
|
|
7394
|
-
function finishNodeAt(
|
|
7395
|
-
|
|
7396
|
-
|
|
7401
|
+
function finishNodeAt(node, type, pos, loc) {
|
|
7402
|
+
node.type = type;
|
|
7403
|
+
node.end = pos;
|
|
7397
7404
|
if (this.options.locations) {
|
|
7398
|
-
|
|
7405
|
+
node.loc.end = loc;
|
|
7399
7406
|
}
|
|
7400
7407
|
if (this.options.ranges) {
|
|
7401
|
-
|
|
7408
|
+
node.range[1] = pos;
|
|
7402
7409
|
}
|
|
7403
|
-
return
|
|
7410
|
+
return node;
|
|
7404
7411
|
}
|
|
7405
|
-
pp$2.finishNode = function(
|
|
7406
|
-
return finishNodeAt.call(this,
|
|
7412
|
+
pp$2.finishNode = function(node, type) {
|
|
7413
|
+
return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc);
|
|
7407
7414
|
};
|
|
7408
|
-
pp$2.finishNodeAt = function(
|
|
7409
|
-
return finishNodeAt.call(this,
|
|
7415
|
+
pp$2.finishNodeAt = function(node, type, pos, loc) {
|
|
7416
|
+
return finishNodeAt.call(this, node, type, pos, loc);
|
|
7410
7417
|
};
|
|
7411
|
-
pp$2.copyNode = function(
|
|
7412
|
-
var newNode = new Node(this,
|
|
7413
|
-
for (var prop in
|
|
7414
|
-
newNode[prop] =
|
|
7418
|
+
pp$2.copyNode = function(node) {
|
|
7419
|
+
var newNode = new Node(this, node.start, this.startLoc);
|
|
7420
|
+
for (var prop in node) {
|
|
7421
|
+
newNode[prop] = node[prop];
|
|
7415
7422
|
}
|
|
7416
7423
|
return newNode;
|
|
7417
7424
|
};
|
|
@@ -8005,14 +8012,14 @@ pp$1.regexp_eatAtomEscape = function(state) {
|
|
|
8005
8012
|
pp$1.regexp_eatBackReference = function(state) {
|
|
8006
8013
|
var start = state.pos;
|
|
8007
8014
|
if (this.regexp_eatDecimalEscape(state)) {
|
|
8008
|
-
var
|
|
8015
|
+
var n2 = state.lastIntValue;
|
|
8009
8016
|
if (state.switchU) {
|
|
8010
|
-
if (
|
|
8011
|
-
state.maxBackReference =
|
|
8017
|
+
if (n2 > state.maxBackReference) {
|
|
8018
|
+
state.maxBackReference = n2;
|
|
8012
8019
|
}
|
|
8013
8020
|
return true;
|
|
8014
8021
|
}
|
|
8015
|
-
if (
|
|
8022
|
+
if (n2 <= state.numCapturingParens) {
|
|
8016
8023
|
return true;
|
|
8017
8024
|
}
|
|
8018
8025
|
state.pos = start;
|
|
@@ -9455,11 +9462,11 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
9455
9462
|
};
|
|
9456
9463
|
pp.readHexChar = function(len) {
|
|
9457
9464
|
var codePos = this.pos;
|
|
9458
|
-
var
|
|
9459
|
-
if (
|
|
9465
|
+
var n2 = this.readInt(16, len);
|
|
9466
|
+
if (n2 === null) {
|
|
9460
9467
|
this.invalidStringToken(codePos, "Bad character escape sequence");
|
|
9461
9468
|
}
|
|
9462
|
-
return
|
|
9469
|
+
return n2;
|
|
9463
9470
|
};
|
|
9464
9471
|
pp.readWord1 = function() {
|
|
9465
9472
|
this.containsEsc = false;
|
|
@@ -10963,75 +10970,41 @@ function resolvePackage(name, options = {}) {
|
|
|
10963
10970
|
}
|
|
10964
10971
|
}
|
|
10965
10972
|
|
|
10966
|
-
// src/configs/
|
|
10967
|
-
|
|
10973
|
+
// src/configs/antfu.ts
|
|
10974
|
+
var antfu = async () => {
|
|
10968
10975
|
return [
|
|
10969
10976
|
{
|
|
10970
|
-
name: "jsse:
|
|
10977
|
+
name: "jsse:antfu",
|
|
10971
10978
|
plugins: {
|
|
10972
10979
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
10973
|
-
|
|
10980
|
+
antfu: default4
|
|
10974
10981
|
},
|
|
10975
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
10976
10982
|
rules: {
|
|
10977
|
-
|
|
10978
|
-
|
|
10983
|
+
"antfu/no-import-node-modules-by-path": "error",
|
|
10984
|
+
"antfu/top-level-function": "error"
|
|
10979
10985
|
}
|
|
10980
|
-
}
|
|
10981
|
-
];
|
|
10982
|
-
}
|
|
10983
|
-
|
|
10984
|
-
// src/configs/stylistic.ts
|
|
10985
|
-
function jsxStylistic({
|
|
10986
|
-
indent
|
|
10987
|
-
}) {
|
|
10988
|
-
return {
|
|
10989
|
-
"@stylistic/jsx-curly-brace-presence": [
|
|
10990
|
-
"error",
|
|
10991
|
-
{ propElementValues: "always" }
|
|
10992
|
-
],
|
|
10993
|
-
"@stylistic/jsx-indent": [
|
|
10994
|
-
"error",
|
|
10995
|
-
indent,
|
|
10996
|
-
{ checkAttributes: true, indentLogicalExpressions: true }
|
|
10997
|
-
],
|
|
10998
|
-
"@stylistic/jsx-quotes": "error"
|
|
10999
|
-
};
|
|
11000
|
-
}
|
|
11001
|
-
function stylistic(options = {}) {
|
|
11002
|
-
const { indent = 2, jsx = true, quotes = "double" } = options;
|
|
11003
|
-
return [
|
|
10986
|
+
},
|
|
11004
10987
|
{
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11008
|
-
"@stylistic": default2
|
|
11009
|
-
},
|
|
10988
|
+
files: ["**/src/**/*"],
|
|
10989
|
+
name: "jsse:antfu:bin",
|
|
11010
10990
|
rules: {
|
|
11011
|
-
"
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
10991
|
+
"antfu/no-import-dist": "error"
|
|
10992
|
+
}
|
|
10993
|
+
},
|
|
10994
|
+
{
|
|
10995
|
+
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
10996
|
+
name: "jsse:antfu:bin",
|
|
10997
|
+
rules: {
|
|
10998
|
+
"antfu/no-import-dist": "off",
|
|
10999
|
+
"antfu/no-import-node-modules-by-path": "off"
|
|
11018
11000
|
}
|
|
11019
11001
|
}
|
|
11020
11002
|
];
|
|
11021
|
-
}
|
|
11022
|
-
|
|
11023
|
-
// src/slow.ts
|
|
11024
|
-
var slowRules = [
|
|
11025
|
-
"@typescript-eslint/no-misused-promises",
|
|
11026
|
-
"@typescript-eslint/no-unsafe-assignment",
|
|
11027
|
-
"@typescript-eslint/no-unsafe-call",
|
|
11028
|
-
"@typescript-eslint/no-unsafe-member-access",
|
|
11029
|
-
"@typescript-eslint/no-unsafe-return"
|
|
11030
|
-
];
|
|
11003
|
+
};
|
|
11031
11004
|
|
|
11032
11005
|
// src/configs/md.ts
|
|
11033
|
-
|
|
11034
|
-
const { componentExts = [], overrides = {} } = options;
|
|
11006
|
+
var markdown = async (options) => {
|
|
11007
|
+
const { componentExts = [], overrides = {} } = options ?? {};
|
|
11035
11008
|
const tsRulesOff = Object.fromEntries(
|
|
11036
11009
|
// @ts-expect-error - undefined
|
|
11037
11010
|
Object.keys(typescriptRulesTypeAware()).map((key) => [
|
|
@@ -11044,7 +11017,7 @@ function markdown(options = {}) {
|
|
|
11044
11017
|
name: "jsse:markdown:setup",
|
|
11045
11018
|
plugins: {
|
|
11046
11019
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
11047
|
-
markdown:
|
|
11020
|
+
markdown: default7
|
|
11048
11021
|
}
|
|
11049
11022
|
},
|
|
11050
11023
|
{
|
|
@@ -11091,11 +11064,72 @@ function markdown(options = {}) {
|
|
|
11091
11064
|
}
|
|
11092
11065
|
}
|
|
11093
11066
|
];
|
|
11067
|
+
};
|
|
11068
|
+
|
|
11069
|
+
// src/configs/stylistic.ts
|
|
11070
|
+
function jsxStylistic({
|
|
11071
|
+
indent
|
|
11072
|
+
}) {
|
|
11073
|
+
return {
|
|
11074
|
+
"@stylistic/jsx-curly-brace-presence": [
|
|
11075
|
+
"error",
|
|
11076
|
+
{ propElementValues: "always" }
|
|
11077
|
+
],
|
|
11078
|
+
"@stylistic/jsx-indent": [
|
|
11079
|
+
"error",
|
|
11080
|
+
indent,
|
|
11081
|
+
{ checkAttributes: true, indentLogicalExpressions: true }
|
|
11082
|
+
],
|
|
11083
|
+
"@stylistic/jsx-quotes": "error"
|
|
11084
|
+
};
|
|
11094
11085
|
}
|
|
11086
|
+
var stylistic = async (options) => {
|
|
11087
|
+
const { indent = 2, jsx = true, quotes = "double" } = options ?? {};
|
|
11088
|
+
return [
|
|
11089
|
+
{
|
|
11090
|
+
name: "jsse:stylistic",
|
|
11091
|
+
plugins: {
|
|
11092
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11093
|
+
"@stylistic": default2
|
|
11094
|
+
},
|
|
11095
|
+
rules: {
|
|
11096
|
+
"@stylistic/quote-props": ["error", "as-needed"],
|
|
11097
|
+
"@stylistic/quotes": [
|
|
11098
|
+
"error",
|
|
11099
|
+
quotes,
|
|
11100
|
+
{ allowTemplateLiterals: false, avoidEscape: true }
|
|
11101
|
+
],
|
|
11102
|
+
...jsx ? jsxStylistic({ indent }) : {}
|
|
11103
|
+
}
|
|
11104
|
+
}
|
|
11105
|
+
];
|
|
11106
|
+
};
|
|
11107
|
+
|
|
11108
|
+
// src/configs/tailwind.ts
|
|
11109
|
+
var tailwind = async () => {
|
|
11110
|
+
return [
|
|
11111
|
+
{
|
|
11112
|
+
name: "jsse:tailwind",
|
|
11113
|
+
plugins: {
|
|
11114
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
11115
|
+
tailwindcss: default13
|
|
11116
|
+
},
|
|
11117
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
11118
|
+
rules: {
|
|
11119
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
11120
|
+
...default13.configs.recommended.rules
|
|
11121
|
+
}
|
|
11122
|
+
}
|
|
11123
|
+
];
|
|
11124
|
+
};
|
|
11095
11125
|
|
|
11096
11126
|
// src/configs/yml.ts
|
|
11097
|
-
|
|
11098
|
-
const {
|
|
11127
|
+
var yml = async (options) => {
|
|
11128
|
+
const {
|
|
11129
|
+
files = [GLOB_YAML],
|
|
11130
|
+
overrides = {},
|
|
11131
|
+
stylistic: stylistic2 = true
|
|
11132
|
+
} = options ?? {};
|
|
11099
11133
|
const { indent = 2, quotes = "single" } = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
11100
11134
|
const [pluginYaml, parserYaml] = await Promise.all([
|
|
11101
11135
|
interopDefault(import("eslint-plugin-yml")),
|
|
@@ -11140,7 +11174,16 @@ async function yml(options = {}) {
|
|
|
11140
11174
|
}
|
|
11141
11175
|
}
|
|
11142
11176
|
];
|
|
11143
|
-
}
|
|
11177
|
+
};
|
|
11178
|
+
|
|
11179
|
+
// src/slow.ts
|
|
11180
|
+
var slowRules = [
|
|
11181
|
+
"@typescript-eslint/no-misused-promises",
|
|
11182
|
+
"@typescript-eslint/no-unsafe-assignment",
|
|
11183
|
+
"@typescript-eslint/no-unsafe-call",
|
|
11184
|
+
"@typescript-eslint/no-unsafe-member-access",
|
|
11185
|
+
"@typescript-eslint/no-unsafe-return"
|
|
11186
|
+
];
|
|
11144
11187
|
|
|
11145
11188
|
// src/factory.ts
|
|
11146
11189
|
var flatConfigProps = [
|
|
@@ -11228,12 +11271,13 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
11228
11271
|
reportUnusedDisableDirectives
|
|
11229
11272
|
}),
|
|
11230
11273
|
comments(),
|
|
11231
|
-
|
|
11274
|
+
n(),
|
|
11232
11275
|
jsdoc(),
|
|
11233
11276
|
imports({
|
|
11234
11277
|
stylistic: stylisticOptions
|
|
11235
11278
|
}),
|
|
11236
11279
|
unicorn(),
|
|
11280
|
+
antfu(),
|
|
11237
11281
|
perfectionist()
|
|
11238
11282
|
);
|
|
11239
11283
|
if (enableTypeScript) {
|
|
@@ -11273,7 +11317,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
11273
11317
|
}
|
|
11274
11318
|
if (normalizedOptions.test) {
|
|
11275
11319
|
configs.push(
|
|
11276
|
-
test({
|
|
11320
|
+
await test({
|
|
11277
11321
|
isInEditor: isInEditor2,
|
|
11278
11322
|
overrides: overrides.test
|
|
11279
11323
|
})
|
|
@@ -11311,7 +11355,15 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
11311
11355
|
}))
|
|
11312
11356
|
);
|
|
11313
11357
|
}
|
|
11314
|
-
|
|
11358
|
+
const combinedConfigs = await combineAsync(...configs, ...userConfigs);
|
|
11359
|
+
if (normalizedOptions.preReturn) {
|
|
11360
|
+
const preReturned = normalizedOptions.preReturn(combinedConfigs);
|
|
11361
|
+
if (preReturned instanceof Promise) {
|
|
11362
|
+
return await preReturned;
|
|
11363
|
+
}
|
|
11364
|
+
return preReturned;
|
|
11365
|
+
}
|
|
11366
|
+
return combinedConfigs;
|
|
11315
11367
|
}
|
|
11316
11368
|
|
|
11317
11369
|
// src/presets.ts
|
|
@@ -11352,6 +11404,7 @@ export {
|
|
|
11352
11404
|
GLOB_TSX,
|
|
11353
11405
|
GLOB_YAML,
|
|
11354
11406
|
combine,
|
|
11407
|
+
combineAsync,
|
|
11355
11408
|
comments,
|
|
11356
11409
|
jsse as default,
|
|
11357
11410
|
eslintConfigPrettierRules,
|
|
@@ -11366,28 +11419,29 @@ export {
|
|
|
11366
11419
|
jsse,
|
|
11367
11420
|
jsseReact,
|
|
11368
11421
|
jssestd,
|
|
11369
|
-
|
|
11370
|
-
|
|
11422
|
+
n,
|
|
11423
|
+
default17 as parserJsonc,
|
|
11371
11424
|
parserTs,
|
|
11372
11425
|
perfectionist,
|
|
11373
|
-
default4 as
|
|
11426
|
+
default4 as pluginAntfu,
|
|
11427
|
+
default5 as pluginEslintComments,
|
|
11374
11428
|
pluginImport,
|
|
11375
|
-
|
|
11429
|
+
default6 as pluginJsdoc,
|
|
11376
11430
|
pluginJsonc,
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11431
|
+
default7 as pluginMarkdown,
|
|
11432
|
+
default8 as pluginN,
|
|
11433
|
+
default9 as pluginNoOnlyTests,
|
|
11434
|
+
default10 as pluginPerfectionist,
|
|
11435
|
+
default11 as pluginReact,
|
|
11436
|
+
default12 as pluginReactHooks,
|
|
11383
11437
|
pluginReactRefresh,
|
|
11384
11438
|
pluginSortKeys,
|
|
11385
11439
|
default2 as pluginStylistic,
|
|
11386
|
-
|
|
11440
|
+
default13 as pluginTailwind,
|
|
11387
11441
|
default3 as pluginTs,
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11442
|
+
default14 as pluginUnicorn,
|
|
11443
|
+
default15 as pluginUnusedImports,
|
|
11444
|
+
default16 as pluginVitest,
|
|
11391
11445
|
prettier,
|
|
11392
11446
|
react,
|
|
11393
11447
|
reactHooks,
|