@storm-software/eslint 0.170.150 → 0.170.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-2CLFLESM.js → chunk-RS7RUX35.js} +4 -4
- package/dist/index.cjs +401 -1601
- package/dist/index.js +2 -2
- package/dist/preset.cjs +401 -1601
- package/dist/preset.js +1 -1
- package/dist/{src-5KKSORLE.js → src-CBZKDWSO.js} +1 -1
- package/dist/src-PBDL72VC.js +57 -0
- package/dist/src-PDNT24JZ.js +91 -0
- package/package.json +11 -13
- package/dist/src-4MB5JAYY.js +0 -779
- package/dist/src-6DAHQLFU.js +0 -594
package/dist/index.cjs
CHANGED
|
@@ -9,8 +9,9 @@ var findUpSimple = require('find-up-simple');
|
|
|
9
9
|
var pathe = require('pathe');
|
|
10
10
|
var tinyglobby = require('tinyglobby');
|
|
11
11
|
var parserJsonc = require('jsonc-eslint-parser');
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var base = require('eslint-plugin-pnpm');
|
|
13
|
+
var parserYaml = require('yaml-eslint-parser');
|
|
14
|
+
var base2 = require('eslint-plugin-tsdoc');
|
|
14
15
|
var eslintFlatConfigUtils = require('eslint-flat-config-utils');
|
|
15
16
|
var localPkg = require('local-pkg');
|
|
16
17
|
var url$1 = require('url');
|
|
@@ -73,8 +74,10 @@ function _interopNamespace(e) {
|
|
|
73
74
|
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
74
75
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
75
76
|
var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
76
|
-
var
|
|
77
|
-
var
|
|
77
|
+
var parserJsonc__default = /*#__PURE__*/_interopDefault(parserJsonc);
|
|
78
|
+
var base__default = /*#__PURE__*/_interopDefault(base);
|
|
79
|
+
var parserYaml__default = /*#__PURE__*/_interopDefault(parserYaml);
|
|
80
|
+
var base2__default = /*#__PURE__*/_interopDefault(base2);
|
|
78
81
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
79
82
|
var path16__default = /*#__PURE__*/_interopDefault(path16);
|
|
80
83
|
var cspellConfig__default = /*#__PURE__*/_interopDefault(cspellConfig);
|
|
@@ -117,8 +120,8 @@ var __commonJS = (cb, mod) => function __require2() {
|
|
|
117
120
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
118
121
|
};
|
|
119
122
|
var __export = (target, all) => {
|
|
120
|
-
for (var
|
|
121
|
-
__defProp(target,
|
|
123
|
+
for (var name2 in all)
|
|
124
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
122
125
|
};
|
|
123
126
|
var __copyProps = (to, from, except, desc) => {
|
|
124
127
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -321,10 +324,16 @@ var init_package = __esm({
|
|
|
321
324
|
"../eslint-plugin-bun/package.json"() {
|
|
322
325
|
package_default2 = {
|
|
323
326
|
name: "@storm-software/eslint-plugin-bun",
|
|
324
|
-
version: "0.0.
|
|
327
|
+
version: "0.0.4",
|
|
325
328
|
private: false,
|
|
326
329
|
description: "An ESLint Plugin that enforces Bun catalog rules in Storm Software projects.",
|
|
327
|
-
keywords: [
|
|
330
|
+
keywords: [
|
|
331
|
+
"eslint",
|
|
332
|
+
"eslint-plugin",
|
|
333
|
+
"storm-software",
|
|
334
|
+
"bun",
|
|
335
|
+
"catalog"
|
|
336
|
+
],
|
|
328
337
|
homepage: "https://stormsoftware.com",
|
|
329
338
|
bugs: {
|
|
330
339
|
url: "https://stormsoftware.com/support",
|
|
@@ -387,7 +396,9 @@ var init_package = __esm({
|
|
|
387
396
|
},
|
|
388
397
|
"./package.json": "./package.json"
|
|
389
398
|
},
|
|
390
|
-
files: [
|
|
399
|
+
files: [
|
|
400
|
+
"dist"
|
|
401
|
+
],
|
|
391
402
|
dependencies: {
|
|
392
403
|
"@storm-software/package-constants": "workspace:*",
|
|
393
404
|
"@typescript-eslint/utils": "catalog:",
|
|
@@ -427,7 +438,7 @@ var init_package = __esm({
|
|
|
427
438
|
});
|
|
428
439
|
function RuleCreator2(urlCreator) {
|
|
429
440
|
return function createNamedRule({
|
|
430
|
-
name:
|
|
441
|
+
name: name2,
|
|
431
442
|
meta: meta3,
|
|
432
443
|
...rule
|
|
433
444
|
}) {
|
|
@@ -436,7 +447,7 @@ function RuleCreator2(urlCreator) {
|
|
|
436
447
|
...meta3,
|
|
437
448
|
docs: {
|
|
438
449
|
...meta3.docs,
|
|
439
|
-
url: urlCreator(
|
|
450
|
+
url: urlCreator(name2)
|
|
440
451
|
}
|
|
441
452
|
},
|
|
442
453
|
...rule
|
|
@@ -480,8 +491,8 @@ function detectCatalogRoot(data) {
|
|
|
480
491
|
}
|
|
481
492
|
return isWorkspaceObject(data.workspaces) ? "workspaces" : "top";
|
|
482
493
|
}
|
|
483
|
-
function normalizeCatalogName(
|
|
484
|
-
return
|
|
494
|
+
function normalizeCatalogName(name2) {
|
|
495
|
+
return name2.replace(/\^/g, "h").replace(/~/g, "t").replace(/\./g, "_").replace(/</g, "l").replace(/>/g, "g").replace(/=/g, "e").replace(/\*/g, "s").replace(/@/g, "a").replace(/\|/g, "p").replace(/&/g, "n").replace(/-/g, "m").replace(/\+/g, "u").replace(/\s/g, "_");
|
|
485
496
|
}
|
|
486
497
|
function sortObjectKeys(input) {
|
|
487
498
|
return Object.fromEntries(
|
|
@@ -610,9 +621,9 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
610
621
|
const found = [];
|
|
611
622
|
const { catalog, catalogs } = getCatalogData();
|
|
612
623
|
if (catalogs) {
|
|
613
|
-
for (const
|
|
614
|
-
if (catalogs[
|
|
615
|
-
found.push(
|
|
624
|
+
for (const name2 of Object.keys(catalogs)) {
|
|
625
|
+
if (catalogs[name2]?.[packageName]) {
|
|
626
|
+
found.push(name2);
|
|
616
627
|
}
|
|
617
628
|
}
|
|
618
629
|
}
|
|
@@ -621,7 +632,7 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
621
632
|
}
|
|
622
633
|
return found;
|
|
623
634
|
};
|
|
624
|
-
const
|
|
635
|
+
const workspace2 = {
|
|
625
636
|
filepath: current,
|
|
626
637
|
setContent(newContent) {
|
|
627
638
|
content = newContent;
|
|
@@ -646,7 +657,7 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
646
657
|
const clone2 = [...queue];
|
|
647
658
|
queue.length = 0;
|
|
648
659
|
for (const queued of clone2) {
|
|
649
|
-
queued(
|
|
660
|
+
queued(workspace2);
|
|
650
661
|
}
|
|
651
662
|
if (hasChanged) {
|
|
652
663
|
write();
|
|
@@ -678,7 +689,7 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
678
689
|
return [];
|
|
679
690
|
}
|
|
680
691
|
};
|
|
681
|
-
return
|
|
692
|
+
return workspace2;
|
|
682
693
|
}
|
|
683
694
|
function getBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
684
695
|
if (workspaceLastRead && workspace && !workspace.hasQueue() && Date.now() - workspaceLastRead > WORKSPACE_CACHE_TIME) {
|
|
@@ -874,7 +885,7 @@ var init_json_enforce_catalog = __esm({
|
|
|
874
885
|
context,
|
|
875
886
|
fields
|
|
876
887
|
)) {
|
|
877
|
-
if (ignore2?.some((
|
|
888
|
+
if (ignore2?.some((name2) => name2 === packageName)) {
|
|
878
889
|
continue;
|
|
879
890
|
}
|
|
880
891
|
if (specifier.startsWith("catalog:")) {
|
|
@@ -883,14 +894,14 @@ var init_json_enforce_catalog = __esm({
|
|
|
883
894
|
if (allowedProtocols?.some((protocol) => specifier.startsWith(protocol))) {
|
|
884
895
|
continue;
|
|
885
896
|
}
|
|
886
|
-
let
|
|
897
|
+
let workspace2;
|
|
887
898
|
try {
|
|
888
|
-
|
|
899
|
+
workspace2 = getBunWorkspace();
|
|
889
900
|
} catch {
|
|
890
901
|
return {};
|
|
891
902
|
}
|
|
892
|
-
let targetCatalog = reuseExistingCatalog ?
|
|
893
|
-
const resolvedConflicts =
|
|
903
|
+
let targetCatalog = reuseExistingCatalog ? workspace2.getPackageCatalogs(packageName)[0] || defaultCatalog : defaultCatalog;
|
|
904
|
+
const resolvedConflicts = workspace2.hasSpecifierConflicts(
|
|
894
905
|
targetCatalog,
|
|
895
906
|
packageName,
|
|
896
907
|
specifier
|
|
@@ -910,8 +921,8 @@ var init_json_enforce_catalog = __esm({
|
|
|
910
921
|
packageName
|
|
911
922
|
},
|
|
912
923
|
fix: shouldFix ? (fixer) => {
|
|
913
|
-
|
|
914
|
-
|
|
924
|
+
workspace2.queueChange(() => {
|
|
925
|
+
workspace2.setPackage(targetCatalog, packageName, specifier);
|
|
915
926
|
});
|
|
916
927
|
return fixer.replaceText(
|
|
917
928
|
property.value,
|
|
@@ -968,16 +979,16 @@ var init_json_no_duplicate_catalog_item = __esm({
|
|
|
968
979
|
if (!isRootWorkspacePackageJson(context.filename)) {
|
|
969
980
|
return {};
|
|
970
981
|
}
|
|
971
|
-
let
|
|
982
|
+
let workspace2;
|
|
972
983
|
try {
|
|
973
|
-
|
|
984
|
+
workspace2 = getBunWorkspace();
|
|
974
985
|
} catch {
|
|
975
986
|
return {};
|
|
976
987
|
}
|
|
977
|
-
if (
|
|
988
|
+
if (workspace2.hasChanged() || workspace2.hasQueue()) {
|
|
978
989
|
return {};
|
|
979
990
|
}
|
|
980
|
-
|
|
991
|
+
workspace2.setContent(context.sourceCode.text);
|
|
981
992
|
const root = getPackageJsonRootNode(context);
|
|
982
993
|
if (!root) {
|
|
983
994
|
return {};
|
|
@@ -1070,16 +1081,16 @@ var init_json_no_unused_catalog_item = __esm({
|
|
|
1070
1081
|
if (!isRootWorkspacePackageJson(context.filename)) {
|
|
1071
1082
|
return {};
|
|
1072
1083
|
}
|
|
1073
|
-
let
|
|
1084
|
+
let workspace2;
|
|
1074
1085
|
try {
|
|
1075
|
-
|
|
1086
|
+
workspace2 = getBunWorkspace();
|
|
1076
1087
|
} catch {
|
|
1077
1088
|
return {};
|
|
1078
1089
|
}
|
|
1079
|
-
if (
|
|
1090
|
+
if (workspace2.hasChanged() || workspace2.hasQueue()) {
|
|
1080
1091
|
return {};
|
|
1081
1092
|
}
|
|
1082
|
-
|
|
1093
|
+
workspace2.setContent(context.sourceCode.text);
|
|
1083
1094
|
const root = getPackageJsonRootNode(context);
|
|
1084
1095
|
if (!root) {
|
|
1085
1096
|
return {};
|
|
@@ -1111,7 +1122,7 @@ var init_json_no_unused_catalog_item = __esm({
|
|
|
1111
1122
|
if (entries.size === 0) {
|
|
1112
1123
|
return {};
|
|
1113
1124
|
}
|
|
1114
|
-
const packages = collectWorkspacePackageJsonPaths(
|
|
1125
|
+
const packages = collectWorkspacePackageJsonPaths(workspace2);
|
|
1115
1126
|
for (const path23 of packages) {
|
|
1116
1127
|
const pkg = JSON.parse(fs__default.default.readFileSync(path23, "utf8"));
|
|
1117
1128
|
for (const field of FIELDS) {
|
|
@@ -1119,12 +1130,12 @@ var init_json_no_unused_catalog_item = __esm({
|
|
|
1119
1130
|
if (!map) {
|
|
1120
1131
|
continue;
|
|
1121
1132
|
}
|
|
1122
|
-
for (const [
|
|
1133
|
+
for (const [name2, value] of Object.entries(map)) {
|
|
1123
1134
|
if (typeof value !== "string" || !value.startsWith("catalog:")) {
|
|
1124
1135
|
continue;
|
|
1125
1136
|
}
|
|
1126
1137
|
const catalogName = value.slice(8) || "default";
|
|
1127
|
-
entries.delete(`${
|
|
1138
|
+
entries.delete(`${name2}:${catalogName}`);
|
|
1128
1139
|
}
|
|
1129
1140
|
}
|
|
1130
1141
|
}
|
|
@@ -1217,14 +1228,14 @@ var init_json_valid_catalog = __esm({
|
|
|
1217
1228
|
if (!specifier.startsWith("catalog:")) {
|
|
1218
1229
|
continue;
|
|
1219
1230
|
}
|
|
1220
|
-
let
|
|
1231
|
+
let workspace2;
|
|
1221
1232
|
try {
|
|
1222
|
-
|
|
1233
|
+
workspace2 = getBunWorkspace();
|
|
1223
1234
|
} catch {
|
|
1224
1235
|
return {};
|
|
1225
1236
|
}
|
|
1226
1237
|
const currentCatalog = specifier.replace(/^catalog:/, "").trim() || "default";
|
|
1227
|
-
const existingCatalogs =
|
|
1238
|
+
const existingCatalogs = workspace2.getPackageCatalogs(packageName);
|
|
1228
1239
|
if (!existingCatalogs.includes(currentCatalog)) {
|
|
1229
1240
|
context.report({
|
|
1230
1241
|
node: property.value,
|
|
@@ -1237,8 +1248,8 @@ var init_json_valid_catalog = __esm({
|
|
|
1237
1248
|
let catalog = existingCatalogs[0];
|
|
1238
1249
|
if (!catalog && autoInsert) {
|
|
1239
1250
|
catalog = currentCatalog;
|
|
1240
|
-
|
|
1241
|
-
|
|
1251
|
+
workspace2.queueChange(() => {
|
|
1252
|
+
workspace2.setPackage(
|
|
1242
1253
|
catalog,
|
|
1243
1254
|
packageName,
|
|
1244
1255
|
autoInsertDefaultSpecifier
|
|
@@ -1264,781 +1275,99 @@ var plugin2;
|
|
|
1264
1275
|
var init_plugin = __esm({
|
|
1265
1276
|
"../eslint-plugin-bun/src/plugin.ts"() {
|
|
1266
1277
|
init_cjs_shims();
|
|
1267
|
-
init_package();
|
|
1268
|
-
init_json_enforce_catalog();
|
|
1269
|
-
init_json_no_duplicate_catalog_item();
|
|
1270
|
-
init_json_no_unused_catalog_item();
|
|
1271
|
-
init_json_valid_catalog();
|
|
1272
|
-
plugin2 = {
|
|
1273
|
-
meta: {
|
|
1274
|
-
name: "bun",
|
|
1275
|
-
version: package_default2.version
|
|
1276
|
-
},
|
|
1277
|
-
rules: {
|
|
1278
|
-
"json-enforce-catalog": json_enforce_catalog_default,
|
|
1279
|
-
"json-valid-catalog": json_valid_catalog_default,
|
|
1280
|
-
"json-no-unused-catalog-item": json_no_unused_catalog_item_default,
|
|
1281
|
-
"json-no-duplicate-catalog-item": json_no_duplicate_catalog_item_default
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
}
|
|
1285
|
-
});
|
|
1286
|
-
var config3, recommended_default2;
|
|
1287
|
-
var init_recommended = __esm({
|
|
1288
|
-
"../eslint-plugin-bun/src/configs/recommended.ts"() {
|
|
1289
|
-
init_cjs_shims();
|
|
1290
|
-
init_globs();
|
|
1291
|
-
init_plugin();
|
|
1292
|
-
config3 = [
|
|
1293
|
-
{
|
|
1294
|
-
name: "bun/recommended/setup",
|
|
1295
|
-
plugins: {
|
|
1296
|
-
bun: plugin2
|
|
1297
|
-
}
|
|
1298
|
-
},
|
|
1299
|
-
{
|
|
1300
|
-
name: "bun/recommended/package-json",
|
|
1301
|
-
ignores: GLOB_EXCLUDE,
|
|
1302
|
-
files: ["package.json", "**/package.json"],
|
|
1303
|
-
languageOptions: {
|
|
1304
|
-
parser: parserJsonc__namespace.default
|
|
1305
|
-
},
|
|
1306
|
-
rules: {
|
|
1307
|
-
"bun/json-enforce-catalog": [
|
|
1308
|
-
"error",
|
|
1309
|
-
{
|
|
1310
|
-
autofix: true,
|
|
1311
|
-
allowedProtocols: ["workspace", "link", "file"],
|
|
1312
|
-
defaultCatalog: "default",
|
|
1313
|
-
reuseExistingCatalog: true,
|
|
1314
|
-
conflicts: "overrides",
|
|
1315
|
-
fields: ["dependencies", "devDependencies"],
|
|
1316
|
-
ignore: ["typescript"]
|
|
1317
|
-
}
|
|
1318
|
-
],
|
|
1319
|
-
"bun/json-valid-catalog": "error",
|
|
1320
|
-
"bun/json-no-unused-catalog-item": "error",
|
|
1321
|
-
"bun/json-no-duplicate-catalog-item": "error"
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
];
|
|
1325
|
-
recommended_default2 = config3;
|
|
1326
|
-
}
|
|
1327
|
-
});
|
|
1328
|
-
|
|
1329
|
-
// ../eslint-plugin-bun/src/configs/index.ts
|
|
1330
|
-
var configs2;
|
|
1331
|
-
var init_configs = __esm({
|
|
1332
|
-
"../eslint-plugin-bun/src/configs/index.ts"() {
|
|
1333
|
-
init_cjs_shims();
|
|
1334
|
-
init_recommended();
|
|
1335
|
-
configs2 = {
|
|
1336
|
-
recommended: recommended_default2
|
|
1337
|
-
};
|
|
1338
|
-
}
|
|
1339
|
-
});
|
|
1340
|
-
|
|
1341
|
-
// ../eslint-plugin-bun/src/index.ts
|
|
1342
|
-
var src_exports = {};
|
|
1343
|
-
__export(src_exports, {
|
|
1344
|
-
configs: () => configs2,
|
|
1345
|
-
default: () => src_default2,
|
|
1346
|
-
rules: () => rules2
|
|
1347
|
-
});
|
|
1348
|
-
var eslintPlugin2, src_default2, rules2;
|
|
1349
|
-
var init_src = __esm({
|
|
1350
|
-
"../eslint-plugin-bun/src/index.ts"() {
|
|
1351
|
-
init_cjs_shims();
|
|
1352
|
-
init_configs();
|
|
1353
|
-
init_plugin();
|
|
1354
|
-
eslintPlugin2 = {
|
|
1355
|
-
...plugin2,
|
|
1356
|
-
configs: configs2
|
|
1357
|
-
};
|
|
1358
|
-
src_default2 = eslintPlugin2;
|
|
1359
|
-
rules2 = plugin2.rules;
|
|
1360
|
-
}
|
|
1361
|
-
});
|
|
1362
|
-
function RuleCreator4(urlCreator) {
|
|
1363
|
-
return function createNamedRule({
|
|
1364
|
-
name: name3,
|
|
1365
|
-
meta: meta3,
|
|
1366
|
-
...rule
|
|
1367
|
-
}) {
|
|
1368
|
-
return createRule5({
|
|
1369
|
-
meta: {
|
|
1370
|
-
...meta3,
|
|
1371
|
-
docs: {
|
|
1372
|
-
...meta3.docs,
|
|
1373
|
-
url: urlCreator(name3)
|
|
1374
|
-
}
|
|
1375
|
-
},
|
|
1376
|
-
...rule
|
|
1377
|
-
});
|
|
1378
|
-
};
|
|
1379
|
-
}
|
|
1380
|
-
function createRule5({
|
|
1381
|
-
create,
|
|
1382
|
-
defaultOptions,
|
|
1383
|
-
meta: meta3
|
|
1384
|
-
}) {
|
|
1385
|
-
return {
|
|
1386
|
-
create: (context) => {
|
|
1387
|
-
const optionsWithDefault = context.options.map((options, index) => {
|
|
1388
|
-
return {
|
|
1389
|
-
...defaultOptions[index] || {},
|
|
1390
|
-
...options || {}
|
|
1391
|
-
};
|
|
1392
|
-
});
|
|
1393
|
-
return create(context, optionsWithDefault);
|
|
1394
|
-
},
|
|
1395
|
-
defaultOptions,
|
|
1396
|
-
meta: meta3
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
function getPackageJsonRootNode2(context) {
|
|
1400
|
-
if (!context.filename.endsWith("package.json"))
|
|
1401
|
-
return;
|
|
1402
|
-
const ast = context.sourceCode.ast;
|
|
1403
|
-
const root = ast.body[0];
|
|
1404
|
-
if (root.expression.type === "JSONObjectExpression")
|
|
1405
|
-
return root.expression;
|
|
1406
|
-
}
|
|
1407
|
-
function* iterateDependencies2(context, fields) {
|
|
1408
|
-
const root = getPackageJsonRootNode2(context);
|
|
1409
|
-
if (!root)
|
|
1410
|
-
return;
|
|
1411
|
-
for (const fieldName of fields) {
|
|
1412
|
-
const path23 = fieldName.split(".");
|
|
1413
|
-
let node2 = root;
|
|
1414
|
-
for (let i = 0; i < path23.length; i++) {
|
|
1415
|
-
const item = node2.properties.find((property) => property.key.type === "JSONLiteral" && property.key.value === path23[i]);
|
|
1416
|
-
if (!item?.value || item.value.type !== "JSONObjectExpression") {
|
|
1417
|
-
node2 = void 0;
|
|
1418
|
-
break;
|
|
1419
|
-
}
|
|
1420
|
-
node2 = item.value;
|
|
1421
|
-
}
|
|
1422
|
-
if (!node2 || node2 === root)
|
|
1423
|
-
continue;
|
|
1424
|
-
for (const property of node2.properties) {
|
|
1425
|
-
if (property.value.type !== "JSONLiteral" || property.key.type !== "JSONLiteral")
|
|
1426
|
-
continue;
|
|
1427
|
-
if (typeof property.value.value !== "string")
|
|
1428
|
-
continue;
|
|
1429
|
-
const packageName = String(property.key.value);
|
|
1430
|
-
const specifier = String(property.value.value);
|
|
1431
|
-
yield {
|
|
1432
|
-
packageName,
|
|
1433
|
-
specifier,
|
|
1434
|
-
property
|
|
1435
|
-
};
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
function readPnpmWorkspace() {
|
|
1440
|
-
const filepath = findUpSimple.findUpSync("pnpm-workspace.yaml", { cwd: process2__default.default.cwd() });
|
|
1441
|
-
if (!filepath)
|
|
1442
|
-
throw new Error("pnpm-workspace.yaml not found");
|
|
1443
|
-
const content = fs__default.default.readFileSync(filepath, "utf-8");
|
|
1444
|
-
const workspace3 = pnpmWorkspaceYaml.parsePnpmWorkspaceYaml(content);
|
|
1445
|
-
let queueTimer;
|
|
1446
|
-
const queue = [];
|
|
1447
|
-
const write = () => {
|
|
1448
|
-
fs__default.default.writeFileSync(filepath, workspace3.toString());
|
|
1449
|
-
};
|
|
1450
|
-
const hasQueue = () => queueTimer != null;
|
|
1451
|
-
const queueChange = (fn, order) => {
|
|
1452
|
-
if (order === "pre")
|
|
1453
|
-
queue.unshift(fn);
|
|
1454
|
-
else
|
|
1455
|
-
queue.push(fn);
|
|
1456
|
-
if (queueTimer != null)
|
|
1457
|
-
clearTimeout(queueTimer);
|
|
1458
|
-
queueTimer = setTimeout(() => {
|
|
1459
|
-
queueTimer = void 0;
|
|
1460
|
-
const clone2 = [...queue];
|
|
1461
|
-
queue.length = 0;
|
|
1462
|
-
for (const fn2 of clone2)
|
|
1463
|
-
fn2(workspace3);
|
|
1464
|
-
if (workspace3.hasChanged())
|
|
1465
|
-
write();
|
|
1466
|
-
}, 1e3);
|
|
1467
|
-
};
|
|
1468
|
-
return {
|
|
1469
|
-
filepath,
|
|
1470
|
-
...workspace3,
|
|
1471
|
-
hasQueue,
|
|
1472
|
-
queueChange
|
|
1473
|
-
};
|
|
1474
|
-
}
|
|
1475
|
-
function getPnpmWorkspace() {
|
|
1476
|
-
if (workspaceLastRead2 && workspace2 && !workspace2.hasQueue() && Date.now() - workspaceLastRead2 > WORKSPACE_CACHE_TIME2) {
|
|
1477
|
-
workspace2 = void 0;
|
|
1478
|
-
}
|
|
1479
|
-
if (!workspace2) {
|
|
1480
|
-
workspace2 = readPnpmWorkspace();
|
|
1481
|
-
workspaceLastRead2 = Date.now();
|
|
1482
|
-
}
|
|
1483
|
-
return workspace2;
|
|
1484
|
-
}
|
|
1485
|
-
function getObjectPath2(obj, path23) {
|
|
1486
|
-
let current = obj;
|
|
1487
|
-
for (const key of path23) {
|
|
1488
|
-
current = current[key];
|
|
1489
|
-
if (!current)
|
|
1490
|
-
return void 0;
|
|
1491
|
-
}
|
|
1492
|
-
return current;
|
|
1493
|
-
}
|
|
1494
|
-
var name2, version3, blobUrl, createEslintRule, WORKSPACE_CACHE_TIME2, workspaceLastRead2, workspace2, RULE_NAME$4, DEFAULT_FIELDS$1, IGNORED_DEPENDENCIES2, enforceCatalog, RULE_NAME$3, preferWorkspaceSettings, RULE_NAME$2, DEFAULT_FIELDS3, validCatalog, rules$2, RULE_NAME$1, noDuplicateCatalogItem, RULE_NAME6, noUnusedCatalogItem, rules$1, rules4, plugin4, configsJson, configsYaml, configs4;
|
|
1495
|
-
var init_dist = __esm({
|
|
1496
|
-
"../../node_modules/.pnpm/eslint-plugin-pnpm@0.3.0_patch_hash=72dcde755c336eeca3e6170de1106fd85ecb66171e060788f80_f126904b94a1635d882631163ea19421/node_modules/eslint-plugin-pnpm/dist/index.mjs"() {
|
|
1497
|
-
init_cjs_shims();
|
|
1498
|
-
name2 = "eslint-plugin-pnpm";
|
|
1499
|
-
version3 = "0.3.0";
|
|
1500
|
-
blobUrl = "https://github.com/antfu/eslint-plugin-pnpm/blob/main/src/rules/";
|
|
1501
|
-
createEslintRule = RuleCreator4(
|
|
1502
|
-
(ruleName) => `${blobUrl}${ruleName}.test.ts`
|
|
1503
|
-
);
|
|
1504
|
-
WORKSPACE_CACHE_TIME2 = 1e4;
|
|
1505
|
-
RULE_NAME$4 = "json-enforce-catalog";
|
|
1506
|
-
DEFAULT_FIELDS$1 = [
|
|
1507
|
-
"dependencies",
|
|
1508
|
-
"devDependencies"
|
|
1509
|
-
];
|
|
1510
|
-
IGNORED_DEPENDENCIES2 = [
|
|
1511
|
-
"typescript"
|
|
1512
|
-
];
|
|
1513
|
-
enforceCatalog = createEslintRule({
|
|
1514
|
-
name: RULE_NAME$4,
|
|
1515
|
-
meta: {
|
|
1516
|
-
type: "layout",
|
|
1517
|
-
docs: {
|
|
1518
|
-
description: 'Enforce using "catalog:" in `package.json`'
|
|
1519
|
-
},
|
|
1520
|
-
fixable: "code",
|
|
1521
|
-
schema: [
|
|
1522
|
-
{
|
|
1523
|
-
type: "object",
|
|
1524
|
-
properties: {
|
|
1525
|
-
allowedProtocols: {
|
|
1526
|
-
type: "array",
|
|
1527
|
-
description: "Allowed protocols in specifier to not be converted to catalog",
|
|
1528
|
-
items: {
|
|
1529
|
-
type: "string"
|
|
1530
|
-
}
|
|
1531
|
-
},
|
|
1532
|
-
autofix: {
|
|
1533
|
-
type: "boolean",
|
|
1534
|
-
description: "Whether to autofix the linting error",
|
|
1535
|
-
default: true
|
|
1536
|
-
},
|
|
1537
|
-
defaultCatalog: {
|
|
1538
|
-
type: "string",
|
|
1539
|
-
description: "Default catalog to use when moving version to catalog with autofix"
|
|
1540
|
-
},
|
|
1541
|
-
reuseExistingCatalog: {
|
|
1542
|
-
type: "boolean",
|
|
1543
|
-
description: "Whether to reuse existing catalog when moving version to catalog with autofix",
|
|
1544
|
-
default: true
|
|
1545
|
-
},
|
|
1546
|
-
conflicts: {
|
|
1547
|
-
type: "string",
|
|
1548
|
-
description: "Strategy to handle conflicts when adding packages to catalogs",
|
|
1549
|
-
enum: ["new-catalog", "overrides", "error"],
|
|
1550
|
-
default: "new-catalog"
|
|
1551
|
-
},
|
|
1552
|
-
fields: {
|
|
1553
|
-
type: "array",
|
|
1554
|
-
description: "Fields to check for catalog",
|
|
1555
|
-
items: { type: "string" },
|
|
1556
|
-
default: DEFAULT_FIELDS$1
|
|
1557
|
-
},
|
|
1558
|
-
ignore: {
|
|
1559
|
-
type: "array",
|
|
1560
|
-
description: "A list of dependencies to ignore",
|
|
1561
|
-
items: { type: "string" },
|
|
1562
|
-
default: IGNORED_DEPENDENCIES2
|
|
1563
|
-
}
|
|
1564
|
-
},
|
|
1565
|
-
additionalProperties: false
|
|
1566
|
-
}
|
|
1567
|
-
],
|
|
1568
|
-
messages: {
|
|
1569
|
-
expectCatalog: 'Expect to use catalog instead of plain specifier, got "{{specifier}}" for package "{{packageName}}".'
|
|
1570
|
-
}
|
|
1571
|
-
},
|
|
1572
|
-
defaultOptions: [{}],
|
|
1573
|
-
create(context, [options]) {
|
|
1574
|
-
const {
|
|
1575
|
-
allowedProtocols = ["workspace", "link", "file"],
|
|
1576
|
-
defaultCatalog = "default",
|
|
1577
|
-
autofix = true,
|
|
1578
|
-
reuseExistingCatalog = true,
|
|
1579
|
-
conflicts = "new-catalog",
|
|
1580
|
-
fields = DEFAULT_FIELDS$1,
|
|
1581
|
-
ignore: ignore2 = IGNORED_DEPENDENCIES2
|
|
1582
|
-
} = options || {};
|
|
1583
|
-
for (const { packageName, specifier, property } of iterateDependencies2(context, fields)) {
|
|
1584
|
-
if (ignore2?.some((i) => i === packageName))
|
|
1585
|
-
continue;
|
|
1586
|
-
if (specifier.startsWith("catalog:"))
|
|
1587
|
-
continue;
|
|
1588
|
-
if (allowedProtocols?.some((p) => specifier.startsWith(p)))
|
|
1589
|
-
continue;
|
|
1590
|
-
const workspace3 = getPnpmWorkspace();
|
|
1591
|
-
if (!workspace3)
|
|
1592
|
-
return {};
|
|
1593
|
-
let targetCatalog = reuseExistingCatalog ? workspace3.getPackageCatalogs(packageName)[0] || defaultCatalog : defaultCatalog;
|
|
1594
|
-
const resolvedConflicts = workspace3.hasSpecifierConflicts(
|
|
1595
|
-
targetCatalog,
|
|
1596
|
-
packageName,
|
|
1597
|
-
specifier
|
|
1598
|
-
);
|
|
1599
|
-
let shouldFix = autofix;
|
|
1600
|
-
if (conflicts === "error") {
|
|
1601
|
-
if (resolvedConflicts.conflicts) {
|
|
1602
|
-
shouldFix = false;
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
|
-
if (conflicts === "new-catalog" && resolvedConflicts.conflicts) {
|
|
1606
|
-
targetCatalog = resolvedConflicts.newCatalogName;
|
|
1607
|
-
}
|
|
1608
|
-
context.report({
|
|
1609
|
-
node: property.value,
|
|
1610
|
-
messageId: "expectCatalog",
|
|
1611
|
-
data: {
|
|
1612
|
-
specifier,
|
|
1613
|
-
packageName
|
|
1614
|
-
},
|
|
1615
|
-
fix: shouldFix ? (fixer) => {
|
|
1616
|
-
workspace3.queueChange(() => {
|
|
1617
|
-
workspace3.setPackage(targetCatalog, packageName, specifier);
|
|
1618
|
-
});
|
|
1619
|
-
return fixer.replaceText(
|
|
1620
|
-
property.value,
|
|
1621
|
-
targetCatalog === "default" ? JSON.stringify("catalog:") : JSON.stringify(`catalog:${targetCatalog}`)
|
|
1622
|
-
);
|
|
1623
|
-
} : void 0
|
|
1624
|
-
});
|
|
1625
|
-
}
|
|
1626
|
-
return {};
|
|
1627
|
-
}
|
|
1628
|
-
});
|
|
1629
|
-
RULE_NAME$3 = "json-prefer-workspace-settings";
|
|
1630
|
-
preferWorkspaceSettings = createEslintRule({
|
|
1631
|
-
name: RULE_NAME$3,
|
|
1632
|
-
meta: {
|
|
1633
|
-
type: "layout",
|
|
1634
|
-
docs: {
|
|
1635
|
-
description: "Prefer having pnpm settings in `pnpm-workspace.yaml` instead of `package.json`. This would requires pnpm v10.6+, see https://github.com/orgs/pnpm/discussions/9037."
|
|
1636
|
-
},
|
|
1637
|
-
fixable: "code",
|
|
1638
|
-
schema: [
|
|
1639
|
-
{
|
|
1640
|
-
type: "object",
|
|
1641
|
-
properties: {
|
|
1642
|
-
autofix: {
|
|
1643
|
-
type: "boolean",
|
|
1644
|
-
description: "Whether to autofix the linting error",
|
|
1645
|
-
default: true
|
|
1646
|
-
}
|
|
1647
|
-
},
|
|
1648
|
-
additionalProperties: false
|
|
1649
|
-
}
|
|
1650
|
-
],
|
|
1651
|
-
messages: {
|
|
1652
|
-
unexpectedPnpmSettings: "Unexpected pnpm settings in package.json, should move to pnpm-workspace.yaml"
|
|
1653
|
-
}
|
|
1654
|
-
},
|
|
1655
|
-
defaultOptions: [{}],
|
|
1656
|
-
create(context, [options = {}]) {
|
|
1657
|
-
const {
|
|
1658
|
-
autofix = true
|
|
1659
|
-
} = options || {};
|
|
1660
|
-
const root = getPackageJsonRootNode2(context);
|
|
1661
|
-
if (!root)
|
|
1662
|
-
return {};
|
|
1663
|
-
const pnpmNode = root.properties.find((property) => property.key.type === "JSONLiteral" && property.key.value === "pnpm");
|
|
1664
|
-
if (!pnpmNode)
|
|
1665
|
-
return {};
|
|
1666
|
-
const workspace3 = getPnpmWorkspace();
|
|
1667
|
-
if (!workspace3)
|
|
1668
|
-
return {};
|
|
1669
|
-
context.report({
|
|
1670
|
-
node: pnpmNode,
|
|
1671
|
-
messageId: "unexpectedPnpmSettings",
|
|
1672
|
-
fix: autofix ? (fixer) => {
|
|
1673
|
-
const json = JSON.parse(context.sourceCode.text);
|
|
1674
|
-
const pnpmSettings = json.pnpm;
|
|
1675
|
-
const flatValueParis = [];
|
|
1676
|
-
function traverse(value, paths) {
|
|
1677
|
-
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
1678
|
-
for (const key in value) {
|
|
1679
|
-
traverse(value[key], [...paths, key]);
|
|
1680
|
-
}
|
|
1681
|
-
} else {
|
|
1682
|
-
flatValueParis.push([paths, value]);
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
traverse(pnpmSettings, []);
|
|
1686
|
-
workspace3.queueChange(() => {
|
|
1687
|
-
for (const [paths, value] of flatValueParis) {
|
|
1688
|
-
workspace3.setPath(paths, value);
|
|
1689
|
-
}
|
|
1690
|
-
});
|
|
1691
|
-
let start = pnpmNode.range[0];
|
|
1692
|
-
let end = pnpmNode.range[1];
|
|
1693
|
-
const before = context.sourceCode.getTokenBefore(pnpmNode);
|
|
1694
|
-
if (before)
|
|
1695
|
-
start = before.range[1];
|
|
1696
|
-
const after = context.sourceCode.getTokenAfter(pnpmNode);
|
|
1697
|
-
if (after?.type === "Punctuator" && after.value === ",")
|
|
1698
|
-
end = after.range[1];
|
|
1699
|
-
return fixer.removeRange([start, end]);
|
|
1700
|
-
} : void 0
|
|
1701
|
-
});
|
|
1702
|
-
return {};
|
|
1703
|
-
}
|
|
1704
|
-
});
|
|
1705
|
-
RULE_NAME$2 = "json-valid-catalog";
|
|
1706
|
-
DEFAULT_FIELDS3 = [
|
|
1707
|
-
"dependencies",
|
|
1708
|
-
"devDependencies",
|
|
1709
|
-
"optionalDependencies",
|
|
1710
|
-
"peerDependencies",
|
|
1711
|
-
"resolutions",
|
|
1712
|
-
"overrides",
|
|
1713
|
-
"pnpm.overrides"
|
|
1714
|
-
];
|
|
1715
|
-
validCatalog = createEslintRule({
|
|
1716
|
-
name: RULE_NAME$2,
|
|
1717
|
-
meta: {
|
|
1718
|
-
type: "layout",
|
|
1719
|
-
docs: {
|
|
1720
|
-
description: "Enforce using valid catalog in `package.json`"
|
|
1721
|
-
},
|
|
1722
|
-
fixable: "code",
|
|
1723
|
-
schema: [
|
|
1724
|
-
{
|
|
1725
|
-
type: "object",
|
|
1726
|
-
properties: {
|
|
1727
|
-
autoInsert: {
|
|
1728
|
-
type: "boolean",
|
|
1729
|
-
description: "Whether to auto insert to catalog if missing",
|
|
1730
|
-
default: true
|
|
1731
|
-
},
|
|
1732
|
-
autoInsertDefaultSpecifier: {
|
|
1733
|
-
type: "string",
|
|
1734
|
-
description: "Default specifier to use when auto inserting to catalog",
|
|
1735
|
-
default: "^0.0.0"
|
|
1736
|
-
},
|
|
1737
|
-
autofix: {
|
|
1738
|
-
type: "boolean",
|
|
1739
|
-
description: "Whether to autofix the linting error",
|
|
1740
|
-
default: true
|
|
1741
|
-
},
|
|
1742
|
-
enforceNoConflict: {
|
|
1743
|
-
type: "boolean",
|
|
1744
|
-
description: "Whether to enforce no conflicts when adding packages to catalogs (will create version-specific catalogs)",
|
|
1745
|
-
default: true
|
|
1746
|
-
},
|
|
1747
|
-
fields: {
|
|
1748
|
-
type: "array",
|
|
1749
|
-
description: "Fields to check for catalog",
|
|
1750
|
-
default: DEFAULT_FIELDS3
|
|
1751
|
-
}
|
|
1752
|
-
},
|
|
1753
|
-
additionalProperties: false
|
|
1754
|
-
}
|
|
1755
|
-
],
|
|
1756
|
-
messages: {
|
|
1757
|
-
invalidCatalog: 'Catalog "{{specifier}}" for package "{{packageName}}" is not defined in `pnpm-workspace.yaml`.'
|
|
1758
|
-
}
|
|
1759
|
-
},
|
|
1760
|
-
defaultOptions: [{}],
|
|
1761
|
-
create(context, [options = {}]) {
|
|
1762
|
-
const {
|
|
1763
|
-
autoInsert = true,
|
|
1764
|
-
autofix = true,
|
|
1765
|
-
autoInsertDefaultSpecifier = "^0.0.0",
|
|
1766
|
-
fields = DEFAULT_FIELDS3
|
|
1767
|
-
} = options || {};
|
|
1768
|
-
for (const { packageName, specifier, property } of iterateDependencies2(context, fields)) {
|
|
1769
|
-
if (!specifier.startsWith("catalog:"))
|
|
1770
|
-
continue;
|
|
1771
|
-
const workspace3 = getPnpmWorkspace();
|
|
1772
|
-
if (!workspace3)
|
|
1773
|
-
return {};
|
|
1774
|
-
const currentCatalog = specifier.replace(/^catalog:/, "").trim() || "default";
|
|
1775
|
-
const existingCatalogs = workspace3.getPackageCatalogs(packageName);
|
|
1776
|
-
if (!existingCatalogs.includes(currentCatalog)) {
|
|
1777
|
-
context.report({
|
|
1778
|
-
node: property.value,
|
|
1779
|
-
messageId: "invalidCatalog",
|
|
1780
|
-
data: {
|
|
1781
|
-
specifier,
|
|
1782
|
-
packageName
|
|
1783
|
-
},
|
|
1784
|
-
fix: !autofix || !autoInsert && !existingCatalogs.length ? void 0 : (fixer) => {
|
|
1785
|
-
let catalog = existingCatalogs[0];
|
|
1786
|
-
if (!catalog && autoInsert) {
|
|
1787
|
-
catalog = currentCatalog;
|
|
1788
|
-
workspace3.queueChange(() => {
|
|
1789
|
-
workspace3.setPackage(catalog, packageName, autoInsertDefaultSpecifier);
|
|
1790
|
-
}, "pre");
|
|
1791
|
-
}
|
|
1792
|
-
return fixer.replaceText(
|
|
1793
|
-
property.value,
|
|
1794
|
-
catalog === "default" ? JSON.stringify("catalog:") : JSON.stringify(`catalog:${catalog}`)
|
|
1795
|
-
);
|
|
1796
|
-
}
|
|
1797
|
-
});
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
return {};
|
|
1801
|
-
}
|
|
1802
|
-
});
|
|
1803
|
-
rules$2 = {
|
|
1804
|
-
"json-enforce-catalog": enforceCatalog,
|
|
1805
|
-
"json-valid-catalog": validCatalog,
|
|
1806
|
-
"json-prefer-workspace-settings": preferWorkspaceSettings
|
|
1807
|
-
};
|
|
1808
|
-
RULE_NAME$1 = "yaml-no-duplicate-catalog-item";
|
|
1809
|
-
noDuplicateCatalogItem = createEslintRule({
|
|
1810
|
-
name: RULE_NAME$1,
|
|
1811
|
-
meta: {
|
|
1812
|
-
type: "problem",
|
|
1813
|
-
docs: {
|
|
1814
|
-
description: "Disallow unused catalogs in `pnpm-workspace.yaml`"
|
|
1815
|
-
},
|
|
1816
|
-
fixable: "code",
|
|
1817
|
-
schema: [
|
|
1818
|
-
{
|
|
1819
|
-
type: "object",
|
|
1820
|
-
properties: {
|
|
1821
|
-
allow: {
|
|
1822
|
-
type: "array",
|
|
1823
|
-
items: { type: "string" }
|
|
1824
|
-
}
|
|
1825
|
-
},
|
|
1826
|
-
additionalProperties: false
|
|
1827
|
-
}
|
|
1828
|
-
],
|
|
1829
|
-
messages: {
|
|
1830
|
-
duplicateCatalogItem: 'Catalog item "{{name}}" is already defined in the "{{existingCatalog}}" catalog. You may want to remove one of them.'
|
|
1831
|
-
}
|
|
1832
|
-
},
|
|
1833
|
-
defaultOptions: [{}],
|
|
1834
|
-
create(context, [options = {}]) {
|
|
1835
|
-
if (pathe.basename(context.filename) !== "pnpm-workspace.yaml")
|
|
1836
|
-
return {};
|
|
1837
|
-
const workspace3 = getPnpmWorkspace();
|
|
1838
|
-
if (!workspace3 || pathe.normalize(workspace3.filepath) !== pathe.normalize(context.filename))
|
|
1839
|
-
return {};
|
|
1840
|
-
if (workspace3.hasChanged() || workspace3.hasQueue())
|
|
1841
|
-
return {};
|
|
1842
|
-
const { allow = [] } = options;
|
|
1843
|
-
workspace3.setContent(context.sourceCode.text);
|
|
1844
|
-
const json = workspace3.toJSON() || {};
|
|
1845
|
-
const exists = /* @__PURE__ */ new Map();
|
|
1846
|
-
const catalogs = {
|
|
1847
|
-
...json.catalogs,
|
|
1848
|
-
default: json.catalog
|
|
1849
|
-
};
|
|
1850
|
-
const doc = workspace3.getDocument();
|
|
1851
|
-
for (const [catalog, object2] of Object.entries(catalogs)) {
|
|
1852
|
-
if (!object2)
|
|
1853
|
-
continue;
|
|
1854
|
-
for (const key of Object.keys(object2)) {
|
|
1855
|
-
if (allow.includes(key))
|
|
1856
|
-
continue;
|
|
1857
|
-
if (exists.has(key)) {
|
|
1858
|
-
const existingCatalog = exists.get(key);
|
|
1859
|
-
const node2 = doc.getIn(catalog === "default" ? ["catalog", key] : ["catalogs", catalog, key], true);
|
|
1860
|
-
const start = context.sourceCode.getLocFromIndex(node2.range[0]);
|
|
1861
|
-
const end = context.sourceCode.getLocFromIndex(node2.range[1]);
|
|
1862
|
-
context.report({
|
|
1863
|
-
loc: {
|
|
1864
|
-
start,
|
|
1865
|
-
end
|
|
1866
|
-
},
|
|
1867
|
-
messageId: "duplicateCatalogItem",
|
|
1868
|
-
data: {
|
|
1869
|
-
name: key,
|
|
1870
|
-
currentCatalog: catalog,
|
|
1871
|
-
existingCatalog
|
|
1872
|
-
}
|
|
1873
|
-
});
|
|
1874
|
-
} else {
|
|
1875
|
-
exists.set(key, catalog);
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
}
|
|
1879
|
-
return {};
|
|
1880
|
-
}
|
|
1881
|
-
});
|
|
1882
|
-
RULE_NAME6 = "yaml-no-unused-catalog-item";
|
|
1883
|
-
noUnusedCatalogItem = createEslintRule({
|
|
1884
|
-
name: RULE_NAME6,
|
|
1885
|
-
meta: {
|
|
1886
|
-
type: "problem",
|
|
1887
|
-
docs: {
|
|
1888
|
-
description: "Disallow unused catalogs in `pnpm-workspace.yaml`"
|
|
1889
|
-
},
|
|
1890
|
-
fixable: "code",
|
|
1891
|
-
schema: [],
|
|
1892
|
-
messages: {
|
|
1893
|
-
unusedCatalogItem: 'Catalog item "{{catalogItem}}" is not used in any package.json.'
|
|
1894
|
-
}
|
|
1895
|
-
},
|
|
1896
|
-
defaultOptions: [],
|
|
1897
|
-
create(context) {
|
|
1898
|
-
if (pathe.basename(context.filename) !== "pnpm-workspace.yaml")
|
|
1899
|
-
return {};
|
|
1900
|
-
const workspace3 = getPnpmWorkspace();
|
|
1901
|
-
if (!workspace3 || pathe.normalize(workspace3.filepath) !== pathe.normalize(context.filename))
|
|
1902
|
-
return {};
|
|
1903
|
-
if (workspace3.hasChanged() || workspace3.hasQueue())
|
|
1904
|
-
return {};
|
|
1905
|
-
workspace3.setContent(context.sourceCode.text);
|
|
1906
|
-
const parsed = workspace3.toJSON() || {};
|
|
1907
|
-
const root = pathe.resolve(pathe.dirname(context.filename));
|
|
1908
|
-
const entries = /* @__PURE__ */ new Map();
|
|
1909
|
-
const doc = workspace3.getDocument();
|
|
1910
|
-
const catalogs = {
|
|
1911
|
-
default: doc.getIn(["catalog"])
|
|
1912
|
-
};
|
|
1913
|
-
for (const item of doc.getIn(["catalogs"])?.items || [])
|
|
1914
|
-
catalogs[String(item.key)] = item.value;
|
|
1915
|
-
for (const [catalog, map] of Object.entries(catalogs)) {
|
|
1916
|
-
if (!map)
|
|
1917
|
-
continue;
|
|
1918
|
-
for (const item of map.items) {
|
|
1919
|
-
entries.set(`${String(item.key)}:${catalog}`, item);
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
if (entries.size === 0)
|
|
1923
|
-
return {};
|
|
1924
|
-
const dirs = parsed.packages ? tinyglobby.globSync(parsed.packages, {
|
|
1925
|
-
cwd: root,
|
|
1926
|
-
dot: false,
|
|
1927
|
-
ignore: [
|
|
1928
|
-
"**/node_modules/**",
|
|
1929
|
-
"**/dist/**",
|
|
1930
|
-
"**/build/**",
|
|
1931
|
-
"**/dist/**",
|
|
1932
|
-
"**/dist/**"
|
|
1933
|
-
],
|
|
1934
|
-
absolute: true,
|
|
1935
|
-
expandDirectories: false,
|
|
1936
|
-
onlyDirectories: true
|
|
1937
|
-
}) : [];
|
|
1938
|
-
dirs.push(root);
|
|
1939
|
-
const packages = dirs.map((dir) => pathe.resolve(dir, "package.json")).filter((x) => fs.existsSync(x)).sort();
|
|
1940
|
-
const FIELDS2 = [
|
|
1941
|
-
"dependencies",
|
|
1942
|
-
"devDependencies",
|
|
1943
|
-
"peerDependencies",
|
|
1944
|
-
"optionalDependencies",
|
|
1945
|
-
"overrides",
|
|
1946
|
-
"resolutions",
|
|
1947
|
-
"pnpm.overrides"
|
|
1948
|
-
];
|
|
1949
|
-
for (const path23 of packages) {
|
|
1950
|
-
const pkg = JSON.parse(fs.readFileSync(path23, "utf-8"));
|
|
1951
|
-
for (const field of FIELDS2) {
|
|
1952
|
-
const map = getObjectPath2(pkg, field.split("."));
|
|
1953
|
-
if (!map)
|
|
1954
|
-
continue;
|
|
1955
|
-
for (const [name3, value] of Object.entries(map)) {
|
|
1956
|
-
if (!value.startsWith("catalog:"))
|
|
1957
|
-
continue;
|
|
1958
|
-
const catalog = value.slice(8) || "default";
|
|
1959
|
-
const key = `${name3}:${catalog}`;
|
|
1960
|
-
entries.delete(key);
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
if (entries.size > 0) {
|
|
1965
|
-
for (const [key, value] of Array.from(entries.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
1966
|
-
const start = context.sourceCode.getLocFromIndex(value.key.range[0]);
|
|
1967
|
-
const end = context.sourceCode.getLocFromIndex(value.value.range.at(-1));
|
|
1968
|
-
context.report({
|
|
1969
|
-
loc: {
|
|
1970
|
-
start,
|
|
1971
|
-
end
|
|
1972
|
-
},
|
|
1973
|
-
messageId: "unusedCatalogItem",
|
|
1974
|
-
data: { catalogItem: key }
|
|
1975
|
-
});
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
return {};
|
|
1979
|
-
}
|
|
1980
|
-
});
|
|
1981
|
-
rules$1 = {
|
|
1982
|
-
"yaml-no-unused-catalog-item": noUnusedCatalogItem,
|
|
1983
|
-
"yaml-no-duplicate-catalog-item": noDuplicateCatalogItem
|
|
1984
|
-
};
|
|
1985
|
-
rules4 = {
|
|
1986
|
-
...rules$2,
|
|
1987
|
-
...rules$1
|
|
1988
|
-
};
|
|
1989
|
-
plugin4 = {
|
|
1278
|
+
init_package();
|
|
1279
|
+
init_json_enforce_catalog();
|
|
1280
|
+
init_json_no_duplicate_catalog_item();
|
|
1281
|
+
init_json_no_unused_catalog_item();
|
|
1282
|
+
init_json_valid_catalog();
|
|
1283
|
+
plugin2 = {
|
|
1990
1284
|
meta: {
|
|
1991
|
-
name:
|
|
1992
|
-
version:
|
|
1285
|
+
name: "bun",
|
|
1286
|
+
version: package_default2.version
|
|
1993
1287
|
},
|
|
1994
|
-
rules:
|
|
1288
|
+
rules: {
|
|
1289
|
+
"json-enforce-catalog": json_enforce_catalog_default,
|
|
1290
|
+
"json-valid-catalog": json_valid_catalog_default,
|
|
1291
|
+
"json-no-unused-catalog-item": json_no_unused_catalog_item_default,
|
|
1292
|
+
"json-no-duplicate-catalog-item": json_no_duplicate_catalog_item_default
|
|
1293
|
+
}
|
|
1995
1294
|
};
|
|
1996
|
-
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
var config3, recommended_default2;
|
|
1298
|
+
var init_recommended = __esm({
|
|
1299
|
+
"../eslint-plugin-bun/src/configs/recommended.ts"() {
|
|
1300
|
+
init_cjs_shims();
|
|
1301
|
+
init_globs();
|
|
1302
|
+
init_plugin();
|
|
1303
|
+
config3 = [
|
|
1997
1304
|
{
|
|
1998
|
-
name: "
|
|
1999
|
-
files: [
|
|
2000
|
-
"package.json",
|
|
2001
|
-
"**/package.json"
|
|
2002
|
-
],
|
|
2003
|
-
languageOptions: {
|
|
2004
|
-
parser: parserJsonc__namespace
|
|
2005
|
-
},
|
|
1305
|
+
name: "bun/recommended/setup",
|
|
2006
1306
|
plugins: {
|
|
2007
|
-
|
|
2008
|
-
},
|
|
2009
|
-
rules: {
|
|
2010
|
-
"pnpm/json-enforce-catalog": "error",
|
|
2011
|
-
"pnpm/json-valid-catalog": "error",
|
|
2012
|
-
"pnpm/json-prefer-workspace-settings": "error"
|
|
1307
|
+
bun: plugin2
|
|
2013
1308
|
}
|
|
2014
|
-
}
|
|
2015
|
-
];
|
|
2016
|
-
configsYaml = [
|
|
1309
|
+
},
|
|
2017
1310
|
{
|
|
2018
|
-
name: "
|
|
2019
|
-
|
|
1311
|
+
name: "bun/recommended/package-json",
|
|
1312
|
+
ignores: GLOB_EXCLUDE,
|
|
1313
|
+
files: ["package.json", "**/package.json"],
|
|
2020
1314
|
languageOptions: {
|
|
2021
|
-
parser:
|
|
2022
|
-
},
|
|
2023
|
-
plugins: {
|
|
2024
|
-
pnpm: plugin4
|
|
1315
|
+
parser: parserJsonc__default.default
|
|
2025
1316
|
},
|
|
2026
1317
|
rules: {
|
|
2027
|
-
"
|
|
2028
|
-
|
|
1318
|
+
"bun/json-enforce-catalog": [
|
|
1319
|
+
"error",
|
|
1320
|
+
{
|
|
1321
|
+
autofix: true,
|
|
1322
|
+
allowedProtocols: ["workspace", "link", "file"],
|
|
1323
|
+
defaultCatalog: "default",
|
|
1324
|
+
reuseExistingCatalog: true,
|
|
1325
|
+
conflicts: "overrides",
|
|
1326
|
+
fields: ["dependencies", "devDependencies"],
|
|
1327
|
+
ignore: ["typescript"]
|
|
1328
|
+
}
|
|
1329
|
+
],
|
|
1330
|
+
"bun/json-valid-catalog": "error",
|
|
1331
|
+
"bun/json-no-unused-catalog-item": "error",
|
|
1332
|
+
"bun/json-no-duplicate-catalog-item": "error"
|
|
2029
1333
|
}
|
|
2030
1334
|
}
|
|
2031
1335
|
];
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
1336
|
+
recommended_default2 = config3;
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
// ../eslint-plugin-bun/src/configs/index.ts
|
|
1341
|
+
var configs2;
|
|
1342
|
+
var init_configs = __esm({
|
|
1343
|
+
"../eslint-plugin-bun/src/configs/index.ts"() {
|
|
1344
|
+
init_cjs_shims();
|
|
1345
|
+
init_recommended();
|
|
1346
|
+
configs2 = {
|
|
1347
|
+
recommended: recommended_default2
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
});
|
|
1351
|
+
|
|
1352
|
+
// ../eslint-plugin-bun/src/index.ts
|
|
1353
|
+
var src_exports = {};
|
|
1354
|
+
__export(src_exports, {
|
|
1355
|
+
configs: () => configs2,
|
|
1356
|
+
default: () => src_default2,
|
|
1357
|
+
rules: () => rules2
|
|
1358
|
+
});
|
|
1359
|
+
var eslintPlugin2, src_default2, rules2;
|
|
1360
|
+
var init_src = __esm({
|
|
1361
|
+
"../eslint-plugin-bun/src/index.ts"() {
|
|
1362
|
+
init_cjs_shims();
|
|
1363
|
+
init_configs();
|
|
1364
|
+
init_plugin();
|
|
1365
|
+
eslintPlugin2 = {
|
|
1366
|
+
...plugin2,
|
|
1367
|
+
configs: configs2
|
|
2040
1368
|
};
|
|
2041
|
-
|
|
1369
|
+
src_default2 = eslintPlugin2;
|
|
1370
|
+
rules2 = plugin2.rules;
|
|
2042
1371
|
}
|
|
2043
1372
|
});
|
|
2044
1373
|
|
|
@@ -2048,10 +1377,14 @@ var init_package2 = __esm({
|
|
|
2048
1377
|
"../eslint-plugin-pnpm/package.json"() {
|
|
2049
1378
|
package_default3 = {
|
|
2050
1379
|
name: "@storm-software/eslint-plugin-pnpm",
|
|
2051
|
-
version: "0.0.
|
|
1380
|
+
version: "0.0.79",
|
|
2052
1381
|
private: false,
|
|
2053
1382
|
description: "An ESLint Plugin that enforces PNPM-related rules in Storm Software projects.",
|
|
2054
|
-
keywords: [
|
|
1383
|
+
keywords: [
|
|
1384
|
+
"eslint",
|
|
1385
|
+
"eslint-plugin",
|
|
1386
|
+
"storm-software"
|
|
1387
|
+
],
|
|
2055
1388
|
homepage: "https://stormsoftware.com",
|
|
2056
1389
|
bugs: {
|
|
2057
1390
|
url: "https://stormsoftware.com/support",
|
|
@@ -2097,7 +1430,9 @@ var init_package2 = __esm({
|
|
|
2097
1430
|
},
|
|
2098
1431
|
types: "./dist/index.d.ts",
|
|
2099
1432
|
typings: "dist/index.d.mts",
|
|
2100
|
-
files: [
|
|
1433
|
+
files: [
|
|
1434
|
+
"dist"
|
|
1435
|
+
],
|
|
2101
1436
|
dependencies: {
|
|
2102
1437
|
"@eslint/core": "^1.2.1",
|
|
2103
1438
|
"@storm-software/package-constants": "workspace:*",
|
|
@@ -2147,16 +1482,13 @@ var init_package2 = __esm({
|
|
|
2147
1482
|
};
|
|
2148
1483
|
}
|
|
2149
1484
|
});
|
|
2150
|
-
|
|
2151
|
-
// ../eslint-plugin-pnpm/src/plugin.ts
|
|
2152
|
-
var plugin5;
|
|
1485
|
+
var plugin4;
|
|
2153
1486
|
var init_plugin2 = __esm({
|
|
2154
1487
|
"../eslint-plugin-pnpm/src/plugin.ts"() {
|
|
2155
1488
|
init_cjs_shims();
|
|
2156
|
-
init_dist();
|
|
2157
1489
|
init_package2();
|
|
2158
|
-
|
|
2159
|
-
...
|
|
1490
|
+
plugin4 = {
|
|
1491
|
+
...base__default.default,
|
|
2160
1492
|
meta: {
|
|
2161
1493
|
name: "pnpm",
|
|
2162
1494
|
version: package_default3.version
|
|
@@ -2174,7 +1506,7 @@ var init_recommended2 = __esm({
|
|
|
2174
1506
|
{
|
|
2175
1507
|
name: "pnpm/recommended/setup",
|
|
2176
1508
|
plugins: {
|
|
2177
|
-
pnpm:
|
|
1509
|
+
pnpm: plugin4
|
|
2178
1510
|
}
|
|
2179
1511
|
},
|
|
2180
1512
|
{
|
|
@@ -2182,7 +1514,7 @@ var init_recommended2 = __esm({
|
|
|
2182
1514
|
ignores: GLOB_EXCLUDE,
|
|
2183
1515
|
files: ["package.json", "**/package.json"],
|
|
2184
1516
|
languageOptions: {
|
|
2185
|
-
parser:
|
|
1517
|
+
parser: parserJsonc__default.default
|
|
2186
1518
|
},
|
|
2187
1519
|
rules: {
|
|
2188
1520
|
"pnpm/json-enforce-catalog": [
|
|
@@ -2205,7 +1537,7 @@ var init_recommended2 = __esm({
|
|
|
2205
1537
|
ignores: GLOB_EXCLUDE,
|
|
2206
1538
|
files: ["pnpm-workspace.yaml", "**/pnpm-workspace.yaml"],
|
|
2207
1539
|
languageOptions: {
|
|
2208
|
-
parser:
|
|
1540
|
+
parser: parserYaml__default.default
|
|
2209
1541
|
},
|
|
2210
1542
|
rules: {
|
|
2211
1543
|
"pnpm/yaml-no-unused-catalog-item": "error",
|
|
@@ -2218,12 +1550,12 @@ var init_recommended2 = __esm({
|
|
|
2218
1550
|
});
|
|
2219
1551
|
|
|
2220
1552
|
// ../eslint-plugin-pnpm/src/configs/index.ts
|
|
2221
|
-
var
|
|
1553
|
+
var configs4;
|
|
2222
1554
|
var init_configs2 = __esm({
|
|
2223
1555
|
"../eslint-plugin-pnpm/src/configs/index.ts"() {
|
|
2224
1556
|
init_cjs_shims();
|
|
2225
1557
|
init_recommended2();
|
|
2226
|
-
|
|
1558
|
+
configs4 = {
|
|
2227
1559
|
recommended: recommended_default5
|
|
2228
1560
|
};
|
|
2229
1561
|
}
|
|
@@ -2232,22 +1564,22 @@ var init_configs2 = __esm({
|
|
|
2232
1564
|
// ../eslint-plugin-pnpm/src/index.ts
|
|
2233
1565
|
var src_exports2 = {};
|
|
2234
1566
|
__export(src_exports2, {
|
|
2235
|
-
configs: () =>
|
|
1567
|
+
configs: () => configs4,
|
|
2236
1568
|
default: () => src_default3,
|
|
2237
|
-
rules: () =>
|
|
1569
|
+
rules: () => rules4
|
|
2238
1570
|
});
|
|
2239
|
-
var eslintPlugin3, src_default3,
|
|
1571
|
+
var eslintPlugin3, src_default3, rules4;
|
|
2240
1572
|
var init_src2 = __esm({
|
|
2241
1573
|
"../eslint-plugin-pnpm/src/index.ts"() {
|
|
2242
1574
|
init_cjs_shims();
|
|
2243
1575
|
init_configs2();
|
|
2244
1576
|
init_plugin2();
|
|
2245
1577
|
eslintPlugin3 = {
|
|
2246
|
-
...
|
|
2247
|
-
configs:
|
|
1578
|
+
...plugin4,
|
|
1579
|
+
configs: configs4
|
|
2248
1580
|
};
|
|
2249
1581
|
src_default3 = eslintPlugin3;
|
|
2250
|
-
|
|
1582
|
+
rules4 = plugin4.rules;
|
|
2251
1583
|
}
|
|
2252
1584
|
});
|
|
2253
1585
|
|
|
@@ -2819,9 +2151,9 @@ var require_stylesheet = __commonJS({
|
|
|
2819
2151
|
},
|
|
2820
2152
|
getStyleReferenceFromExpression: function(node2) {
|
|
2821
2153
|
const result = [];
|
|
2822
|
-
const
|
|
2823
|
-
if (
|
|
2824
|
-
result.push(
|
|
2154
|
+
const name2 = astHelpers.getObjectName(node2);
|
|
2155
|
+
if (name2) {
|
|
2156
|
+
result.push(name2);
|
|
2825
2157
|
}
|
|
2826
2158
|
const property = astHelpers.getPropertyName(node2);
|
|
2827
2159
|
if (property) {
|
|
@@ -3217,10 +2549,10 @@ var require_split_platform_components = __commonJS({
|
|
|
3217
2549
|
return node2.name;
|
|
3218
2550
|
}
|
|
3219
2551
|
}
|
|
3220
|
-
function hasNodeWithName(nodes,
|
|
2552
|
+
function hasNodeWithName(nodes, name2) {
|
|
3221
2553
|
return nodes.some((node2) => {
|
|
3222
2554
|
const nodeName = getName(node2);
|
|
3223
|
-
return nodeName && nodeName.includes(
|
|
2555
|
+
return nodeName && nodeName.includes(name2);
|
|
3224
2556
|
});
|
|
3225
2557
|
}
|
|
3226
2558
|
function reportErrors(components, filename) {
|
|
@@ -3302,8 +2634,8 @@ var require_no_raw_text = __commonJS({
|
|
|
3302
2634
|
let curNode = parent;
|
|
3303
2635
|
while (curNode) {
|
|
3304
2636
|
if (curNode.type === "JSXElement") {
|
|
3305
|
-
const
|
|
3306
|
-
if (allowedElements.includes(
|
|
2637
|
+
const name2 = elementName(curNode);
|
|
2638
|
+
if (allowedElements.includes(name2)) {
|
|
3307
2639
|
return true;
|
|
3308
2640
|
}
|
|
3309
2641
|
}
|
|
@@ -3475,10 +2807,10 @@ var require_eslint_plugin_react_native = __commonJS({
|
|
|
3475
2807
|
"no-raw-text": require_no_raw_text(),
|
|
3476
2808
|
"no-single-element-style-arrays": require_no_single_element_style_arrays()
|
|
3477
2809
|
};
|
|
3478
|
-
function configureAsError(
|
|
2810
|
+
function configureAsError(rules6) {
|
|
3479
2811
|
const result = {};
|
|
3480
|
-
for (const key in
|
|
3481
|
-
if (!
|
|
2812
|
+
for (const key in rules6) {
|
|
2813
|
+
if (!rules6.hasOwnProperty(key)) {
|
|
3482
2814
|
continue;
|
|
3483
2815
|
}
|
|
3484
2816
|
result["react-native/" + key] = 2;
|
|
@@ -3520,550 +2852,20 @@ var require_eslint_plugin_react_native = __commonJS({
|
|
|
3520
2852
|
}
|
|
3521
2853
|
});
|
|
3522
2854
|
|
|
3523
|
-
// ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=c262176eba68bfd8898c896d48ca12af2147a650ca7a9cbfe8edf1cf981cdbc9/node_modules/eslint-plugin-tsdoc/lib/Debug.js
|
|
3524
|
-
var require_Debug = __commonJS({
|
|
3525
|
-
"../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=c262176eba68bfd8898c896d48ca12af2147a650ca7a9cbfe8edf1cf981cdbc9/node_modules/eslint-plugin-tsdoc/lib/Debug.js"(exports) {
|
|
3526
|
-
init_cjs_shims();
|
|
3527
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3528
|
-
exports.Debug = void 0;
|
|
3529
|
-
var Debug = class {
|
|
3530
|
-
// To debug the plugin, temporarily uncomment the body of this function
|
|
3531
|
-
static log(message2) {
|
|
3532
|
-
}
|
|
3533
|
-
};
|
|
3534
|
-
exports.Debug = Debug;
|
|
3535
|
-
}
|
|
3536
|
-
});
|
|
3537
|
-
|
|
3538
|
-
// ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=c262176eba68bfd8898c896d48ca12af2147a650ca7a9cbfe8edf1cf981cdbc9/node_modules/eslint-plugin-tsdoc/lib/ConfigCache.js
|
|
3539
|
-
var require_ConfigCache = __commonJS({
|
|
3540
|
-
"../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=c262176eba68bfd8898c896d48ca12af2147a650ca7a9cbfe8edf1cf981cdbc9/node_modules/eslint-plugin-tsdoc/lib/ConfigCache.js"(exports) {
|
|
3541
|
-
init_cjs_shims();
|
|
3542
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3543
|
-
if (k2 === void 0) k2 = k;
|
|
3544
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3545
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3546
|
-
desc = { enumerable: true, get: function() {
|
|
3547
|
-
return m[k];
|
|
3548
|
-
} };
|
|
3549
|
-
}
|
|
3550
|
-
Object.defineProperty(o, k2, desc);
|
|
3551
|
-
}) : (function(o, m, k, k2) {
|
|
3552
|
-
if (k2 === void 0) k2 = k;
|
|
3553
|
-
o[k2] = m[k];
|
|
3554
|
-
}));
|
|
3555
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
3556
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3557
|
-
}) : function(o, v) {
|
|
3558
|
-
o["default"] = v;
|
|
3559
|
-
});
|
|
3560
|
-
var __importStar = exports && exports.__importStar || function(mod) {
|
|
3561
|
-
if (mod && mod.__esModule) return mod;
|
|
3562
|
-
var result = {};
|
|
3563
|
-
if (mod != null) {
|
|
3564
|
-
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3565
|
-
}
|
|
3566
|
-
__setModuleDefault(result, mod);
|
|
3567
|
-
return result;
|
|
3568
|
-
};
|
|
3569
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3570
|
-
exports.ConfigCache = void 0;
|
|
3571
|
-
var tsdoc_config_1 = __require("@microsoft/tsdoc-config");
|
|
3572
|
-
var path23 = __importStar(__require("path"));
|
|
3573
|
-
var Debug_1 = require_Debug();
|
|
3574
|
-
function _nullishCoalesce(lhs, rhsFn) {
|
|
3575
|
-
if (lhs != null) {
|
|
3576
|
-
return lhs;
|
|
3577
|
-
} else {
|
|
3578
|
-
return rhsFn();
|
|
3579
|
-
}
|
|
3580
|
-
}
|
|
3581
|
-
var _fs = __require("fs");
|
|
3582
|
-
var _path = __require("path");
|
|
3583
|
-
var MAX_PATH_SEARCH_DEPTH3 = 30;
|
|
3584
|
-
var depth3 = 0;
|
|
3585
|
-
var ROOT_FILES = [
|
|
3586
|
-
"storm-workspace.json",
|
|
3587
|
-
"storm-workspace.json",
|
|
3588
|
-
"storm-workspace.yaml",
|
|
3589
|
-
"storm-workspace.yml",
|
|
3590
|
-
"storm-workspace.js",
|
|
3591
|
-
"storm-workspace.ts",
|
|
3592
|
-
".storm-workspace.json",
|
|
3593
|
-
".storm-workspace.yaml",
|
|
3594
|
-
".storm-workspace.yml",
|
|
3595
|
-
".storm-workspace.js",
|
|
3596
|
-
".storm-workspace.ts",
|
|
3597
|
-
"lerna.json",
|
|
3598
|
-
"nx.json",
|
|
3599
|
-
"turbo.json",
|
|
3600
|
-
"npm-workspace.json",
|
|
3601
|
-
"yarn-workspace.json",
|
|
3602
|
-
"pnpm-workspace.json",
|
|
3603
|
-
"npm-workspace.yaml",
|
|
3604
|
-
"yarn-workspace.yaml",
|
|
3605
|
-
"pnpm-workspace.yaml",
|
|
3606
|
-
"npm-workspace.yml",
|
|
3607
|
-
"yarn-workspace.yml",
|
|
3608
|
-
"pnpm-workspace.yml",
|
|
3609
|
-
"npm-lock.json",
|
|
3610
|
-
"yarn-lock.json",
|
|
3611
|
-
"pnpm-lock.json",
|
|
3612
|
-
"npm-lock.yaml",
|
|
3613
|
-
"yarn-lock.yaml",
|
|
3614
|
-
"pnpm-lock.yaml",
|
|
3615
|
-
"npm-lock.yml",
|
|
3616
|
-
"yarn-lock.yml",
|
|
3617
|
-
"pnpm-lock.yml",
|
|
3618
|
-
"bun.lockb"
|
|
3619
|
-
];
|
|
3620
|
-
var ROOT_DIRECTORIES = [
|
|
3621
|
-
".storm-workspace",
|
|
3622
|
-
".nx",
|
|
3623
|
-
".github",
|
|
3624
|
-
".vscode",
|
|
3625
|
-
".verdaccio"
|
|
3626
|
-
];
|
|
3627
|
-
function findWorkspaceRoot3(startPath) {
|
|
3628
|
-
const _startPath = _nullishCoalesce(startPath, () => process.cwd());
|
|
3629
|
-
if (ROOT_DIRECTORIES.some(
|
|
3630
|
-
(endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName))
|
|
3631
|
-
)) {
|
|
3632
|
-
return _startPath;
|
|
3633
|
-
}
|
|
3634
|
-
if (ROOT_FILES.some(
|
|
3635
|
-
(endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName))
|
|
3636
|
-
)) {
|
|
3637
|
-
return _startPath;
|
|
3638
|
-
}
|
|
3639
|
-
if (_startPath !== "/" && depth3++ < MAX_PATH_SEARCH_DEPTH3) {
|
|
3640
|
-
const parent = _path.join.call(void 0, _startPath, "..");
|
|
3641
|
-
return findWorkspaceRoot3(parent);
|
|
3642
|
-
}
|
|
3643
|
-
return void 0;
|
|
3644
|
-
}
|
|
3645
|
-
var CACHE_CHECK_INTERVAL_MS = 3 * 1e3;
|
|
3646
|
-
var CACHE_EXPIRE_MS = 20 * 1e3;
|
|
3647
|
-
var CACHE_MAX_SIZE = 100;
|
|
3648
|
-
var ConfigCache = class _ConfigCache {
|
|
3649
|
-
/**
|
|
3650
|
-
* Node.js equivalent of performance.now().
|
|
3651
|
-
*/
|
|
3652
|
-
static _getTimeInMs() {
|
|
3653
|
-
const [seconds, nanoseconds] = process.hrtime();
|
|
3654
|
-
return seconds * 1e3 + nanoseconds / 1e6;
|
|
3655
|
-
}
|
|
3656
|
-
static getForSourceFile(sourceFilePath, tsConfigRootDir) {
|
|
3657
|
-
const sourceFileFolder = path23.dirname(path23.resolve(sourceFilePath));
|
|
3658
|
-
const configFilePath = tsConfigRootDir ? path23.join(tsConfigRootDir, tsdoc_config_1.TSDocConfigFile.FILENAME) : tsdoc_config_1.TSDocConfigFile.findConfigPathForFolder(sourceFileFolder);
|
|
3659
|
-
const cacheKey = configFilePath || sourceFileFolder + "/";
|
|
3660
|
-
Debug_1.Debug.log(`Cache key: "${cacheKey}"`);
|
|
3661
|
-
const nowMs = _ConfigCache._getTimeInMs();
|
|
3662
|
-
let cachedConfig = void 0;
|
|
3663
|
-
cachedConfig = _ConfigCache._cachedConfigs.get(cacheKey);
|
|
3664
|
-
if (cachedConfig) {
|
|
3665
|
-
Debug_1.Debug.log("Cache hit");
|
|
3666
|
-
const loadAgeMs = nowMs - cachedConfig.loadTimeMs;
|
|
3667
|
-
const lastCheckAgeMs = nowMs - cachedConfig.lastCheckTimeMs;
|
|
3668
|
-
if (loadAgeMs > CACHE_EXPIRE_MS || loadAgeMs < 0) {
|
|
3669
|
-
Debug_1.Debug.log("Evicting because item is expired");
|
|
3670
|
-
cachedConfig = void 0;
|
|
3671
|
-
_ConfigCache._cachedConfigs.delete(cacheKey);
|
|
3672
|
-
} else if (lastCheckAgeMs > CACHE_CHECK_INTERVAL_MS || lastCheckAgeMs < 0) {
|
|
3673
|
-
Debug_1.Debug.log("Checking for modifications");
|
|
3674
|
-
cachedConfig.lastCheckTimeMs = nowMs;
|
|
3675
|
-
if (cachedConfig.configFile.checkForModifiedFiles()) {
|
|
3676
|
-
Debug_1.Debug.log("Evicting because item was modified");
|
|
3677
|
-
cachedConfig = void 0;
|
|
3678
|
-
_ConfigCache._cachedConfigs.delete(cacheKey);
|
|
3679
|
-
}
|
|
3680
|
-
}
|
|
3681
|
-
}
|
|
3682
|
-
if (!cachedConfig) {
|
|
3683
|
-
if (_ConfigCache._cachedConfigs.size > CACHE_MAX_SIZE) {
|
|
3684
|
-
Debug_1.Debug.log("Clearing cache");
|
|
3685
|
-
_ConfigCache._cachedConfigs.clear();
|
|
3686
|
-
}
|
|
3687
|
-
const configFile = tsdoc_config_1.TSDocConfigFile.loadFile(configFilePath);
|
|
3688
|
-
if (configFile.fileNotFound) {
|
|
3689
|
-
Debug_1.Debug.log(`File not found: "${configFilePath}"`);
|
|
3690
|
-
} else {
|
|
3691
|
-
Debug_1.Debug.log(`Loaded: "${configFilePath}"`);
|
|
3692
|
-
}
|
|
3693
|
-
cachedConfig = {
|
|
3694
|
-
configFile,
|
|
3695
|
-
lastCheckTimeMs: nowMs,
|
|
3696
|
-
loadTimeMs: nowMs
|
|
3697
|
-
};
|
|
3698
|
-
_ConfigCache._cachedConfigs.set(cacheKey, cachedConfig);
|
|
3699
|
-
}
|
|
3700
|
-
return cachedConfig.configFile;
|
|
3701
|
-
}
|
|
3702
|
-
static _checkConfigFilePath(workspaceRoot, configFilePath) {
|
|
3703
|
-
const workspaceRootPath = workspaceRoot ? workspaceRoot : "./";
|
|
3704
|
-
if (!configFilePath) {
|
|
3705
|
-
return void 0;
|
|
3706
|
-
}
|
|
3707
|
-
if (_fs.existsSync(configFilePath)) {
|
|
3708
|
-
return configFilePath;
|
|
3709
|
-
} else if (_fs.existsSync(
|
|
3710
|
-
path23.join(
|
|
3711
|
-
workspaceRootPath,
|
|
3712
|
-
configFilePath
|
|
3713
|
-
)
|
|
3714
|
-
)) {
|
|
3715
|
-
return path23.join(
|
|
3716
|
-
workspaceRootPath,
|
|
3717
|
-
configFilePath
|
|
3718
|
-
);
|
|
3719
|
-
} else if (_fs.existsSync(
|
|
3720
|
-
path23.join(
|
|
3721
|
-
workspaceRootPath,
|
|
3722
|
-
"node_modules",
|
|
3723
|
-
configFilePath
|
|
3724
|
-
)
|
|
3725
|
-
)) {
|
|
3726
|
-
return path23.join(
|
|
3727
|
-
workspaceRootPath,
|
|
3728
|
-
"node_modules",
|
|
3729
|
-
configFilePath
|
|
3730
|
-
);
|
|
3731
|
-
} else if (_fs.existsSync(
|
|
3732
|
-
path23.join(
|
|
3733
|
-
workspaceRootPath,
|
|
3734
|
-
"node_modules",
|
|
3735
|
-
"@storm-software",
|
|
3736
|
-
"tsdoc",
|
|
3737
|
-
configFilePath
|
|
3738
|
-
)
|
|
3739
|
-
)) {
|
|
3740
|
-
return path23.join(
|
|
3741
|
-
workspaceRootPath,
|
|
3742
|
-
"node_modules",
|
|
3743
|
-
"@storm-software",
|
|
3744
|
-
"tsdoc",
|
|
3745
|
-
configFilePath
|
|
3746
|
-
);
|
|
3747
|
-
} else if (_fs.existsSync(
|
|
3748
|
-
path23.join(
|
|
3749
|
-
workspaceRootPath,
|
|
3750
|
-
"node_modules",
|
|
3751
|
-
"@storm-software",
|
|
3752
|
-
"tsdoc",
|
|
3753
|
-
"config",
|
|
3754
|
-
configFilePath
|
|
3755
|
-
)
|
|
3756
|
-
)) {
|
|
3757
|
-
return path23.join(
|
|
3758
|
-
workspaceRootPath,
|
|
3759
|
-
"node_modules",
|
|
3760
|
-
"@storm-software",
|
|
3761
|
-
"tsdoc",
|
|
3762
|
-
"config",
|
|
3763
|
-
configFilePath
|
|
3764
|
-
);
|
|
3765
|
-
} else if (_fs.existsSync(
|
|
3766
|
-
path23.join(
|
|
3767
|
-
workspaceRootPath,
|
|
3768
|
-
"node_modules",
|
|
3769
|
-
"@storm-software",
|
|
3770
|
-
"tsdoc",
|
|
3771
|
-
"dist",
|
|
3772
|
-
configFilePath
|
|
3773
|
-
)
|
|
3774
|
-
)) {
|
|
3775
|
-
return path23.join(
|
|
3776
|
-
workspaceRootPath,
|
|
3777
|
-
"node_modules",
|
|
3778
|
-
"@storm-software",
|
|
3779
|
-
"tsdoc",
|
|
3780
|
-
"dist",
|
|
3781
|
-
configFilePath
|
|
3782
|
-
);
|
|
3783
|
-
}
|
|
3784
|
-
return void 0;
|
|
3785
|
-
}
|
|
3786
|
-
static getStormConfigFile(options) {
|
|
3787
|
-
const type = options && options.type ? options.type : "recommended";
|
|
3788
|
-
const configFile = options && options.configFile ? options.configFile : void 0;
|
|
3789
|
-
let workspaceRoot = "";
|
|
3790
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
3791
|
-
workspaceRoot = process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH;
|
|
3792
|
-
}
|
|
3793
|
-
if (!workspaceRoot) {
|
|
3794
|
-
workspaceRoot = findWorkspaceRoot3();
|
|
3795
|
-
}
|
|
3796
|
-
let currentConfigFile = process.env.STORM_TSDOC_CONFIG_FILE ? process.env.STORM_TSDOC_CONFIG_FILE : configFile;
|
|
3797
|
-
Debug_1.Debug.log(`Config file from user options: ${currentConfigFile || "(none)"}`);
|
|
3798
|
-
let configFilePath = _ConfigCache._checkConfigFilePath(
|
|
3799
|
-
workspaceRoot,
|
|
3800
|
-
currentConfigFile
|
|
3801
|
-
);
|
|
3802
|
-
if (!configFilePath) {
|
|
3803
|
-
currentConfigFile = `${((process.env.STORM_TSDOC_TYPE ? process.env.STORM_TSDOC_TYPE : type) || "recommended").replace(/\.jsonc?$/, "")}.json`;
|
|
3804
|
-
Debug_1.Debug.log(`Config file from user options not found, trying: ${currentConfigFile}`);
|
|
3805
|
-
configFilePath = _ConfigCache._checkConfigFilePath(
|
|
3806
|
-
workspaceRoot,
|
|
3807
|
-
currentConfigFile
|
|
3808
|
-
);
|
|
3809
|
-
if (!configFilePath) {
|
|
3810
|
-
configFilePath = _ConfigCache._checkConfigFilePath(
|
|
3811
|
-
workspaceRoot,
|
|
3812
|
-
"recommended.json"
|
|
3813
|
-
);
|
|
3814
|
-
if (!configFilePath) {
|
|
3815
|
-
configFilePath = _ConfigCache._checkConfigFilePath(
|
|
3816
|
-
workspaceRoot,
|
|
3817
|
-
"tsdoc.json"
|
|
3818
|
-
);
|
|
3819
|
-
}
|
|
3820
|
-
}
|
|
3821
|
-
}
|
|
3822
|
-
const cacheKey = configFilePath || "missing-config-file";
|
|
3823
|
-
Debug_1.Debug.log(`Storm Software Configuration Cache key: "${cacheKey}"`);
|
|
3824
|
-
const nowMs = _ConfigCache._getTimeInMs();
|
|
3825
|
-
let cachedConfig = void 0;
|
|
3826
|
-
cachedConfig = _ConfigCache._cachedConfigs.get(cacheKey);
|
|
3827
|
-
if (cachedConfig) {
|
|
3828
|
-
Debug_1.Debug.log("Cache hit");
|
|
3829
|
-
const loadAgeMs = nowMs - cachedConfig.loadTimeMs;
|
|
3830
|
-
const lastCheckAgeMs = nowMs - cachedConfig.lastCheckTimeMs;
|
|
3831
|
-
if (loadAgeMs > CACHE_EXPIRE_MS || loadAgeMs < 0) {
|
|
3832
|
-
Debug_1.Debug.log("Evicting because item is expired");
|
|
3833
|
-
cachedConfig = void 0;
|
|
3834
|
-
_ConfigCache._cachedConfigs.delete(cacheKey);
|
|
3835
|
-
} else if (lastCheckAgeMs > CACHE_CHECK_INTERVAL_MS || lastCheckAgeMs < 0) {
|
|
3836
|
-
Debug_1.Debug.log("Checking for modifications");
|
|
3837
|
-
cachedConfig.lastCheckTimeMs = nowMs;
|
|
3838
|
-
if (cachedConfig.configFile.checkForModifiedFiles()) {
|
|
3839
|
-
Debug_1.Debug.log("Evicting because item was modified");
|
|
3840
|
-
cachedConfig = void 0;
|
|
3841
|
-
_ConfigCache._cachedConfigs.delete(cacheKey);
|
|
3842
|
-
}
|
|
3843
|
-
}
|
|
3844
|
-
}
|
|
3845
|
-
if (!cachedConfig) {
|
|
3846
|
-
if (_ConfigCache._cachedConfigs.size > CACHE_MAX_SIZE) {
|
|
3847
|
-
Debug_1.Debug.log("Clearing cache");
|
|
3848
|
-
_ConfigCache._cachedConfigs.clear();
|
|
3849
|
-
}
|
|
3850
|
-
const configFile2 = tsdoc_config_1.TSDocConfigFile.loadFile(configFilePath);
|
|
3851
|
-
if (configFile2.fileNotFound) {
|
|
3852
|
-
Debug_1.Debug.log(`File not found: "${configFilePath}"`);
|
|
3853
|
-
} else {
|
|
3854
|
-
Debug_1.Debug.log(`Loaded: "${configFilePath}"`);
|
|
3855
|
-
}
|
|
3856
|
-
cachedConfig = {
|
|
3857
|
-
configFile: configFile2,
|
|
3858
|
-
lastCheckTimeMs: nowMs,
|
|
3859
|
-
loadTimeMs: nowMs
|
|
3860
|
-
};
|
|
3861
|
-
_ConfigCache._cachedConfigs.set(cacheKey, cachedConfig);
|
|
3862
|
-
}
|
|
3863
|
-
return cachedConfig.configFile;
|
|
3864
|
-
}
|
|
3865
|
-
};
|
|
3866
|
-
exports.ConfigCache = ConfigCache;
|
|
3867
|
-
ConfigCache._cachedConfigs = /* @__PURE__ */ new Map();
|
|
3868
|
-
ConfigCache._cachedPaths = /* @__PURE__ */ new Map();
|
|
3869
|
-
}
|
|
3870
|
-
});
|
|
3871
|
-
|
|
3872
|
-
// ../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=c262176eba68bfd8898c896d48ca12af2147a650ca7a9cbfe8edf1cf981cdbc9/node_modules/eslint-plugin-tsdoc/lib/index.js
|
|
3873
|
-
var require_lib = __commonJS({
|
|
3874
|
-
"../../node_modules/.pnpm/eslint-plugin-tsdoc@0.4.0_patch_hash=c262176eba68bfd8898c896d48ca12af2147a650ca7a9cbfe8edf1cf981cdbc9/node_modules/eslint-plugin-tsdoc/lib/index.js"(exports, module) {
|
|
3875
|
-
init_cjs_shims();
|
|
3876
|
-
var tsdoc_1 = __require("@microsoft/tsdoc");
|
|
3877
|
-
var Debug_1 = require_Debug();
|
|
3878
|
-
var ConfigCache_1 = require_ConfigCache();
|
|
3879
|
-
var tsdocMessageIds = {};
|
|
3880
|
-
var defaultTSDocConfiguration = new tsdoc_1.TSDocConfiguration();
|
|
3881
|
-
defaultTSDocConfiguration.allTsdocMessageIds.forEach((messageId) => {
|
|
3882
|
-
tsdocMessageIds[messageId] = `${messageId}: {{unformattedText}}`;
|
|
3883
|
-
});
|
|
3884
|
-
var plugin9 = {
|
|
3885
|
-
rules: {
|
|
3886
|
-
// NOTE: The actual ESLint rule name will be "tsdoc/syntax". It is calculated by deleting "eslint-plugin-"
|
|
3887
|
-
// from the NPM package name, and then appending this string.
|
|
3888
|
-
syntax: {
|
|
3889
|
-
meta: {
|
|
3890
|
-
messages: Object.assign({
|
|
3891
|
-
"error-loading-storm-config": `Error loading Storm Software's shared TSDoc config file:
|
|
3892
|
-
{{details}}
|
|
3893
|
-
|
|
3894
|
-
Please ensure "@storm-software/tsdoc" is installed in the workspace root.`,
|
|
3895
|
-
"error-loading-config-file": "Error loading TSDoc config file:\n{{details}}",
|
|
3896
|
-
"error-applying-storm-config": "Error applying Storm Software's shared TSDoc configuration: {{details}}",
|
|
3897
|
-
"error-applying-config": "Error applying TSDoc configuration: {{details}}"
|
|
3898
|
-
}, tsdocMessageIds),
|
|
3899
|
-
type: "problem",
|
|
3900
|
-
docs: {
|
|
3901
|
-
description: "Validates that TypeScript documentation comments conform to the TSDoc standard",
|
|
3902
|
-
category: "Stylistic Issues",
|
|
3903
|
-
recommended: true,
|
|
3904
|
-
url: "https://tsdoc.org/pages/packages/eslint-plugin-tsdoc"
|
|
3905
|
-
},
|
|
3906
|
-
schema: [
|
|
3907
|
-
{
|
|
3908
|
-
type: "object",
|
|
3909
|
-
properties: {
|
|
3910
|
-
type: {
|
|
3911
|
-
type: "string",
|
|
3912
|
-
enum: ["typedoc", "api-extractor", "base", "core", "callouts", "recommended"],
|
|
3913
|
-
description: "The TSDoc configuration type to use from '@storm-software/tsdoc'. Defaults to 'recommended' (@storm-software/tsdoc/recommended.json)."
|
|
3914
|
-
},
|
|
3915
|
-
configFile: {
|
|
3916
|
-
type: "string",
|
|
3917
|
-
description: "The TSDoc configuration file to use."
|
|
3918
|
-
},
|
|
3919
|
-
tsconfigRootDir: {
|
|
3920
|
-
type: "string",
|
|
3921
|
-
description: "The root directory to use when resolving the tsconfig file. This is only necessary if the tsconfig file is not located in the same directory as the source file being linted. If not provided, eslint will attempt to use the parser option 'tsconfigRootDir' if it is available."
|
|
3922
|
-
}
|
|
3923
|
-
},
|
|
3924
|
-
additionalProperties: false
|
|
3925
|
-
}
|
|
3926
|
-
]
|
|
3927
|
-
},
|
|
3928
|
-
defaultOptions: [
|
|
3929
|
-
{
|
|
3930
|
-
type: "recommended"
|
|
3931
|
-
}
|
|
3932
|
-
],
|
|
3933
|
-
create: (context) => {
|
|
3934
|
-
const tsdocConfiguration = new tsdoc_1.TSDocConfiguration();
|
|
3935
|
-
let tsConfigDir = void 0;
|
|
3936
|
-
const sourceFilePath = context.filename;
|
|
3937
|
-
Debug_1.Debug.log(`Linting: "${sourceFilePath}"`);
|
|
3938
|
-
try {
|
|
3939
|
-
let tsdocConfigFile = {};
|
|
3940
|
-
try {
|
|
3941
|
-
const userOptions = context.options ? Array.isArray(context.options) ? context.options.length > 0 ? context.options[0] : {} : context.options : {};
|
|
3942
|
-
tsConfigDir = userOptions.tsconfigRootDir;
|
|
3943
|
-
if (!tsConfigDir && context.parserOptions && context.parserOptions.tsconfigRootDir) {
|
|
3944
|
-
tsConfigDir = context.parserOptions.tsconfigRootDir;
|
|
3945
|
-
}
|
|
3946
|
-
const config7 = { type: userOptions.type || "recommended", configFile: userOptions.configFile };
|
|
3947
|
-
Debug_1.Debug.log(`Using eslint-plugin-tsdoc config: ${JSON.stringify(config7, void 0, 2)}`);
|
|
3948
|
-
tsdocConfigFile = ConfigCache_1.ConfigCache.getStormConfigFile(config7);
|
|
3949
|
-
if (!tsdocConfigFile.fileNotFound) {
|
|
3950
|
-
if (tsdocConfigFile.hasErrors) {
|
|
3951
|
-
context.report({
|
|
3952
|
-
loc: { line: 1, column: 1 },
|
|
3953
|
-
messageId: "error-loading-storm-config",
|
|
3954
|
-
data: {
|
|
3955
|
-
details: tsdocConfigFile.getErrorSummary()
|
|
3956
|
-
}
|
|
3957
|
-
});
|
|
3958
|
-
}
|
|
3959
|
-
try {
|
|
3960
|
-
tsdocConfigFile.configureParser(tsdocConfiguration);
|
|
3961
|
-
} catch (e) {
|
|
3962
|
-
context.report({
|
|
3963
|
-
loc: { line: 1, column: 1 },
|
|
3964
|
-
messageId: "error-applying-storm-config",
|
|
3965
|
-
data: {
|
|
3966
|
-
details: e.message
|
|
3967
|
-
}
|
|
3968
|
-
});
|
|
3969
|
-
}
|
|
3970
|
-
}
|
|
3971
|
-
} catch (e) {
|
|
3972
|
-
context.report({
|
|
3973
|
-
loc: { line: 1, column: 1 },
|
|
3974
|
-
messageId: "error-loading-storm-config",
|
|
3975
|
-
data: {
|
|
3976
|
-
details: `Unexpected exception: ${e.message}`
|
|
3977
|
-
}
|
|
3978
|
-
});
|
|
3979
|
-
}
|
|
3980
|
-
if (!tsdocConfigFile || tsdocConfigFile.fileNotFound || tsdocConfigFile.hasErrors) {
|
|
3981
|
-
tsdocConfigFile = ConfigCache_1.ConfigCache.getForSourceFile(sourceFilePath, tsConfigDir);
|
|
3982
|
-
if (!tsdocConfigFile.fileNotFound) {
|
|
3983
|
-
if (tsdocConfigFile.hasErrors) {
|
|
3984
|
-
context.report({
|
|
3985
|
-
loc: { line: 1, column: 1 },
|
|
3986
|
-
messageId: "error-loading-config-file",
|
|
3987
|
-
data: {
|
|
3988
|
-
details: tsdocConfigFile.getErrorSummary()
|
|
3989
|
-
}
|
|
3990
|
-
});
|
|
3991
|
-
}
|
|
3992
|
-
try {
|
|
3993
|
-
tsdocConfigFile.configureParser(tsdocConfiguration);
|
|
3994
|
-
} catch (e) {
|
|
3995
|
-
context.report({
|
|
3996
|
-
loc: { line: 1, column: 1 },
|
|
3997
|
-
messageId: "error-applying-config",
|
|
3998
|
-
data: {
|
|
3999
|
-
details: e.message
|
|
4000
|
-
}
|
|
4001
|
-
});
|
|
4002
|
-
}
|
|
4003
|
-
}
|
|
4004
|
-
}
|
|
4005
|
-
} catch (e) {
|
|
4006
|
-
context.report({
|
|
4007
|
-
loc: { line: 1, column: 1 },
|
|
4008
|
-
messageId: "error-loading-config-file",
|
|
4009
|
-
data: {
|
|
4010
|
-
details: `Unexpected exception: ${e.message}`
|
|
4011
|
-
}
|
|
4012
|
-
});
|
|
4013
|
-
}
|
|
4014
|
-
const tsdocParser = new tsdoc_1.TSDocParser(tsdocConfiguration);
|
|
4015
|
-
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
4016
|
-
const checkCommentBlocks = function(node2) {
|
|
4017
|
-
for (const comment of sourceCode.getAllComments()) {
|
|
4018
|
-
if (comment.type !== "Block") {
|
|
4019
|
-
continue;
|
|
4020
|
-
}
|
|
4021
|
-
if (!comment.range) {
|
|
4022
|
-
continue;
|
|
4023
|
-
}
|
|
4024
|
-
const textRange = tsdoc_1.TextRange.fromStringRange(sourceCode.text, comment.range[0], comment.range[1]);
|
|
4025
|
-
if (textRange.length < 5) {
|
|
4026
|
-
continue;
|
|
4027
|
-
}
|
|
4028
|
-
if (textRange.buffer[textRange.pos + 2] !== "*") {
|
|
4029
|
-
continue;
|
|
4030
|
-
}
|
|
4031
|
-
const parserContext = tsdocParser.parseRange(textRange);
|
|
4032
|
-
for (const message2 of parserContext.log.messages) {
|
|
4033
|
-
context.report({
|
|
4034
|
-
loc: {
|
|
4035
|
-
start: sourceCode.getLocFromIndex(message2.textRange.pos),
|
|
4036
|
-
end: sourceCode.getLocFromIndex(message2.textRange.end)
|
|
4037
|
-
},
|
|
4038
|
-
messageId: message2.messageId,
|
|
4039
|
-
data: {
|
|
4040
|
-
unformattedText: message2.unformattedText
|
|
4041
|
-
}
|
|
4042
|
-
});
|
|
4043
|
-
}
|
|
4044
|
-
}
|
|
4045
|
-
};
|
|
4046
|
-
return {
|
|
4047
|
-
Program: checkCommentBlocks
|
|
4048
|
-
};
|
|
4049
|
-
}
|
|
4050
|
-
}
|
|
4051
|
-
}
|
|
4052
|
-
};
|
|
4053
|
-
module.exports = plugin9;
|
|
4054
|
-
}
|
|
4055
|
-
});
|
|
4056
|
-
|
|
4057
2855
|
// ../eslint-plugin-tsdoc/package.json
|
|
4058
2856
|
var package_default4;
|
|
4059
2857
|
var init_package3 = __esm({
|
|
4060
2858
|
"../eslint-plugin-tsdoc/package.json"() {
|
|
4061
2859
|
package_default4 = {
|
|
4062
2860
|
name: "@storm-software/eslint-plugin-tsdoc",
|
|
4063
|
-
version: "0.0.
|
|
2861
|
+
version: "0.0.79",
|
|
4064
2862
|
private: false,
|
|
4065
2863
|
description: "An ESLint Plugin that enforces TSDoc comments in Storm Software projects.",
|
|
4066
|
-
keywords: [
|
|
2864
|
+
keywords: [
|
|
2865
|
+
"eslint",
|
|
2866
|
+
"eslint-plugin",
|
|
2867
|
+
"storm-software"
|
|
2868
|
+
],
|
|
4067
2869
|
homepage: "https://stormsoftware.com",
|
|
4068
2870
|
bugs: {
|
|
4069
2871
|
url: "https://stormsoftware.com/support",
|
|
@@ -4108,13 +2910,14 @@ var init_package3 = __esm({
|
|
|
4108
2910
|
},
|
|
4109
2911
|
types: "./dist/index.d.ts",
|
|
4110
2912
|
typings: "dist/index.d.mts",
|
|
4111
|
-
files: [
|
|
2913
|
+
files: [
|
|
2914
|
+
"dist"
|
|
2915
|
+
],
|
|
4112
2916
|
dependencies: {
|
|
4113
2917
|
"@microsoft/tsdoc": "catalog:",
|
|
4114
2918
|
"@microsoft/tsdoc-config": "catalog:",
|
|
4115
2919
|
"@storm-software/package-constants": "workspace:*",
|
|
4116
2920
|
"@typescript-eslint/utils": "catalog:",
|
|
4117
|
-
ajv: "catalog:",
|
|
4118
2921
|
defu: "catalog:",
|
|
4119
2922
|
"es-errors": "1.3.0",
|
|
4120
2923
|
"fast-deep-equal": "3.1.3",
|
|
@@ -4164,16 +2967,13 @@ var init_package3 = __esm({
|
|
|
4164
2967
|
};
|
|
4165
2968
|
}
|
|
4166
2969
|
});
|
|
4167
|
-
|
|
4168
|
-
// ../eslint-plugin-tsdoc/src/plugin.ts
|
|
4169
|
-
var import_eslint_plugin_tsdoc, plugin8;
|
|
2970
|
+
var plugin7;
|
|
4170
2971
|
var init_plugin3 = __esm({
|
|
4171
2972
|
"../eslint-plugin-tsdoc/src/plugin.ts"() {
|
|
4172
2973
|
init_cjs_shims();
|
|
4173
|
-
import_eslint_plugin_tsdoc = __toESM(require_lib());
|
|
4174
2974
|
init_package3();
|
|
4175
|
-
|
|
4176
|
-
...
|
|
2975
|
+
plugin7 = {
|
|
2976
|
+
...base2__default.default,
|
|
4177
2977
|
meta: {
|
|
4178
2978
|
name: "tsdoc",
|
|
4179
2979
|
version: package_default4.version
|
|
@@ -4194,7 +2994,7 @@ var init_recommended3 = __esm({
|
|
|
4194
2994
|
ignores: GLOB_EXCLUDE,
|
|
4195
2995
|
name: "tsdoc/recommended",
|
|
4196
2996
|
plugins: {
|
|
4197
|
-
tsdoc:
|
|
2997
|
+
tsdoc: plugin7
|
|
4198
2998
|
},
|
|
4199
2999
|
rules: {
|
|
4200
3000
|
"tsdoc/syntax": ["error", { type: "recommended" }]
|
|
@@ -4205,12 +3005,12 @@ var init_recommended3 = __esm({
|
|
|
4205
3005
|
});
|
|
4206
3006
|
|
|
4207
3007
|
// ../eslint-plugin-tsdoc/src/configs/index.ts
|
|
4208
|
-
var
|
|
3008
|
+
var configs6;
|
|
4209
3009
|
var init_configs3 = __esm({
|
|
4210
3010
|
"../eslint-plugin-tsdoc/src/configs/index.ts"() {
|
|
4211
3011
|
init_cjs_shims();
|
|
4212
3012
|
init_recommended3();
|
|
4213
|
-
|
|
3013
|
+
configs6 = {
|
|
4214
3014
|
recommended: recommended_default6
|
|
4215
3015
|
};
|
|
4216
3016
|
}
|
|
@@ -4219,22 +3019,22 @@ var init_configs3 = __esm({
|
|
|
4219
3019
|
// ../eslint-plugin-tsdoc/src/index.ts
|
|
4220
3020
|
var src_exports3 = {};
|
|
4221
3021
|
__export(src_exports3, {
|
|
4222
|
-
configs: () =>
|
|
3022
|
+
configs: () => configs6,
|
|
4223
3023
|
default: () => src_default4,
|
|
4224
|
-
rules: () =>
|
|
3024
|
+
rules: () => rules5
|
|
4225
3025
|
});
|
|
4226
|
-
var eslintPlugin4, src_default4,
|
|
3026
|
+
var eslintPlugin4, src_default4, rules5;
|
|
4227
3027
|
var init_src3 = __esm({
|
|
4228
3028
|
"../eslint-plugin-tsdoc/src/index.ts"() {
|
|
4229
3029
|
init_cjs_shims();
|
|
4230
3030
|
init_configs3();
|
|
4231
3031
|
init_plugin3();
|
|
4232
3032
|
eslintPlugin4 = {
|
|
4233
|
-
...
|
|
4234
|
-
configs:
|
|
3033
|
+
...plugin7,
|
|
3034
|
+
configs: configs6
|
|
4235
3035
|
};
|
|
4236
3036
|
src_default4 = eslintPlugin4;
|
|
4237
|
-
|
|
3037
|
+
rules5 = plugin7.rules;
|
|
4238
3038
|
}
|
|
4239
3039
|
});
|
|
4240
3040
|
|
|
@@ -4284,8 +3084,8 @@ async function interopDefault(m) {
|
|
|
4284
3084
|
const resolved = await m;
|
|
4285
3085
|
return resolved.default || resolved;
|
|
4286
3086
|
}
|
|
4287
|
-
function isPackageInScope(
|
|
4288
|
-
return localPkg.isPackageExists(
|
|
3087
|
+
function isPackageInScope(name2) {
|
|
3088
|
+
return localPkg.isPackageExists(name2, { paths: [scopeUrl] });
|
|
4289
3089
|
}
|
|
4290
3090
|
async function ensurePackages(packages) {
|
|
4291
3091
|
if (process2__default.default.env.CI || process2__default.default.stdout.isTTY === false || isCwdInScope === false)
|
|
@@ -4305,9 +3105,9 @@ async function ensurePackages(packages) {
|
|
|
4305
3105
|
(i) => i.installPackage(nonExistingPackages, { dev: true })
|
|
4306
3106
|
);
|
|
4307
3107
|
}
|
|
4308
|
-
function renameRules(
|
|
3108
|
+
function renameRules(rules6, map) {
|
|
4309
3109
|
return Object.fromEntries(
|
|
4310
|
-
Object.entries(
|
|
3110
|
+
Object.entries(rules6).map(([key, value]) => {
|
|
4311
3111
|
for (const [from, to] of Object.entries(map)) {
|
|
4312
3112
|
if (key.startsWith(`${from}/`))
|
|
4313
3113
|
return [to + key.slice(from.length), value];
|
|
@@ -4947,7 +3747,7 @@ init_cjs_shims();
|
|
|
4947
3747
|
init_cjs_shims();
|
|
4948
3748
|
var _a;
|
|
4949
3749
|
// @__NO_SIDE_EFFECTS__
|
|
4950
|
-
function $constructor(
|
|
3750
|
+
function $constructor(name2, initializer2, params) {
|
|
4951
3751
|
function init(inst, def) {
|
|
4952
3752
|
if (!inst._zod) {
|
|
4953
3753
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -4959,10 +3759,10 @@ function $constructor(name3, initializer2, params) {
|
|
|
4959
3759
|
enumerable: false
|
|
4960
3760
|
});
|
|
4961
3761
|
}
|
|
4962
|
-
if (inst._zod.traits.has(
|
|
3762
|
+
if (inst._zod.traits.has(name2)) {
|
|
4963
3763
|
return;
|
|
4964
3764
|
}
|
|
4965
|
-
inst._zod.traits.add(
|
|
3765
|
+
inst._zod.traits.add(name2);
|
|
4966
3766
|
initializer2(inst, def);
|
|
4967
3767
|
const proto = _.prototype;
|
|
4968
3768
|
const keys = Object.keys(proto);
|
|
@@ -4976,7 +3776,7 @@ function $constructor(name3, initializer2, params) {
|
|
|
4976
3776
|
const Parent = params?.Parent ?? Object;
|
|
4977
3777
|
class Definition extends Parent {
|
|
4978
3778
|
}
|
|
4979
|
-
Object.defineProperty(Definition, "name", { value:
|
|
3779
|
+
Object.defineProperty(Definition, "name", { value: name2 });
|
|
4980
3780
|
function _(def) {
|
|
4981
3781
|
var _a4;
|
|
4982
3782
|
const inst = params?.Parent ? new Definition() : this;
|
|
@@ -4992,10 +3792,10 @@ function $constructor(name3, initializer2, params) {
|
|
|
4992
3792
|
value: (inst) => {
|
|
4993
3793
|
if (params?.Parent && inst instanceof params.Parent)
|
|
4994
3794
|
return true;
|
|
4995
|
-
return inst?._zod?.traits?.has(
|
|
3795
|
+
return inst?._zod?.traits?.has(name2);
|
|
4996
3796
|
}
|
|
4997
3797
|
});
|
|
4998
|
-
Object.defineProperty(_, "name", { value:
|
|
3798
|
+
Object.defineProperty(_, "name", { value: name2 });
|
|
4999
3799
|
return _;
|
|
5000
3800
|
}
|
|
5001
3801
|
var $ZodAsyncError = class extends Error {
|
|
@@ -6985,7 +5785,7 @@ async function getPackageJsonConfig(root) {
|
|
|
6985
5785
|
let license = STORM_DEFAULT_LICENSE;
|
|
6986
5786
|
let homepage = void 0;
|
|
6987
5787
|
let support = void 0;
|
|
6988
|
-
let
|
|
5788
|
+
let name2 = void 0;
|
|
6989
5789
|
let namespace = void 0;
|
|
6990
5790
|
let repository = void 0;
|
|
6991
5791
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
@@ -6997,7 +5797,7 @@ async function getPackageJsonConfig(root) {
|
|
|
6997
5797
|
if (file) {
|
|
6998
5798
|
const packageJson = JSON.parse(file);
|
|
6999
5799
|
if (packageJson.name) {
|
|
7000
|
-
|
|
5800
|
+
name2 = packageJson.name;
|
|
7001
5801
|
}
|
|
7002
5802
|
if (packageJson.namespace) {
|
|
7003
5803
|
namespace = packageJson.namespace;
|
|
@@ -7026,7 +5826,7 @@ async function getPackageJsonConfig(root) {
|
|
|
7026
5826
|
}
|
|
7027
5827
|
return {
|
|
7028
5828
|
workspaceRoot,
|
|
7029
|
-
name:
|
|
5829
|
+
name: name2,
|
|
7030
5830
|
namespace,
|
|
7031
5831
|
repository,
|
|
7032
5832
|
license,
|
|
@@ -7067,7 +5867,7 @@ function applyDefaultConfig(config7) {
|
|
|
7067
5867
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
7068
5868
|
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
7069
5869
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
7070
|
-
const
|
|
5870
|
+
const configs7 = await Promise.all([
|
|
7071
5871
|
c12.loadConfig({
|
|
7072
5872
|
cwd: workspacePath,
|
|
7073
5873
|
packageJson: true,
|
|
@@ -7098,7 +5898,7 @@ var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
|
7098
5898
|
...options
|
|
7099
5899
|
})
|
|
7100
5900
|
]);
|
|
7101
|
-
return defu__default.default(
|
|
5901
|
+
return defu__default.default(configs7[0] ?? {}, configs7[1] ?? {});
|
|
7102
5902
|
};
|
|
7103
5903
|
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
7104
5904
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
@@ -7854,7 +6654,7 @@ init_cjs_shims();
|
|
|
7854
6654
|
|
|
7855
6655
|
// ../eslint-plugin-banner/package.json
|
|
7856
6656
|
var package_default = {
|
|
7857
|
-
version: "0.0.
|
|
6657
|
+
version: "0.0.81"};
|
|
7858
6658
|
|
|
7859
6659
|
// ../eslint-plugin-banner/src/rules/banner.ts
|
|
7860
6660
|
init_cjs_shims();
|
|
@@ -7863,7 +6663,7 @@ init_cjs_shims();
|
|
|
7863
6663
|
init_cjs_shims();
|
|
7864
6664
|
function RuleCreator(urlCreator) {
|
|
7865
6665
|
return function createNamedRule({
|
|
7866
|
-
name:
|
|
6666
|
+
name: name2,
|
|
7867
6667
|
meta: meta3,
|
|
7868
6668
|
...rule
|
|
7869
6669
|
}) {
|
|
@@ -7872,7 +6672,7 @@ function RuleCreator(urlCreator) {
|
|
|
7872
6672
|
...meta3,
|
|
7873
6673
|
docs: {
|
|
7874
6674
|
...meta3.docs,
|
|
7875
|
-
url: urlCreator(
|
|
6675
|
+
url: urlCreator(name2)
|
|
7876
6676
|
}
|
|
7877
6677
|
},
|
|
7878
6678
|
...rule
|
|
@@ -7948,12 +6748,12 @@ var ACRONYMS_LIST = [
|
|
|
7948
6748
|
|
|
7949
6749
|
// ../eslint-plugin-banner/src/helpers/get-banner.ts
|
|
7950
6750
|
function getBanner(options) {
|
|
7951
|
-
const { name:
|
|
6751
|
+
const { name: name2 } = options;
|
|
7952
6752
|
let padding = " ";
|
|
7953
|
-
for (let i = 0; i <
|
|
6753
|
+
for (let i = 0; i < name2.length + 2 && padding.length > 4; i++) {
|
|
7954
6754
|
padding = padding.slice(0, -1);
|
|
7955
6755
|
}
|
|
7956
|
-
let titleName =
|
|
6756
|
+
let titleName = name2;
|
|
7957
6757
|
if (titleName) {
|
|
7958
6758
|
if (titleName?.startsWith("@")) {
|
|
7959
6759
|
titleName = titleName.slice(1);
|
|
@@ -7969,8 +6769,8 @@ function getBanner(options) {
|
|
|
7969
6769
|
const organization = options.organization || "storm-software";
|
|
7970
6770
|
const licensing = options.licensing?.replace(/\/$/, "") || "https://stormsoftware.com/licenses";
|
|
7971
6771
|
const homepage = options.homepage || "https://stormsoftware.com";
|
|
7972
|
-
const repository = options.repository || `https://github.com/${organization}${
|
|
7973
|
-
const docs = options.docs || `https://docs.stormsoftware.com${
|
|
6772
|
+
const repository = options.repository || `https://github.com/${organization}${name2 ? `/${name2}` : ""}`;
|
|
6773
|
+
const docs = options.docs || `https://docs.stormsoftware.com${name2 ? `/projects/${name2}` : ""}`;
|
|
7974
6774
|
const formattedOrganization = (organization.charAt(0).toUpperCase() + organization.slice(1)).split("-").filter((word) => word && word.length > 0).map((word) => {
|
|
7975
6775
|
if (ACRONYMS_LIST.includes(word.toUpperCase())) {
|
|
7976
6776
|
return word.toUpperCase();
|
|
@@ -7985,7 +6785,7 @@ ${padding}\u{1F5F2} ${formattedOrganization} ${titleName ? `- ${titleName}` : ""
|
|
|
7985
6785
|
This code was released as part of ${titleName ? `the ${titleName}` : `a ${formattedOrganization}`} project. ${titleName ? titleName : "The project"}
|
|
7986
6786
|
is maintained by ${formattedOrganization} under the ${license} license, and is
|
|
7987
6787
|
free for commercial and private use. For more information, please visit
|
|
7988
|
-
our licensing page at ${licensing}/${
|
|
6788
|
+
our licensing page at ${licensing}/${name2 ? `projects/${name2}` : ""}.
|
|
7989
6789
|
|
|
7990
6790
|
Website: ${homepage}
|
|
7991
6791
|
Repository: ${repository}
|
|
@@ -8185,7 +6985,7 @@ var banner_default = createRule({
|
|
|
8185
6985
|
],
|
|
8186
6986
|
create: (context) => {
|
|
8187
6987
|
const {
|
|
8188
|
-
name:
|
|
6988
|
+
name: name2,
|
|
8189
6989
|
license,
|
|
8190
6990
|
organization,
|
|
8191
6991
|
licensing,
|
|
@@ -8197,7 +6997,7 @@ var banner_default = createRule({
|
|
|
8197
6997
|
lineEndings
|
|
8198
6998
|
} = context.options[0];
|
|
8199
6999
|
const banner2 = getBanner({
|
|
8200
|
-
name:
|
|
7000
|
+
name: name2,
|
|
8201
7001
|
license,
|
|
8202
7002
|
organization,
|
|
8203
7003
|
licensing,
|
|
@@ -8740,7 +7540,7 @@ async function bun(options = {}) {
|
|
|
8740
7540
|
"@storm-software/eslint-plugin-bun",
|
|
8741
7541
|
"jsonc-eslint-parser"
|
|
8742
7542
|
]);
|
|
8743
|
-
const [
|
|
7543
|
+
const [plugin8, parserJsonc3] = await Promise.all([
|
|
8744
7544
|
interopDefault(Promise.resolve().then(() => (init_src(), src_exports))),
|
|
8745
7545
|
interopDefault(import('jsonc-eslint-parser'))
|
|
8746
7546
|
]);
|
|
@@ -8783,20 +7583,20 @@ async function bun(options = {}) {
|
|
|
8783
7583
|
}
|
|
8784
7584
|
});
|
|
8785
7585
|
}
|
|
8786
|
-
const
|
|
7586
|
+
const configs7 = (Array.isArray(plugin8.configs?.recommended) ? plugin8.configs.recommended : [plugin8.configs?.recommended]).filter(
|
|
8787
7587
|
(config7) => config7 && typeof config7 === "object" && "name" in config7 && !config7.name?.endsWith("setup")
|
|
8788
7588
|
);
|
|
8789
|
-
const packageJsonConfig =
|
|
7589
|
+
const packageJsonConfig = configs7.find(
|
|
8790
7590
|
(config7) => config7.name?.endsWith("package-json") ?? false
|
|
8791
7591
|
);
|
|
8792
7592
|
return [
|
|
8793
7593
|
{
|
|
8794
7594
|
name: "storm/bun/setup",
|
|
8795
7595
|
plugins: {
|
|
8796
|
-
bun:
|
|
7596
|
+
bun: plugin8
|
|
8797
7597
|
}
|
|
8798
7598
|
},
|
|
8799
|
-
...
|
|
7599
|
+
...configs7.map((config7) => ({
|
|
8800
7600
|
name: config7.name,
|
|
8801
7601
|
...config7
|
|
8802
7602
|
})),
|
|
@@ -9020,7 +7820,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9020
7820
|
options.dprintOptions ?? {}
|
|
9021
7821
|
);
|
|
9022
7822
|
const pluginFormat = await interopDefault(import('eslint-plugin-format'));
|
|
9023
|
-
const
|
|
7823
|
+
const configs7 = [
|
|
9024
7824
|
{
|
|
9025
7825
|
name: "storm/formatter/setup",
|
|
9026
7826
|
plugins: {
|
|
@@ -9029,7 +7829,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9029
7829
|
}
|
|
9030
7830
|
];
|
|
9031
7831
|
if (options.css) {
|
|
9032
|
-
|
|
7832
|
+
configs7.push(
|
|
9033
7833
|
{
|
|
9034
7834
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
9035
7835
|
languageOptions: {
|
|
@@ -9078,7 +7878,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9078
7878
|
);
|
|
9079
7879
|
}
|
|
9080
7880
|
if (options.html) {
|
|
9081
|
-
|
|
7881
|
+
configs7.push({
|
|
9082
7882
|
files: [GLOB_HTML],
|
|
9083
7883
|
languageOptions: {
|
|
9084
7884
|
parser: parserPlain
|
|
@@ -9095,7 +7895,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9095
7895
|
});
|
|
9096
7896
|
}
|
|
9097
7897
|
if (options.xml) {
|
|
9098
|
-
|
|
7898
|
+
configs7.push({
|
|
9099
7899
|
files: [GLOB_XML],
|
|
9100
7900
|
languageOptions: {
|
|
9101
7901
|
parser: parserPlain
|
|
@@ -9116,7 +7916,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9116
7916
|
});
|
|
9117
7917
|
}
|
|
9118
7918
|
if (options.svg) {
|
|
9119
|
-
|
|
7919
|
+
configs7.push({
|
|
9120
7920
|
files: [GLOB_SVG],
|
|
9121
7921
|
languageOptions: {
|
|
9122
7922
|
parser: parserPlain
|
|
@@ -9138,7 +7938,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9138
7938
|
}
|
|
9139
7939
|
if (options.markdown) {
|
|
9140
7940
|
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
9141
|
-
|
|
7941
|
+
configs7.push({
|
|
9142
7942
|
files: [GLOB_MARKDOWN],
|
|
9143
7943
|
languageOptions: {
|
|
9144
7944
|
parser: parserPlain
|
|
@@ -9159,7 +7959,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9159
7959
|
});
|
|
9160
7960
|
}
|
|
9161
7961
|
if (options.astro) {
|
|
9162
|
-
|
|
7962
|
+
configs7.push({
|
|
9163
7963
|
files: [GLOB_ASTRO],
|
|
9164
7964
|
languageOptions: {
|
|
9165
7965
|
parser: parserPlain
|
|
@@ -9175,7 +7975,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9175
7975
|
]
|
|
9176
7976
|
}
|
|
9177
7977
|
});
|
|
9178
|
-
|
|
7978
|
+
configs7.push({
|
|
9179
7979
|
files: [GLOB_ASTRO, GLOB_ASTRO_TS],
|
|
9180
7980
|
name: "storm/formatter/astro/disables",
|
|
9181
7981
|
rules: {
|
|
@@ -9190,7 +7990,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9190
7990
|
});
|
|
9191
7991
|
}
|
|
9192
7992
|
if (options.graphql) {
|
|
9193
|
-
|
|
7993
|
+
configs7.push({
|
|
9194
7994
|
files: [GLOB_GRAPHQL],
|
|
9195
7995
|
languageOptions: {
|
|
9196
7996
|
parser: parserPlain
|
|
@@ -9206,7 +8006,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9206
8006
|
}
|
|
9207
8007
|
});
|
|
9208
8008
|
}
|
|
9209
|
-
return
|
|
8009
|
+
return configs7;
|
|
9210
8010
|
}
|
|
9211
8011
|
|
|
9212
8012
|
// src/configs/graphql.ts
|
|
@@ -9734,13 +8534,13 @@ var docsUrl = (ruleName, commitish = `v${version2}`) => `${repoUrl}/blob/${commi
|
|
|
9734
8534
|
|
|
9735
8535
|
// ../../node_modules/.pnpm/eslint-plugin-import-x@4.17.1_patch_hash=2fde63e367ada6ae348459ff5a2b0bbc53a12189dad6a5_9840712109fb59ffd84be76551e40796/node_modules/eslint-plugin-import-x/lib/utils/create-rule.js
|
|
9736
8536
|
function RuleCreator3(urlCreator) {
|
|
9737
|
-
return function createNamedRule({ meta: meta3, name:
|
|
8537
|
+
return function createNamedRule({ meta: meta3, name: name2, ...rule }) {
|
|
9738
8538
|
return createRule_({
|
|
9739
8539
|
meta: {
|
|
9740
8540
|
...meta3,
|
|
9741
8541
|
docs: {
|
|
9742
8542
|
...meta3.docs,
|
|
9743
|
-
url: urlCreator(
|
|
8543
|
+
url: urlCreator(name2)
|
|
9744
8544
|
}
|
|
9745
8545
|
},
|
|
9746
8546
|
...rule
|
|
@@ -9761,9 +8561,9 @@ var createRule3 = RuleCreator3(docsUrl);
|
|
|
9761
8561
|
|
|
9762
8562
|
// ../../node_modules/.pnpm/eslint-plugin-import-x@4.17.1_patch_hash=2fde63e367ada6ae348459ff5a2b0bbc53a12189dad6a5_9840712109fb59ffd84be76551e40796/node_modules/eslint-plugin-import-x/lib/utils/declared-scope.js
|
|
9763
8563
|
init_cjs_shims();
|
|
9764
|
-
function declaredScope(context, node2,
|
|
8564
|
+
function declaredScope(context, node2, name2) {
|
|
9765
8565
|
const references = context.sourceCode.getScope(node2).references;
|
|
9766
|
-
const reference = references.find((x) => x.identifier.name ===
|
|
8566
|
+
const reference = references.find((x) => x.identifier.name === name2);
|
|
9767
8567
|
return reference?.resolved?.scope.type;
|
|
9768
8568
|
}
|
|
9769
8569
|
|
|
@@ -10058,49 +8858,49 @@ function getFilePackageName(filename) {
|
|
|
10058
8858
|
}
|
|
10059
8859
|
|
|
10060
8860
|
// ../../node_modules/.pnpm/eslint-plugin-import-x@4.17.1_patch_hash=2fde63e367ada6ae348459ff5a2b0bbc53a12189dad6a5_9840712109fb59ffd84be76551e40796/node_modules/eslint-plugin-import-x/lib/utils/import-type.js
|
|
10061
|
-
function baseModule(
|
|
10062
|
-
if (isScoped(
|
|
10063
|
-
const [scope, pkg2] =
|
|
8861
|
+
function baseModule(name2) {
|
|
8862
|
+
if (isScoped(name2)) {
|
|
8863
|
+
const [scope, pkg2] = name2.split("/");
|
|
10064
8864
|
return `${scope}/${pkg2}`;
|
|
10065
8865
|
}
|
|
10066
|
-
const [pkg] =
|
|
8866
|
+
const [pkg] = name2.split("/");
|
|
10067
8867
|
return pkg;
|
|
10068
8868
|
}
|
|
10069
|
-
function isInternalRegexMatch(
|
|
8869
|
+
function isInternalRegexMatch(name2, settings) {
|
|
10070
8870
|
const internalScope = settings?.["import-x/internal-regex"];
|
|
10071
|
-
return internalScope && new RegExp(internalScope).test(
|
|
8871
|
+
return internalScope && new RegExp(internalScope).test(name2);
|
|
10072
8872
|
}
|
|
10073
|
-
function isAbsolute3(
|
|
10074
|
-
return typeof
|
|
8873
|
+
function isAbsolute3(name2) {
|
|
8874
|
+
return typeof name2 === "string" && path16__default.default.isAbsolute(name2);
|
|
10075
8875
|
}
|
|
10076
|
-
function isBuiltIn(
|
|
10077
|
-
if (modulePath || !
|
|
8876
|
+
function isBuiltIn(name2, settings, modulePath) {
|
|
8877
|
+
if (modulePath || !name2) {
|
|
10078
8878
|
return false;
|
|
10079
8879
|
}
|
|
10080
|
-
const
|
|
8880
|
+
const base3 = baseModule(name2);
|
|
10081
8881
|
const extras = settings && settings["import-x/core-modules"] || [];
|
|
10082
|
-
return Module.isBuiltin(
|
|
8882
|
+
return Module.isBuiltin(base3) || extras.includes(base3);
|
|
10083
8883
|
}
|
|
10084
|
-
function isExternalModule(
|
|
10085
|
-
return (isModule(
|
|
8884
|
+
function isExternalModule(name2, modulePath, context) {
|
|
8885
|
+
return (isModule(name2) || isScoped(name2)) && typeTest(name2, context, modulePath) === "external";
|
|
10086
8886
|
}
|
|
10087
8887
|
var moduleRegExp = /^\w/;
|
|
10088
|
-
function isModule(
|
|
10089
|
-
return !!
|
|
8888
|
+
function isModule(name2) {
|
|
8889
|
+
return !!name2 && moduleRegExp.test(name2);
|
|
10090
8890
|
}
|
|
10091
8891
|
var scopedRegExp = /^@[^/]+\/?[^/]+/;
|
|
10092
|
-
function isScoped(
|
|
10093
|
-
return !!
|
|
8892
|
+
function isScoped(name2) {
|
|
8893
|
+
return !!name2 && scopedRegExp.test(name2);
|
|
10094
8894
|
}
|
|
10095
|
-
function isRelativeToParent(
|
|
10096
|
-
return /^\.\.$|^\.\.[/\\]/.test(
|
|
8895
|
+
function isRelativeToParent(name2) {
|
|
8896
|
+
return /^\.\.$|^\.\.[/\\]/.test(name2);
|
|
10097
8897
|
}
|
|
10098
8898
|
var indexFiles = /* @__PURE__ */ new Set([".", "./", "./index", "./index.js"]);
|
|
10099
|
-
function isIndex(
|
|
10100
|
-
return indexFiles.has(
|
|
8899
|
+
function isIndex(name2) {
|
|
8900
|
+
return indexFiles.has(name2);
|
|
10101
8901
|
}
|
|
10102
|
-
function isRelativeToSibling(
|
|
10103
|
-
return /^\.[/\\]/.test(
|
|
8902
|
+
function isRelativeToSibling(name2) {
|
|
8903
|
+
return /^\.[/\\]/.test(name2);
|
|
10104
8904
|
}
|
|
10105
8905
|
function isExternalPath(filepath, context) {
|
|
10106
8906
|
if (!filepath) {
|
|
@@ -10127,28 +8927,28 @@ function isInternalPath(filepath, context) {
|
|
|
10127
8927
|
const packagePath = getContextPackagePath(context);
|
|
10128
8928
|
return !path16__default.default.relative(packagePath, filepath).startsWith("../");
|
|
10129
8929
|
}
|
|
10130
|
-
function isExternalLookingName(
|
|
10131
|
-
return isModule(
|
|
8930
|
+
function isExternalLookingName(name2) {
|
|
8931
|
+
return isModule(name2) || isScoped(name2);
|
|
10132
8932
|
}
|
|
10133
|
-
function typeTest(
|
|
8933
|
+
function typeTest(name2, context, path23) {
|
|
10134
8934
|
const { settings } = context;
|
|
10135
|
-
if (typeof
|
|
10136
|
-
if (isInternalRegexMatch(
|
|
8935
|
+
if (typeof name2 === "string") {
|
|
8936
|
+
if (isInternalRegexMatch(name2, settings)) {
|
|
10137
8937
|
return "internal";
|
|
10138
8938
|
}
|
|
10139
|
-
if (isAbsolute3(
|
|
8939
|
+
if (isAbsolute3(name2)) {
|
|
10140
8940
|
return "absolute";
|
|
10141
8941
|
}
|
|
10142
|
-
if (isBuiltIn(
|
|
8942
|
+
if (isBuiltIn(name2, settings, path23)) {
|
|
10143
8943
|
return "builtin";
|
|
10144
8944
|
}
|
|
10145
|
-
if (isRelativeToParent(
|
|
8945
|
+
if (isRelativeToParent(name2)) {
|
|
10146
8946
|
return "parent";
|
|
10147
8947
|
}
|
|
10148
|
-
if (isIndex(
|
|
8948
|
+
if (isIndex(name2)) {
|
|
10149
8949
|
return "index";
|
|
10150
8950
|
}
|
|
10151
|
-
if (isRelativeToSibling(
|
|
8951
|
+
if (isRelativeToSibling(name2)) {
|
|
10152
8952
|
return "sibling";
|
|
10153
8953
|
}
|
|
10154
8954
|
}
|
|
@@ -10158,13 +8958,13 @@ function typeTest(name3, context, path23) {
|
|
|
10158
8958
|
if (isInternalPath(path23, context)) {
|
|
10159
8959
|
return "internal";
|
|
10160
8960
|
}
|
|
10161
|
-
if (typeof
|
|
8961
|
+
if (typeof name2 === "string" && isExternalLookingName(name2)) {
|
|
10162
8962
|
return "external";
|
|
10163
8963
|
}
|
|
10164
8964
|
return "unknown";
|
|
10165
8965
|
}
|
|
10166
|
-
function importType(
|
|
10167
|
-
return typeTest(
|
|
8966
|
+
function importType(name2, context) {
|
|
8967
|
+
return typeTest(name2, context, typeof name2 === "string" ? resolve3(name2, context) : null);
|
|
10168
8968
|
}
|
|
10169
8969
|
|
|
10170
8970
|
// ../../node_modules/.pnpm/eslint-plugin-import-x@4.17.1_patch_hash=2fde63e367ada6ae348459ff5a2b0bbc53a12189dad6a5_9840712109fb59ffd84be76551e40796/node_modules/eslint-plugin-import-x/lib/utils/legacy-resolver-settings.js
|
|
@@ -10204,32 +9004,32 @@ function normalizeConfigResolvers(resolvers, sourceFile) {
|
|
|
10204
9004
|
const map = /* @__PURE__ */ new Map();
|
|
10205
9005
|
for (const nameOrRecordOrObject of resolverArray) {
|
|
10206
9006
|
if (typeof nameOrRecordOrObject === "string") {
|
|
10207
|
-
const
|
|
10208
|
-
map.set(
|
|
10209
|
-
name:
|
|
9007
|
+
const name2 = nameOrRecordOrObject;
|
|
9008
|
+
map.set(name2, {
|
|
9009
|
+
name: name2,
|
|
10210
9010
|
enable: true,
|
|
10211
9011
|
options: void 0,
|
|
10212
|
-
resolver: requireResolver(
|
|
9012
|
+
resolver: requireResolver(name2, sourceFile)
|
|
10213
9013
|
});
|
|
10214
9014
|
} else if (typeof nameOrRecordOrObject === "object") {
|
|
10215
9015
|
if (nameOrRecordOrObject.name && nameOrRecordOrObject.resolver) {
|
|
10216
9016
|
const object2 = nameOrRecordOrObject;
|
|
10217
|
-
const { name:
|
|
10218
|
-
map.set(
|
|
9017
|
+
const { name: name2, enable = true, options, resolver } = object2;
|
|
9018
|
+
map.set(name2, { name: name2, enable, options, resolver });
|
|
10219
9019
|
} else {
|
|
10220
9020
|
const record2 = nameOrRecordOrObject;
|
|
10221
|
-
for (const [
|
|
10222
|
-
const resolver = requireResolver(
|
|
9021
|
+
for (const [name2, enableOrOptions] of Object.entries(record2)) {
|
|
9022
|
+
const resolver = requireResolver(name2, sourceFile);
|
|
10223
9023
|
if (typeof enableOrOptions === "boolean") {
|
|
10224
|
-
map.set(
|
|
10225
|
-
name:
|
|
9024
|
+
map.set(name2, {
|
|
9025
|
+
name: name2,
|
|
10226
9026
|
enable: enableOrOptions,
|
|
10227
9027
|
options: void 0,
|
|
10228
9028
|
resolver
|
|
10229
9029
|
});
|
|
10230
9030
|
} else {
|
|
10231
|
-
map.set(
|
|
10232
|
-
name:
|
|
9031
|
+
map.set(name2, {
|
|
9032
|
+
name: name2,
|
|
10233
9033
|
enable: true,
|
|
10234
9034
|
options: enableOrOptions,
|
|
10235
9035
|
resolver
|
|
@@ -10253,18 +9053,18 @@ try {
|
|
|
10253
9053
|
LEGACY_NODE_RESOLVERS.add(cjsRequire.resolve("eslint-import-resolver-node"));
|
|
10254
9054
|
} catch {
|
|
10255
9055
|
}
|
|
10256
|
-
function requireResolver(
|
|
10257
|
-
const resolver = tryRequire(`eslint-import-resolver-${
|
|
9056
|
+
function requireResolver(name2, sourceFile) {
|
|
9057
|
+
const resolver = tryRequire(`eslint-import-resolver-${name2}`, sourceFile) || tryRequire(name2, sourceFile) || tryRequire(path16__default.default.resolve(getBaseDir(sourceFile), name2));
|
|
10258
9058
|
if (!resolver) {
|
|
10259
|
-
if (LEGACY_NODE_RESOLVERS.has(
|
|
9059
|
+
if (LEGACY_NODE_RESOLVERS.has(name2)) {
|
|
10260
9060
|
return void 0;
|
|
10261
9061
|
}
|
|
10262
|
-
const err = new Error(`unable to load resolver "${
|
|
9062
|
+
const err = new Error(`unable to load resolver "${name2}".`);
|
|
10263
9063
|
err.name = IMPORT_RESOLVE_ERROR_NAME;
|
|
10264
9064
|
throw err;
|
|
10265
9065
|
}
|
|
10266
9066
|
if (!isLegacyResolverValid(resolver)) {
|
|
10267
|
-
const err = new Error(`${
|
|
9067
|
+
const err = new Error(`${name2} with invalid interface loaded as resolver`);
|
|
10268
9068
|
err.name = IMPORT_RESOLVE_ERROR_NAME;
|
|
10269
9069
|
throw err;
|
|
10270
9070
|
}
|
|
@@ -10518,11 +9318,11 @@ function fullResolve(modulePath, sourceFile, settings, context) {
|
|
|
10518
9318
|
};
|
|
10519
9319
|
const sourceFiles = context.physicalFilename === sourceFile || !isExternalLookingName(modulePath) ? [sourceFile] : [sourceFile, context.physicalFilename];
|
|
10520
9320
|
for (const sourceFile2 of sourceFiles) {
|
|
10521
|
-
for (const { enable, name:
|
|
9321
|
+
for (const { enable, name: name2, options, resolver } of normalizeConfigResolvers(configResolvers, sourceFile2)) {
|
|
10522
9322
|
if (!enable) {
|
|
10523
9323
|
continue;
|
|
10524
9324
|
}
|
|
10525
|
-
if (LEGACY_NODE_RESOLVERS.has(
|
|
9325
|
+
if (LEGACY_NODE_RESOLVERS.has(name2)) {
|
|
10526
9326
|
const resolverOptions = options || {};
|
|
10527
9327
|
const resolved2 = legacyNodeResolve(resolverOptions, context, modulePath, sourceFile2);
|
|
10528
9328
|
if (resolved2?.found) {
|
|
@@ -11052,44 +9852,44 @@ var ExportMap = class _ExportMap {
|
|
|
11052
9852
|
}
|
|
11053
9853
|
return size;
|
|
11054
9854
|
}
|
|
11055
|
-
has(
|
|
11056
|
-
if (this.namespace.has(
|
|
9855
|
+
has(name2) {
|
|
9856
|
+
if (this.namespace.has(name2)) {
|
|
11057
9857
|
return true;
|
|
11058
9858
|
}
|
|
11059
|
-
if (this.reexports.has(
|
|
9859
|
+
if (this.reexports.has(name2)) {
|
|
11060
9860
|
return true;
|
|
11061
9861
|
}
|
|
11062
|
-
if (
|
|
9862
|
+
if (name2 !== "default") {
|
|
11063
9863
|
for (const dep of this.dependencies) {
|
|
11064
9864
|
const innerMap = dep();
|
|
11065
9865
|
if (!innerMap) {
|
|
11066
9866
|
continue;
|
|
11067
9867
|
}
|
|
11068
|
-
if (innerMap.has(
|
|
9868
|
+
if (innerMap.has(name2)) {
|
|
11069
9869
|
return true;
|
|
11070
9870
|
}
|
|
11071
9871
|
}
|
|
11072
9872
|
}
|
|
11073
9873
|
return false;
|
|
11074
9874
|
}
|
|
11075
|
-
hasDeep(
|
|
11076
|
-
if (this.namespace.has(
|
|
9875
|
+
hasDeep(name2) {
|
|
9876
|
+
if (this.namespace.has(name2)) {
|
|
11077
9877
|
return { found: true, path: [this] };
|
|
11078
9878
|
}
|
|
11079
|
-
if (this.reexports.has(
|
|
11080
|
-
const reexports = this.reexports.get(
|
|
9879
|
+
if (this.reexports.has(name2)) {
|
|
9880
|
+
const reexports = this.reexports.get(name2);
|
|
11081
9881
|
const imported = reexports.getImport();
|
|
11082
9882
|
if (imported == null) {
|
|
11083
9883
|
return { found: true, path: [this] };
|
|
11084
9884
|
}
|
|
11085
|
-
if (imported.path === this.path && reexports.local ===
|
|
9885
|
+
if (imported.path === this.path && reexports.local === name2) {
|
|
11086
9886
|
return { found: false, path: [this] };
|
|
11087
9887
|
}
|
|
11088
9888
|
const deep = imported.hasDeep(reexports.local);
|
|
11089
9889
|
deep.path.unshift(this);
|
|
11090
9890
|
return deep;
|
|
11091
9891
|
}
|
|
11092
|
-
if (
|
|
9892
|
+
if (name2 !== "default") {
|
|
11093
9893
|
for (const dep of this.dependencies) {
|
|
11094
9894
|
const innerMap = dep();
|
|
11095
9895
|
if (innerMap == null) {
|
|
@@ -11101,7 +9901,7 @@ var ExportMap = class _ExportMap {
|
|
|
11101
9901
|
if (innerMap.path === this.path) {
|
|
11102
9902
|
continue;
|
|
11103
9903
|
}
|
|
11104
|
-
const innerValue = innerMap.hasDeep(
|
|
9904
|
+
const innerValue = innerMap.hasDeep(name2);
|
|
11105
9905
|
if (innerValue.found) {
|
|
11106
9906
|
innerValue.path.unshift(this);
|
|
11107
9907
|
return innerValue;
|
|
@@ -11110,22 +9910,22 @@ var ExportMap = class _ExportMap {
|
|
|
11110
9910
|
}
|
|
11111
9911
|
return { found: false, path: [this] };
|
|
11112
9912
|
}
|
|
11113
|
-
get(
|
|
11114
|
-
if (this.namespace.has(
|
|
11115
|
-
return this.namespace.get(
|
|
9913
|
+
get(name2) {
|
|
9914
|
+
if (this.namespace.has(name2)) {
|
|
9915
|
+
return this.namespace.get(name2);
|
|
11116
9916
|
}
|
|
11117
|
-
if (this.reexports.has(
|
|
11118
|
-
const reexports = this.reexports.get(
|
|
9917
|
+
if (this.reexports.has(name2)) {
|
|
9918
|
+
const reexports = this.reexports.get(name2);
|
|
11119
9919
|
const imported = reexports.getImport();
|
|
11120
9920
|
if (imported == null) {
|
|
11121
9921
|
return null;
|
|
11122
9922
|
}
|
|
11123
|
-
if (imported.path === this.path && reexports.local ===
|
|
9923
|
+
if (imported.path === this.path && reexports.local === name2) {
|
|
11124
9924
|
return void 0;
|
|
11125
9925
|
}
|
|
11126
9926
|
return imported.get(reexports.local);
|
|
11127
9927
|
}
|
|
11128
|
-
if (
|
|
9928
|
+
if (name2 !== "default") {
|
|
11129
9929
|
for (const dep of this.dependencies) {
|
|
11130
9930
|
const innerMap = dep();
|
|
11131
9931
|
if (!innerMap) {
|
|
@@ -11134,7 +9934,7 @@ var ExportMap = class _ExportMap {
|
|
|
11134
9934
|
if (innerMap.path === this.path) {
|
|
11135
9935
|
continue;
|
|
11136
9936
|
}
|
|
11137
|
-
const innerValue = innerMap.get(
|
|
9937
|
+
const innerValue = innerMap.get(name2);
|
|
11138
9938
|
if (innerValue !== void 0) {
|
|
11139
9939
|
return innerValue;
|
|
11140
9940
|
}
|
|
@@ -11145,9 +9945,9 @@ var ExportMap = class _ExportMap {
|
|
|
11145
9945
|
for (const [n, v] of this.namespace.entries()) {
|
|
11146
9946
|
callback.call(thisArg, v, n, this);
|
|
11147
9947
|
}
|
|
11148
|
-
for (const [
|
|
9948
|
+
for (const [name2, reexports] of this.reexports.entries()) {
|
|
11149
9949
|
const reexported = reexports.getImport();
|
|
11150
|
-
callback.call(thisArg, reexported?.get(reexports.local),
|
|
9950
|
+
callback.call(thisArg, reexported?.get(reexports.local), name2, this);
|
|
11151
9951
|
}
|
|
11152
9952
|
this.dependencies.forEach((dep) => {
|
|
11153
9953
|
const d = dep();
|
|
@@ -11436,7 +10236,7 @@ function moduleVisitor(visitor, options) {
|
|
|
11436
10236
|
return visitors;
|
|
11437
10237
|
}
|
|
11438
10238
|
function makeOptionsSchema(additionalProperties) {
|
|
11439
|
-
const
|
|
10239
|
+
const base3 = {
|
|
11440
10240
|
type: "object",
|
|
11441
10241
|
properties: {
|
|
11442
10242
|
commonjs: { type: "boolean" },
|
|
@@ -11452,10 +10252,10 @@ function makeOptionsSchema(additionalProperties) {
|
|
|
11452
10252
|
};
|
|
11453
10253
|
if (additionalProperties) {
|
|
11454
10254
|
for (const key in additionalProperties) {
|
|
11455
|
-
|
|
10255
|
+
base3.properties[key] = additionalProperties[key];
|
|
11456
10256
|
}
|
|
11457
10257
|
}
|
|
11458
|
-
return
|
|
10258
|
+
return base3;
|
|
11459
10259
|
}
|
|
11460
10260
|
makeOptionsSchema();
|
|
11461
10261
|
|
|
@@ -11937,12 +10737,12 @@ var export_default = createRule3({
|
|
|
11937
10737
|
defaultOptions: [],
|
|
11938
10738
|
create(context) {
|
|
11939
10739
|
const namespace = /* @__PURE__ */ new Map([[rootProgram, /* @__PURE__ */ new Map()]]);
|
|
11940
|
-
function addNamed(
|
|
10740
|
+
function addNamed(name2, node2, parent, isType) {
|
|
11941
10741
|
if (!namespace.has(parent)) {
|
|
11942
10742
|
namespace.set(parent, /* @__PURE__ */ new Map());
|
|
11943
10743
|
}
|
|
11944
10744
|
const named = namespace.get(parent);
|
|
11945
|
-
const key = isType ? `${tsTypePrefix}${
|
|
10745
|
+
const key = isType ? `${tsTypePrefix}${name2}` : name2;
|
|
11946
10746
|
let nodes = named.get(key);
|
|
11947
10747
|
if (nodes == null) {
|
|
11948
10748
|
nodes = /* @__PURE__ */ new Set();
|
|
@@ -11998,10 +10798,10 @@ var export_default = createRule3({
|
|
|
11998
10798
|
}
|
|
11999
10799
|
const parent = getParent(node2);
|
|
12000
10800
|
let any2 = false;
|
|
12001
|
-
remoteExports.$forEach((_,
|
|
12002
|
-
if (
|
|
10801
|
+
remoteExports.$forEach((_, name2) => {
|
|
10802
|
+
if (name2 !== "default") {
|
|
12003
10803
|
any2 = true;
|
|
12004
|
-
addNamed(
|
|
10804
|
+
addNamed(name2, node2, parent);
|
|
12005
10805
|
}
|
|
12006
10806
|
});
|
|
12007
10807
|
if (!any2) {
|
|
@@ -12014,7 +10814,7 @@ var export_default = createRule3({
|
|
|
12014
10814
|
},
|
|
12015
10815
|
"Program:exit"() {
|
|
12016
10816
|
for (const [, named] of namespace) {
|
|
12017
|
-
for (const [
|
|
10817
|
+
for (const [name2, nodes] of named) {
|
|
12018
10818
|
if (nodes.size === 0) {
|
|
12019
10819
|
continue;
|
|
12020
10820
|
}
|
|
@@ -12029,7 +10829,7 @@ var export_default = createRule3({
|
|
|
12029
10829
|
if (shouldSkipTypescriptNamespace(node2, nodes)) {
|
|
12030
10830
|
continue;
|
|
12031
10831
|
}
|
|
12032
|
-
if (
|
|
10832
|
+
if (name2 === "default") {
|
|
12033
10833
|
context.report({
|
|
12034
10834
|
node: node2,
|
|
12035
10835
|
messageId: "multiDefault"
|
|
@@ -12039,7 +10839,7 @@ var export_default = createRule3({
|
|
|
12039
10839
|
node: node2,
|
|
12040
10840
|
messageId: "multiNamed",
|
|
12041
10841
|
data: {
|
|
12042
|
-
name:
|
|
10842
|
+
name: name2.replace(tsTypePrefix, "")
|
|
12043
10843
|
}
|
|
12044
10844
|
});
|
|
12045
10845
|
}
|
|
@@ -14365,8 +13165,8 @@ var named_default = createRule3({
|
|
|
14365
13165
|
continue;
|
|
14366
13166
|
}
|
|
14367
13167
|
const imNode = im[key];
|
|
14368
|
-
const
|
|
14369
|
-
const deepLookup = imports2.hasDeep(
|
|
13168
|
+
const name2 = imNode.name || imNode.value;
|
|
13169
|
+
const deepLookup = imports2.hasDeep(name2);
|
|
14370
13170
|
if (!deepLookup.found) {
|
|
14371
13171
|
if (deepLookup.path.length > 1) {
|
|
14372
13172
|
const deepPath = deepLookup.path.map((i) => path16__default.default.relative(path16__default.default.dirname(context.physicalFilename), i.path)).join(" -> ");
|
|
@@ -14374,7 +13174,7 @@ var named_default = createRule3({
|
|
|
14374
13174
|
node: imNode,
|
|
14375
13175
|
messageId: "notFoundDeep",
|
|
14376
13176
|
data: {
|
|
14377
|
-
name:
|
|
13177
|
+
name: name2,
|
|
14378
13178
|
deepPath
|
|
14379
13179
|
}
|
|
14380
13180
|
});
|
|
@@ -14383,7 +13183,7 @@ var named_default = createRule3({
|
|
|
14383
13183
|
node: imNode,
|
|
14384
13184
|
messageId: "notFound",
|
|
14385
13185
|
data: {
|
|
14386
|
-
name:
|
|
13186
|
+
name: name2,
|
|
14387
13187
|
path: node2.source.value
|
|
14388
13188
|
}
|
|
14389
13189
|
});
|
|
@@ -15265,7 +14065,7 @@ var no_cycle_default = createRule3({
|
|
|
15265
14065
|
}
|
|
15266
14066
|
const options = context.options[0] || {};
|
|
15267
14067
|
const maxDepth = typeof options.maxDepth === "number" ? options.maxDepth : Number.POSITIVE_INFINITY;
|
|
15268
|
-
const ignoreModule = options.ignoreExternal ? (
|
|
14068
|
+
const ignoreModule = options.ignoreExternal ? (name2) => isExternalModule(name2, resolve3(name2, context), context) : () => false;
|
|
15269
14069
|
return {
|
|
15270
14070
|
...moduleVisitor(function checkSourceValue(sourceNode, importer) {
|
|
15271
14071
|
if (ignoreModule(sourceNode.value)) {
|
|
@@ -16095,8 +14895,8 @@ function getDependencies(context, packageDir) {
|
|
|
16095
14895
|
}
|
|
16096
14896
|
}
|
|
16097
14897
|
}
|
|
16098
|
-
function getModuleOriginalName(
|
|
16099
|
-
const [first, second] =
|
|
14898
|
+
function getModuleOriginalName(name2) {
|
|
14899
|
+
const [first, second] = name2.split("/");
|
|
16100
14900
|
return first.startsWith("@") ? `${first}/${second}` : first;
|
|
16101
14901
|
}
|
|
16102
14902
|
function checkDependencyDeclaration(deps, packageName, declarationStatus) {
|
|
@@ -16123,19 +14923,19 @@ function checkDependencyDeclaration(deps, packageName, declarationStatus) {
|
|
|
16123
14923
|
isInBundledDeps: result.isInBundledDeps || deps.bundledDependencies.includes(ancestorName)
|
|
16124
14924
|
}), newDeclarationStatus);
|
|
16125
14925
|
}
|
|
16126
|
-
function reportIfMissing(context, deps, depsOptions, node2,
|
|
14926
|
+
function reportIfMissing(context, deps, depsOptions, node2, name2, whitelist) {
|
|
16127
14927
|
if (!depsOptions.verifyTypeImports && ("importKind" in node2 && (node2.importKind === "type" || node2.importKind === "typeof") || "exportKind" in node2 && node2.exportKind === "type" || "specifiers" in node2 && Array.isArray(node2.specifiers) && node2.specifiers.length > 0 && node2.specifiers.every((specifier) => "importKind" in specifier && (specifier.importKind === "type" || specifier.importKind === "typeof")))) {
|
|
16128
14928
|
return;
|
|
16129
14929
|
}
|
|
16130
|
-
const typeOfImport = importType(
|
|
14930
|
+
const typeOfImport = importType(name2, context);
|
|
16131
14931
|
if (typeOfImport !== "external" && (typeOfImport !== "internal" || !depsOptions.verifyInternalDeps)) {
|
|
16132
14932
|
return;
|
|
16133
14933
|
}
|
|
16134
|
-
const resolved = resolve3(
|
|
14934
|
+
const resolved = resolve3(name2, context);
|
|
16135
14935
|
if (!resolved) {
|
|
16136
14936
|
return;
|
|
16137
14937
|
}
|
|
16138
|
-
const importPackageName = getModuleOriginalName(
|
|
14938
|
+
const importPackageName = getModuleOriginalName(name2);
|
|
16139
14939
|
let declarationStatus = checkDependencyDeclaration(deps, importPackageName);
|
|
16140
14940
|
if (declarationStatus.isInDeps || depsOptions.allowDevDeps && declarationStatus.isInDevDeps || depsOptions.allowPeerDeps && declarationStatus.isInPeerDeps || depsOptions.allowOptDeps && declarationStatus.isInOptDeps || depsOptions.allowBundledDeps && declarationStatus.isInBundledDeps) {
|
|
16141
14941
|
return;
|
|
@@ -16470,9 +15270,9 @@ var no_mutable_exports_default = createRule3({
|
|
|
16470
15270
|
});
|
|
16471
15271
|
}
|
|
16472
15272
|
}
|
|
16473
|
-
function checkDeclarationsInScope({ variables },
|
|
15273
|
+
function checkDeclarationsInScope({ variables }, name2) {
|
|
16474
15274
|
for (const variable of variables) {
|
|
16475
|
-
if (variable.name ===
|
|
15275
|
+
if (variable.name === name2) {
|
|
16476
15276
|
for (const def of variable.defs) {
|
|
16477
15277
|
if (def.type === "Variable" && def.parent) {
|
|
16478
15278
|
checkDeclaration(def.parent);
|
|
@@ -16824,21 +15624,21 @@ function getVariableNamesInScope(scopeManager, node2) {
|
|
|
16824
15624
|
}
|
|
16825
15625
|
function generateLocalNames(names, nameConflicts, namespaceName) {
|
|
16826
15626
|
const localNames = {};
|
|
16827
|
-
for (const
|
|
15627
|
+
for (const name2 of names) {
|
|
16828
15628
|
let localName;
|
|
16829
|
-
if (!nameConflicts[
|
|
16830
|
-
localName =
|
|
16831
|
-
} else if (nameConflicts[
|
|
15629
|
+
if (!nameConflicts[name2].has(name2)) {
|
|
15630
|
+
localName = name2;
|
|
15631
|
+
} else if (nameConflicts[name2].has(`${namespaceName}_${name2}`)) {
|
|
16832
15632
|
for (let i = 1; i < Number.POSITIVE_INFINITY; i++) {
|
|
16833
|
-
if (!nameConflicts[
|
|
16834
|
-
localName = `${namespaceName}_${
|
|
15633
|
+
if (!nameConflicts[name2].has(`${namespaceName}_${name2}_${i}`)) {
|
|
15634
|
+
localName = `${namespaceName}_${name2}_${i}`;
|
|
16835
15635
|
break;
|
|
16836
15636
|
}
|
|
16837
15637
|
}
|
|
16838
15638
|
} else {
|
|
16839
|
-
localName = `${namespaceName}_${
|
|
15639
|
+
localName = `${namespaceName}_${name2}`;
|
|
16840
15640
|
}
|
|
16841
|
-
localNames[
|
|
15641
|
+
localNames[name2] = localName;
|
|
16842
15642
|
}
|
|
16843
15643
|
return localNames;
|
|
16844
15644
|
}
|
|
@@ -18045,8 +16845,8 @@ In the meantime, if you want to keep this rule enabled, you can suppress this wa
|
|
|
18045
16845
|
}
|
|
18046
16846
|
}
|
|
18047
16847
|
}
|
|
18048
|
-
forEachDeclarationIdentifier(s.declaration, (
|
|
18049
|
-
newExportIdentifiers.add(
|
|
16848
|
+
forEachDeclarationIdentifier(s.declaration, (name2) => {
|
|
16849
|
+
newExportIdentifiers.add(name2);
|
|
18050
16850
|
});
|
|
18051
16851
|
}
|
|
18052
16852
|
}
|
|
@@ -18121,11 +16921,11 @@ In the meantime, if you want to keep this rule enabled, you can suppress this wa
|
|
|
18121
16921
|
if (astNode.type === AST_NODE_TYPES3.ExportNamedDeclaration && astNode.source) {
|
|
18122
16922
|
resolvedPath = resolve3(astNode.source.raw.replaceAll(/('|")/g, ""), context);
|
|
18123
16923
|
for (const specifier of astNode.specifiers) {
|
|
18124
|
-
const
|
|
18125
|
-
if (
|
|
16924
|
+
const name2 = getValue(specifier.local);
|
|
16925
|
+
if (name2 === DEFAULT) {
|
|
18126
16926
|
newDefaultImports.add(resolvedPath);
|
|
18127
16927
|
} else {
|
|
18128
|
-
newImports.set(
|
|
16928
|
+
newImports.set(name2, resolvedPath);
|
|
18129
16929
|
}
|
|
18130
16930
|
}
|
|
18131
16931
|
}
|
|
@@ -18323,8 +17123,8 @@ In the meantime, if you want to keep this rule enabled, you can suppress this wa
|
|
|
18323
17123
|
for (const specifier of node2.specifiers) {
|
|
18324
17124
|
checkUsage(specifier, getValue(specifier.exported), false);
|
|
18325
17125
|
}
|
|
18326
|
-
forEachDeclarationIdentifier(node2.declaration, (
|
|
18327
|
-
checkUsage(node2,
|
|
17126
|
+
forEachDeclarationIdentifier(node2.declaration, (name2, isTypeExport) => {
|
|
17127
|
+
checkUsage(node2, name2, isTypeExport);
|
|
18328
17128
|
});
|
|
18329
17129
|
}
|
|
18330
17130
|
};
|
|
@@ -19342,11 +18142,11 @@ var order_default = createRule3({
|
|
|
19342
18142
|
return {
|
|
19343
18143
|
ImportDeclaration(node2) {
|
|
19344
18144
|
if (node2.specifiers.length > 0 || options.warnOnUnassignedImports) {
|
|
19345
|
-
const
|
|
18145
|
+
const name2 = node2.source.value;
|
|
19346
18146
|
registerNode(context, {
|
|
19347
18147
|
node: node2,
|
|
19348
|
-
value:
|
|
19349
|
-
displayName:
|
|
18148
|
+
value: name2,
|
|
18149
|
+
displayName: name2,
|
|
19350
18150
|
type: "import"
|
|
19351
18151
|
}, ranks, getBlockImports(node2.parent), pathGroupsExcludedImportTypes, isSortingTypesGroup);
|
|
19352
18152
|
if (named.import) {
|
|
@@ -19468,11 +18268,11 @@ var order_default = createRule3({
|
|
|
19468
18268
|
} else {
|
|
19469
18269
|
const nameParts = getNamedCJSExports(context, node2.left);
|
|
19470
18270
|
if (nameParts && nameParts.length > 0) {
|
|
19471
|
-
const
|
|
18271
|
+
const name2 = nameParts.join(".");
|
|
19472
18272
|
getBlockExports(node2.parent.parent).push({
|
|
19473
18273
|
node: node2,
|
|
19474
|
-
value:
|
|
19475
|
-
displayName:
|
|
18274
|
+
value: name2,
|
|
18275
|
+
displayName: name2,
|
|
19476
18276
|
type: "export",
|
|
19477
18277
|
rank: 0
|
|
19478
18278
|
});
|
|
@@ -19834,7 +18634,7 @@ var getImportSource;
|
|
|
19834
18634
|
var isAllSameSubmodule;
|
|
19835
18635
|
var prefer_zod_namespace_default;
|
|
19836
18636
|
var init_prefer_zod_namespace = __esm2({ "src/rules/prefer-zod-namespace.ts"() {
|
|
19837
|
-
createRule4 = utils.ESLintUtils.RuleCreator((
|
|
18637
|
+
createRule4 = utils.ESLintUtils.RuleCreator((name2) => `https://github.com/samchungy/eslint-plugin-import-zod/blob/main/docs/rules/${name2}.md`);
|
|
19838
18638
|
getImportSource = (importedName, originalSource) => {
|
|
19839
18639
|
return importedName === "core" && originalSource === "zod/v4" ? `${originalSource}/${importedName}` : originalSource;
|
|
19840
18640
|
};
|
|
@@ -21491,7 +20291,7 @@ async function pnpm(options = {}) {
|
|
|
21491
20291
|
} = options;
|
|
21492
20292
|
const workspaceRoot = findWorkspaceRoot2();
|
|
21493
20293
|
await ensurePackages(["@storm-software/eslint-plugin-pnpm", "jsonc-eslint-parser", "yaml-eslint-parser"]);
|
|
21494
|
-
const [
|
|
20294
|
+
const [plugin8, parserJsonc3, parserYaml2] = await Promise.all([
|
|
21495
20295
|
interopDefault(Promise.resolve().then(() => (init_src2(), src_exports2))),
|
|
21496
20296
|
interopDefault(import('jsonc-eslint-parser')),
|
|
21497
20297
|
interopDefault(import('yaml-eslint-parser'))
|
|
@@ -21539,7 +20339,7 @@ async function pnpm(options = {}) {
|
|
|
21539
20339
|
{
|
|
21540
20340
|
name: "storm/pnpm/setup",
|
|
21541
20341
|
plugins: {
|
|
21542
|
-
pnpm:
|
|
20342
|
+
pnpm: plugin8
|
|
21543
20343
|
}
|
|
21544
20344
|
},
|
|
21545
20345
|
{
|
|
@@ -21847,12 +20647,12 @@ async function reactNative(options = {}) {
|
|
|
21847
20647
|
init_cjs_shims();
|
|
21848
20648
|
async function regexp(options = {}) {
|
|
21849
20649
|
const config7 = eslintPluginRegexp.configs["flat/recommended"];
|
|
21850
|
-
const
|
|
20650
|
+
const rules6 = {
|
|
21851
20651
|
...config7.rules
|
|
21852
20652
|
};
|
|
21853
20653
|
if (options.level === "warn") {
|
|
21854
|
-
for (const key in
|
|
21855
|
-
if (
|
|
20654
|
+
for (const key in rules6) {
|
|
20655
|
+
if (rules6[key] === "error") rules6[key] = "warn";
|
|
21856
20656
|
}
|
|
21857
20657
|
}
|
|
21858
20658
|
return [
|
|
@@ -21860,7 +20660,7 @@ async function regexp(options = {}) {
|
|
|
21860
20660
|
...config7,
|
|
21861
20661
|
name: "storm/regexp/rules",
|
|
21862
20662
|
rules: {
|
|
21863
|
-
...
|
|
20663
|
+
...rules6,
|
|
21864
20664
|
"regexp/no-unused-capturing-group": [
|
|
21865
20665
|
"error",
|
|
21866
20666
|
{
|
|
@@ -22183,10 +20983,10 @@ async function storybook(options = {}) {
|
|
|
22183
20983
|
// src/configs/test.ts
|
|
22184
20984
|
init_cjs_shims();
|
|
22185
20985
|
init_globs();
|
|
22186
|
-
var
|
|
20986
|
+
var plugin6;
|
|
22187
20987
|
async function test(options = {}) {
|
|
22188
20988
|
const { files = GLOB_TESTS, isInEditor = false, overrides = {} } = options;
|
|
22189
|
-
|
|
20989
|
+
plugin6 = plugin6 || {
|
|
22190
20990
|
...default4__default.default,
|
|
22191
20991
|
rules: {
|
|
22192
20992
|
...default4__default.default.rules,
|
|
@@ -22198,7 +20998,7 @@ async function test(options = {}) {
|
|
|
22198
20998
|
{
|
|
22199
20999
|
name: "storm/test/setup",
|
|
22200
21000
|
plugins: {
|
|
22201
|
-
test:
|
|
21001
|
+
test: plugin6
|
|
22202
21002
|
}
|
|
22203
21003
|
},
|
|
22204
21004
|
{
|
|
@@ -22828,7 +21628,7 @@ function getOverrides(options, key) {
|
|
|
22828
21628
|
}
|
|
22829
21629
|
function preset(options, ...userConfigs) {
|
|
22830
21630
|
const {
|
|
22831
|
-
name:
|
|
21631
|
+
name: name2,
|
|
22832
21632
|
globals = {},
|
|
22833
21633
|
banner: enableBanner = true,
|
|
22834
21634
|
astro: enableAstro = false,
|
|
@@ -22868,10 +21668,10 @@ function preset(options, ...userConfigs) {
|
|
|
22868
21668
|
if (stylisticOptions && !("jsx" in stylisticOptions)) {
|
|
22869
21669
|
stylisticOptions.jsx = enableJsx;
|
|
22870
21670
|
}
|
|
22871
|
-
const
|
|
21671
|
+
const configs7 = [];
|
|
22872
21672
|
if (enableGitignore) {
|
|
22873
21673
|
if (typeof enableGitignore !== "boolean") {
|
|
22874
|
-
|
|
21674
|
+
configs7.push(
|
|
22875
21675
|
interopDefault(import('eslint-config-flat-gitignore')).then((r) => [
|
|
22876
21676
|
r({
|
|
22877
21677
|
name: "storm/gitignore",
|
|
@@ -22880,7 +21680,7 @@ function preset(options, ...userConfigs) {
|
|
|
22880
21680
|
])
|
|
22881
21681
|
);
|
|
22882
21682
|
} else {
|
|
22883
|
-
|
|
21683
|
+
configs7.push(
|
|
22884
21684
|
interopDefault(import('eslint-config-flat-gitignore')).then((r) => [
|
|
22885
21685
|
r({
|
|
22886
21686
|
name: "storm/gitignore",
|
|
@@ -22890,7 +21690,7 @@ function preset(options, ...userConfigs) {
|
|
|
22890
21690
|
);
|
|
22891
21691
|
}
|
|
22892
21692
|
}
|
|
22893
|
-
|
|
21693
|
+
configs7.push(
|
|
22894
21694
|
ignores(options.ignores),
|
|
22895
21695
|
javascript({
|
|
22896
21696
|
globals,
|
|
@@ -22915,7 +21715,7 @@ function preset(options, ...userConfigs) {
|
|
|
22915
21715
|
}
|
|
22916
21716
|
}
|
|
22917
21717
|
if (enableTypeScript) {
|
|
22918
|
-
|
|
21718
|
+
configs7.push(
|
|
22919
21719
|
typescript({
|
|
22920
21720
|
...typescriptOptions,
|
|
22921
21721
|
tsconfigPath: typescriptOptions.tsconfigPath === false ? void 0 : typescriptOptions.tsconfigPath,
|
|
@@ -22926,25 +21726,25 @@ function preset(options, ...userConfigs) {
|
|
|
22926
21726
|
);
|
|
22927
21727
|
}
|
|
22928
21728
|
if (enableBanner) {
|
|
22929
|
-
|
|
21729
|
+
configs7.push(
|
|
22930
21730
|
banner({
|
|
22931
21731
|
...resolveSubOptions(options, "banner"),
|
|
22932
|
-
name:
|
|
21732
|
+
name: name2,
|
|
22933
21733
|
overrides: getOverrides(options, "banner")
|
|
22934
21734
|
})
|
|
22935
21735
|
);
|
|
22936
21736
|
}
|
|
22937
21737
|
if (!stylisticOptions) {
|
|
22938
|
-
|
|
21738
|
+
configs7.push(prettier());
|
|
22939
21739
|
}
|
|
22940
21740
|
if (enableCSpell) {
|
|
22941
|
-
|
|
21741
|
+
configs7.push(cspell(resolveSubOptions(options, "cspell")));
|
|
22942
21742
|
}
|
|
22943
21743
|
if (enableUnicorn) {
|
|
22944
|
-
|
|
21744
|
+
configs7.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
22945
21745
|
}
|
|
22946
21746
|
if (enableJSDoc) {
|
|
22947
|
-
|
|
21747
|
+
configs7.push(
|
|
22948
21748
|
jsdoc({
|
|
22949
21749
|
...resolveSubOptions(options, "jsdoc"),
|
|
22950
21750
|
overrides: getOverrides(options, "jsdoc")
|
|
@@ -22952,7 +21752,7 @@ function preset(options, ...userConfigs) {
|
|
|
22952
21752
|
);
|
|
22953
21753
|
}
|
|
22954
21754
|
if (enableTSDoc) {
|
|
22955
|
-
|
|
21755
|
+
configs7.push(
|
|
22956
21756
|
tsdoc({
|
|
22957
21757
|
...resolveSubOptions(options, "tsdoc"),
|
|
22958
21758
|
overrides: getOverrides(options, "tsdoc")
|
|
@@ -22960,17 +21760,17 @@ function preset(options, ...userConfigs) {
|
|
|
22960
21760
|
);
|
|
22961
21761
|
}
|
|
22962
21762
|
if (enableJsx) {
|
|
22963
|
-
|
|
21763
|
+
configs7.push(jsx());
|
|
22964
21764
|
}
|
|
22965
21765
|
if (enableZod) {
|
|
22966
|
-
|
|
21766
|
+
configs7.push(
|
|
22967
21767
|
zod({
|
|
22968
21768
|
overrides: getOverrides(options, "zod")
|
|
22969
21769
|
})
|
|
22970
21770
|
);
|
|
22971
21771
|
}
|
|
22972
21772
|
if (stylisticOptions) {
|
|
22973
|
-
|
|
21773
|
+
configs7.push(
|
|
22974
21774
|
stylistic({
|
|
22975
21775
|
...stylisticOptions,
|
|
22976
21776
|
lineEndings: stylisticOptions.lineEndings ?? "unix",
|
|
@@ -22980,10 +21780,10 @@ function preset(options, ...userConfigs) {
|
|
|
22980
21780
|
);
|
|
22981
21781
|
}
|
|
22982
21782
|
if (enableRegexp) {
|
|
22983
|
-
|
|
21783
|
+
configs7.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
22984
21784
|
}
|
|
22985
21785
|
if (enableTest) {
|
|
22986
|
-
|
|
21786
|
+
configs7.push(
|
|
22987
21787
|
test({
|
|
22988
21788
|
isInEditor,
|
|
22989
21789
|
overrides: getOverrides(options, "test")
|
|
@@ -22991,10 +21791,10 @@ function preset(options, ...userConfigs) {
|
|
|
22991
21791
|
);
|
|
22992
21792
|
}
|
|
22993
21793
|
if (enableGraphQL) {
|
|
22994
|
-
|
|
21794
|
+
configs7.push(graphql(resolveSubOptions(options, "graphql")));
|
|
22995
21795
|
}
|
|
22996
21796
|
if (enableReact) {
|
|
22997
|
-
|
|
21797
|
+
configs7.push(
|
|
22998
21798
|
react({
|
|
22999
21799
|
...typescriptOptions,
|
|
23000
21800
|
tsconfigPath: typescriptOptions.tsconfigPath === false ? void 0 : typescriptOptions.tsconfigPath,
|
|
@@ -23004,7 +21804,7 @@ function preset(options, ...userConfigs) {
|
|
|
23004
21804
|
);
|
|
23005
21805
|
}
|
|
23006
21806
|
if (enableReactNative) {
|
|
23007
|
-
|
|
21807
|
+
configs7.push(
|
|
23008
21808
|
reactNative({
|
|
23009
21809
|
...resolveSubOptions(options, "react-native"),
|
|
23010
21810
|
overrides: getOverrides(options, "react-native")
|
|
@@ -23012,13 +21812,13 @@ function preset(options, ...userConfigs) {
|
|
|
23012
21812
|
);
|
|
23013
21813
|
}
|
|
23014
21814
|
if (enableNext) {
|
|
23015
|
-
|
|
21815
|
+
configs7.push(next(resolveSubOptions(options, "next")));
|
|
23016
21816
|
}
|
|
23017
21817
|
if (enableStorybook) {
|
|
23018
|
-
|
|
21818
|
+
configs7.push(storybook(resolveSubOptions(options, "storybook")));
|
|
23019
21819
|
}
|
|
23020
21820
|
if (enableUnoCSS) {
|
|
23021
|
-
|
|
21821
|
+
configs7.push(
|
|
23022
21822
|
unocss({
|
|
23023
21823
|
...resolveSubOptions(options, "unocss"),
|
|
23024
21824
|
overrides: getOverrides(options, "unocss")
|
|
@@ -23026,7 +21826,7 @@ function preset(options, ...userConfigs) {
|
|
|
23026
21826
|
);
|
|
23027
21827
|
}
|
|
23028
21828
|
if (enableAstro) {
|
|
23029
|
-
|
|
21829
|
+
configs7.push(
|
|
23030
21830
|
astro({
|
|
23031
21831
|
overrides: getOverrides(options, "astro"),
|
|
23032
21832
|
stylistic: stylisticOptions
|
|
@@ -23034,7 +21834,7 @@ function preset(options, ...userConfigs) {
|
|
|
23034
21834
|
);
|
|
23035
21835
|
}
|
|
23036
21836
|
if (enablePnpm ?? packageManager !== "bun") {
|
|
23037
|
-
|
|
21837
|
+
configs7.push(
|
|
23038
21838
|
pnpm({
|
|
23039
21839
|
overrides: getOverrides(options, "pnpm"),
|
|
23040
21840
|
ignore: typeof enablePnpm !== "boolean" ? enablePnpm?.ignore : void 0
|
|
@@ -23042,13 +21842,13 @@ function preset(options, ...userConfigs) {
|
|
|
23042
21842
|
);
|
|
23043
21843
|
}
|
|
23044
21844
|
if (enableBun ?? packageManager === "bun") {
|
|
23045
|
-
|
|
21845
|
+
configs7.push(bun({
|
|
23046
21846
|
overrides: getOverrides(options, "bun"),
|
|
23047
21847
|
ignore: typeof enableBun !== "boolean" ? enableBun?.ignore : void 0
|
|
23048
21848
|
}));
|
|
23049
21849
|
}
|
|
23050
21850
|
if (options.jsonc ?? true) {
|
|
23051
|
-
|
|
21851
|
+
configs7.push(
|
|
23052
21852
|
jsonc({
|
|
23053
21853
|
overrides: getOverrides(options, "jsonc"),
|
|
23054
21854
|
stylistic: stylisticOptions
|
|
@@ -23056,11 +21856,11 @@ function preset(options, ...userConfigs) {
|
|
|
23056
21856
|
sortTsconfig()
|
|
23057
21857
|
);
|
|
23058
21858
|
if (stylisticOptions) {
|
|
23059
|
-
|
|
21859
|
+
configs7.push(sortPackageJson());
|
|
23060
21860
|
}
|
|
23061
21861
|
}
|
|
23062
21862
|
if (options.yaml ?? true) {
|
|
23063
|
-
|
|
21863
|
+
configs7.push(
|
|
23064
21864
|
yaml({
|
|
23065
21865
|
overrides: getOverrides(options, "yaml"),
|
|
23066
21866
|
stylistic: stylisticOptions
|
|
@@ -23068,7 +21868,7 @@ function preset(options, ...userConfigs) {
|
|
|
23068
21868
|
);
|
|
23069
21869
|
}
|
|
23070
21870
|
if (options.toml ?? true) {
|
|
23071
|
-
|
|
21871
|
+
configs7.push(
|
|
23072
21872
|
toml({
|
|
23073
21873
|
overrides: getOverrides(options, "toml"),
|
|
23074
21874
|
stylistic: stylisticOptions
|
|
@@ -23076,28 +21876,28 @@ function preset(options, ...userConfigs) {
|
|
|
23076
21876
|
);
|
|
23077
21877
|
}
|
|
23078
21878
|
if (options.markdown === true) {
|
|
23079
|
-
|
|
21879
|
+
configs7.push(
|
|
23080
21880
|
markdown({
|
|
23081
21881
|
overrides: getOverrides(options, "markdown")
|
|
23082
21882
|
})
|
|
23083
21883
|
);
|
|
23084
21884
|
}
|
|
23085
21885
|
if (enableMdx) {
|
|
23086
|
-
|
|
21886
|
+
configs7.push(
|
|
23087
21887
|
mdx({
|
|
23088
21888
|
overrides: getOverrides(options, "mdx")
|
|
23089
21889
|
})
|
|
23090
21890
|
);
|
|
23091
21891
|
}
|
|
23092
21892
|
if (options.formatters) {
|
|
23093
|
-
|
|
21893
|
+
configs7.push(
|
|
23094
21894
|
formatters(
|
|
23095
21895
|
options.formatters,
|
|
23096
21896
|
typeof stylisticOptions === "boolean" ? {} : stylisticOptions
|
|
23097
21897
|
)
|
|
23098
21898
|
);
|
|
23099
21899
|
}
|
|
23100
|
-
|
|
21900
|
+
configs7.push(disables());
|
|
23101
21901
|
if ("files" in options) {
|
|
23102
21902
|
throw new Error(
|
|
23103
21903
|
'[@storm-software/eslint] The first argument should not contain the "files" property as the options are supposed to be global. Place it in the second or later config instead.'
|
|
@@ -23109,10 +21909,10 @@ function preset(options, ...userConfigs) {
|
|
|
23109
21909
|
}
|
|
23110
21910
|
return acc;
|
|
23111
21911
|
}, {});
|
|
23112
|
-
if (Object.keys(fusedConfig).length)
|
|
21912
|
+
if (Object.keys(fusedConfig).length) configs7.push([fusedConfig]);
|
|
23113
21913
|
let composer = new eslintFlatConfigUtils.FlatConfigComposer();
|
|
23114
21914
|
composer = composer.append(
|
|
23115
|
-
...
|
|
21915
|
+
...configs7,
|
|
23116
21916
|
...userConfigs
|
|
23117
21917
|
);
|
|
23118
21918
|
if (autoRenamePlugins) {
|