@storm-software/eslint 0.170.150 → 0.170.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-2CLFLESM.js → chunk-CHTU7LQW.js} +4 -4
- package/dist/index.cjs +381 -1601
- package/dist/index.js +2 -2
- package/dist/preset.cjs +381 -1601
- package/dist/preset.js +1 -1
- package/dist/src-4HCE5P4U.js +57 -0
- package/dist/{src-5KKSORLE.js → src-5IQYTQH3.js} +1 -1
- package/dist/src-KDHLMR2Q.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,7 +324,7 @@ 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.5",
|
|
325
328
|
private: false,
|
|
326
329
|
description: "An ESLint Plugin that enforces Bun catalog rules in Storm Software projects.",
|
|
327
330
|
keywords: ["eslint", "eslint-plugin", "storm-software", "bun", "catalog"],
|
|
@@ -427,7 +430,7 @@ var init_package = __esm({
|
|
|
427
430
|
});
|
|
428
431
|
function RuleCreator2(urlCreator) {
|
|
429
432
|
return function createNamedRule({
|
|
430
|
-
name:
|
|
433
|
+
name: name2,
|
|
431
434
|
meta: meta3,
|
|
432
435
|
...rule
|
|
433
436
|
}) {
|
|
@@ -436,7 +439,7 @@ function RuleCreator2(urlCreator) {
|
|
|
436
439
|
...meta3,
|
|
437
440
|
docs: {
|
|
438
441
|
...meta3.docs,
|
|
439
|
-
url: urlCreator(
|
|
442
|
+
url: urlCreator(name2)
|
|
440
443
|
}
|
|
441
444
|
},
|
|
442
445
|
...rule
|
|
@@ -480,8 +483,8 @@ function detectCatalogRoot(data) {
|
|
|
480
483
|
}
|
|
481
484
|
return isWorkspaceObject(data.workspaces) ? "workspaces" : "top";
|
|
482
485
|
}
|
|
483
|
-
function normalizeCatalogName(
|
|
484
|
-
return
|
|
486
|
+
function normalizeCatalogName(name2) {
|
|
487
|
+
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
488
|
}
|
|
486
489
|
function sortObjectKeys(input) {
|
|
487
490
|
return Object.fromEntries(
|
|
@@ -610,9 +613,9 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
610
613
|
const found = [];
|
|
611
614
|
const { catalog, catalogs } = getCatalogData();
|
|
612
615
|
if (catalogs) {
|
|
613
|
-
for (const
|
|
614
|
-
if (catalogs[
|
|
615
|
-
found.push(
|
|
616
|
+
for (const name2 of Object.keys(catalogs)) {
|
|
617
|
+
if (catalogs[name2]?.[packageName]) {
|
|
618
|
+
found.push(name2);
|
|
616
619
|
}
|
|
617
620
|
}
|
|
618
621
|
}
|
|
@@ -621,7 +624,7 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
621
624
|
}
|
|
622
625
|
return found;
|
|
623
626
|
};
|
|
624
|
-
const
|
|
627
|
+
const workspace2 = {
|
|
625
628
|
filepath: current,
|
|
626
629
|
setContent(newContent) {
|
|
627
630
|
content = newContent;
|
|
@@ -646,7 +649,7 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
646
649
|
const clone2 = [...queue];
|
|
647
650
|
queue.length = 0;
|
|
648
651
|
for (const queued of clone2) {
|
|
649
|
-
queued(
|
|
652
|
+
queued(workspace2);
|
|
650
653
|
}
|
|
651
654
|
if (hasChanged) {
|
|
652
655
|
write();
|
|
@@ -678,7 +681,7 @@ function readBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
|
678
681
|
return [];
|
|
679
682
|
}
|
|
680
683
|
};
|
|
681
|
-
return
|
|
684
|
+
return workspace2;
|
|
682
685
|
}
|
|
683
686
|
function getBunWorkspace(cwd2 = process2__default.default.cwd()) {
|
|
684
687
|
if (workspaceLastRead && workspace && !workspace.hasQueue() && Date.now() - workspaceLastRead > WORKSPACE_CACHE_TIME) {
|
|
@@ -874,7 +877,7 @@ var init_json_enforce_catalog = __esm({
|
|
|
874
877
|
context,
|
|
875
878
|
fields
|
|
876
879
|
)) {
|
|
877
|
-
if (ignore2?.some((
|
|
880
|
+
if (ignore2?.some((name2) => name2 === packageName)) {
|
|
878
881
|
continue;
|
|
879
882
|
}
|
|
880
883
|
if (specifier.startsWith("catalog:")) {
|
|
@@ -883,14 +886,14 @@ var init_json_enforce_catalog = __esm({
|
|
|
883
886
|
if (allowedProtocols?.some((protocol) => specifier.startsWith(protocol))) {
|
|
884
887
|
continue;
|
|
885
888
|
}
|
|
886
|
-
let
|
|
889
|
+
let workspace2;
|
|
887
890
|
try {
|
|
888
|
-
|
|
891
|
+
workspace2 = getBunWorkspace();
|
|
889
892
|
} catch {
|
|
890
893
|
return {};
|
|
891
894
|
}
|
|
892
|
-
let targetCatalog = reuseExistingCatalog ?
|
|
893
|
-
const resolvedConflicts =
|
|
895
|
+
let targetCatalog = reuseExistingCatalog ? workspace2.getPackageCatalogs(packageName)[0] || defaultCatalog : defaultCatalog;
|
|
896
|
+
const resolvedConflicts = workspace2.hasSpecifierConflicts(
|
|
894
897
|
targetCatalog,
|
|
895
898
|
packageName,
|
|
896
899
|
specifier
|
|
@@ -910,8 +913,8 @@ var init_json_enforce_catalog = __esm({
|
|
|
910
913
|
packageName
|
|
911
914
|
},
|
|
912
915
|
fix: shouldFix ? (fixer) => {
|
|
913
|
-
|
|
914
|
-
|
|
916
|
+
workspace2.queueChange(() => {
|
|
917
|
+
workspace2.setPackage(targetCatalog, packageName, specifier);
|
|
915
918
|
});
|
|
916
919
|
return fixer.replaceText(
|
|
917
920
|
property.value,
|
|
@@ -968,16 +971,16 @@ var init_json_no_duplicate_catalog_item = __esm({
|
|
|
968
971
|
if (!isRootWorkspacePackageJson(context.filename)) {
|
|
969
972
|
return {};
|
|
970
973
|
}
|
|
971
|
-
let
|
|
974
|
+
let workspace2;
|
|
972
975
|
try {
|
|
973
|
-
|
|
976
|
+
workspace2 = getBunWorkspace();
|
|
974
977
|
} catch {
|
|
975
978
|
return {};
|
|
976
979
|
}
|
|
977
|
-
if (
|
|
980
|
+
if (workspace2.hasChanged() || workspace2.hasQueue()) {
|
|
978
981
|
return {};
|
|
979
982
|
}
|
|
980
|
-
|
|
983
|
+
workspace2.setContent(context.sourceCode.text);
|
|
981
984
|
const root = getPackageJsonRootNode(context);
|
|
982
985
|
if (!root) {
|
|
983
986
|
return {};
|
|
@@ -1070,16 +1073,16 @@ var init_json_no_unused_catalog_item = __esm({
|
|
|
1070
1073
|
if (!isRootWorkspacePackageJson(context.filename)) {
|
|
1071
1074
|
return {};
|
|
1072
1075
|
}
|
|
1073
|
-
let
|
|
1076
|
+
let workspace2;
|
|
1074
1077
|
try {
|
|
1075
|
-
|
|
1078
|
+
workspace2 = getBunWorkspace();
|
|
1076
1079
|
} catch {
|
|
1077
1080
|
return {};
|
|
1078
1081
|
}
|
|
1079
|
-
if (
|
|
1082
|
+
if (workspace2.hasChanged() || workspace2.hasQueue()) {
|
|
1080
1083
|
return {};
|
|
1081
1084
|
}
|
|
1082
|
-
|
|
1085
|
+
workspace2.setContent(context.sourceCode.text);
|
|
1083
1086
|
const root = getPackageJsonRootNode(context);
|
|
1084
1087
|
if (!root) {
|
|
1085
1088
|
return {};
|
|
@@ -1111,7 +1114,7 @@ var init_json_no_unused_catalog_item = __esm({
|
|
|
1111
1114
|
if (entries.size === 0) {
|
|
1112
1115
|
return {};
|
|
1113
1116
|
}
|
|
1114
|
-
const packages = collectWorkspacePackageJsonPaths(
|
|
1117
|
+
const packages = collectWorkspacePackageJsonPaths(workspace2);
|
|
1115
1118
|
for (const path23 of packages) {
|
|
1116
1119
|
const pkg = JSON.parse(fs__default.default.readFileSync(path23, "utf8"));
|
|
1117
1120
|
for (const field of FIELDS) {
|
|
@@ -1119,12 +1122,12 @@ var init_json_no_unused_catalog_item = __esm({
|
|
|
1119
1122
|
if (!map) {
|
|
1120
1123
|
continue;
|
|
1121
1124
|
}
|
|
1122
|
-
for (const [
|
|
1125
|
+
for (const [name2, value] of Object.entries(map)) {
|
|
1123
1126
|
if (typeof value !== "string" || !value.startsWith("catalog:")) {
|
|
1124
1127
|
continue;
|
|
1125
1128
|
}
|
|
1126
1129
|
const catalogName = value.slice(8) || "default";
|
|
1127
|
-
entries.delete(`${
|
|
1130
|
+
entries.delete(`${name2}:${catalogName}`);
|
|
1128
1131
|
}
|
|
1129
1132
|
}
|
|
1130
1133
|
}
|
|
@@ -1217,14 +1220,14 @@ var init_json_valid_catalog = __esm({
|
|
|
1217
1220
|
if (!specifier.startsWith("catalog:")) {
|
|
1218
1221
|
continue;
|
|
1219
1222
|
}
|
|
1220
|
-
let
|
|
1223
|
+
let workspace2;
|
|
1221
1224
|
try {
|
|
1222
|
-
|
|
1225
|
+
workspace2 = getBunWorkspace();
|
|
1223
1226
|
} catch {
|
|
1224
1227
|
return {};
|
|
1225
1228
|
}
|
|
1226
1229
|
const currentCatalog = specifier.replace(/^catalog:/, "").trim() || "default";
|
|
1227
|
-
const existingCatalogs =
|
|
1230
|
+
const existingCatalogs = workspace2.getPackageCatalogs(packageName);
|
|
1228
1231
|
if (!existingCatalogs.includes(currentCatalog)) {
|
|
1229
1232
|
context.report({
|
|
1230
1233
|
node: property.value,
|
|
@@ -1237,8 +1240,8 @@ var init_json_valid_catalog = __esm({
|
|
|
1237
1240
|
let catalog = existingCatalogs[0];
|
|
1238
1241
|
if (!catalog && autoInsert) {
|
|
1239
1242
|
catalog = currentCatalog;
|
|
1240
|
-
|
|
1241
|
-
|
|
1243
|
+
workspace2.queueChange(() => {
|
|
1244
|
+
workspace2.setPackage(
|
|
1242
1245
|
catalog,
|
|
1243
1246
|
packageName,
|
|
1244
1247
|
autoInsertDefaultSpecifier
|
|
@@ -1258,787 +1261,105 @@ var init_json_valid_catalog = __esm({
|
|
|
1258
1261
|
});
|
|
1259
1262
|
}
|
|
1260
1263
|
});
|
|
1261
|
-
|
|
1262
|
-
// ../eslint-plugin-bun/src/plugin.ts
|
|
1263
|
-
var plugin2;
|
|
1264
|
-
var init_plugin = __esm({
|
|
1265
|
-
"../eslint-plugin-bun/src/plugin.ts"() {
|
|
1266
|
-
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 = {
|
|
1264
|
+
|
|
1265
|
+
// ../eslint-plugin-bun/src/plugin.ts
|
|
1266
|
+
var plugin2;
|
|
1267
|
+
var init_plugin = __esm({
|
|
1268
|
+
"../eslint-plugin-bun/src/plugin.ts"() {
|
|
1269
|
+
init_cjs_shims();
|
|
1270
|
+
init_package();
|
|
1271
|
+
init_json_enforce_catalog();
|
|
1272
|
+
init_json_no_duplicate_catalog_item();
|
|
1273
|
+
init_json_no_unused_catalog_item();
|
|
1274
|
+
init_json_valid_catalog();
|
|
1275
|
+
plugin2 = {
|
|
1990
1276
|
meta: {
|
|
1991
|
-
name:
|
|
1992
|
-
version:
|
|
1277
|
+
name: "bun",
|
|
1278
|
+
version: package_default2.version
|
|
1993
1279
|
},
|
|
1994
|
-
rules:
|
|
1280
|
+
rules: {
|
|
1281
|
+
"json-enforce-catalog": json_enforce_catalog_default,
|
|
1282
|
+
"json-valid-catalog": json_valid_catalog_default,
|
|
1283
|
+
"json-no-unused-catalog-item": json_no_unused_catalog_item_default,
|
|
1284
|
+
"json-no-duplicate-catalog-item": json_no_duplicate_catalog_item_default
|
|
1285
|
+
}
|
|
1995
1286
|
};
|
|
1996
|
-
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
var config3, recommended_default2;
|
|
1290
|
+
var init_recommended = __esm({
|
|
1291
|
+
"../eslint-plugin-bun/src/configs/recommended.ts"() {
|
|
1292
|
+
init_cjs_shims();
|
|
1293
|
+
init_globs();
|
|
1294
|
+
init_plugin();
|
|
1295
|
+
config3 = [
|
|
1997
1296
|
{
|
|
1998
|
-
name: "
|
|
1999
|
-
files: [
|
|
2000
|
-
"package.json",
|
|
2001
|
-
"**/package.json"
|
|
2002
|
-
],
|
|
2003
|
-
languageOptions: {
|
|
2004
|
-
parser: parserJsonc__namespace
|
|
2005
|
-
},
|
|
1297
|
+
name: "bun/recommended/setup",
|
|
2006
1298
|
plugins: {
|
|
2007
|
-
|
|
2008
|
-
},
|
|
2009
|
-
rules: {
|
|
2010
|
-
"pnpm/json-enforce-catalog": "error",
|
|
2011
|
-
"pnpm/json-valid-catalog": "error",
|
|
2012
|
-
"pnpm/json-prefer-workspace-settings": "error"
|
|
1299
|
+
bun: plugin2
|
|
2013
1300
|
}
|
|
2014
|
-
}
|
|
2015
|
-
];
|
|
2016
|
-
configsYaml = [
|
|
1301
|
+
},
|
|
2017
1302
|
{
|
|
2018
|
-
name: "
|
|
2019
|
-
|
|
1303
|
+
name: "bun/recommended/package-json",
|
|
1304
|
+
ignores: GLOB_EXCLUDE,
|
|
1305
|
+
files: ["package.json", "**/package.json"],
|
|
2020
1306
|
languageOptions: {
|
|
2021
|
-
parser:
|
|
2022
|
-
},
|
|
2023
|
-
plugins: {
|
|
2024
|
-
pnpm: plugin4
|
|
1307
|
+
parser: parserJsonc__default.default
|
|
2025
1308
|
},
|
|
2026
1309
|
rules: {
|
|
2027
|
-
"
|
|
2028
|
-
|
|
1310
|
+
"bun/json-enforce-catalog": [
|
|
1311
|
+
"error",
|
|
1312
|
+
{
|
|
1313
|
+
autofix: true,
|
|
1314
|
+
allowedProtocols: ["workspace", "link", "file"],
|
|
1315
|
+
defaultCatalog: "default",
|
|
1316
|
+
reuseExistingCatalog: true,
|
|
1317
|
+
conflicts: "overrides",
|
|
1318
|
+
fields: ["dependencies", "devDependencies"],
|
|
1319
|
+
ignore: ["typescript"]
|
|
1320
|
+
}
|
|
1321
|
+
],
|
|
1322
|
+
"bun/json-valid-catalog": "error",
|
|
1323
|
+
"bun/json-no-unused-catalog-item": "error",
|
|
1324
|
+
"bun/json-no-duplicate-catalog-item": "error"
|
|
2029
1325
|
}
|
|
2030
1326
|
}
|
|
2031
1327
|
];
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
1328
|
+
recommended_default2 = config3;
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
// ../eslint-plugin-bun/src/configs/index.ts
|
|
1333
|
+
var configs2;
|
|
1334
|
+
var init_configs = __esm({
|
|
1335
|
+
"../eslint-plugin-bun/src/configs/index.ts"() {
|
|
1336
|
+
init_cjs_shims();
|
|
1337
|
+
init_recommended();
|
|
1338
|
+
configs2 = {
|
|
1339
|
+
recommended: recommended_default2
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1344
|
+
// ../eslint-plugin-bun/src/index.ts
|
|
1345
|
+
var src_exports = {};
|
|
1346
|
+
__export(src_exports, {
|
|
1347
|
+
configs: () => configs2,
|
|
1348
|
+
default: () => src_default2,
|
|
1349
|
+
rules: () => rules2
|
|
1350
|
+
});
|
|
1351
|
+
var eslintPlugin2, src_default2, rules2;
|
|
1352
|
+
var init_src = __esm({
|
|
1353
|
+
"../eslint-plugin-bun/src/index.ts"() {
|
|
1354
|
+
init_cjs_shims();
|
|
1355
|
+
init_configs();
|
|
1356
|
+
init_plugin();
|
|
1357
|
+
eslintPlugin2 = {
|
|
1358
|
+
...plugin2,
|
|
1359
|
+
configs: configs2
|
|
2040
1360
|
};
|
|
2041
|
-
|
|
1361
|
+
src_default2 = eslintPlugin2;
|
|
1362
|
+
rules2 = plugin2.rules;
|
|
2042
1363
|
}
|
|
2043
1364
|
});
|
|
2044
1365
|
|
|
@@ -2048,7 +1369,7 @@ var init_package2 = __esm({
|
|
|
2048
1369
|
"../eslint-plugin-pnpm/package.json"() {
|
|
2049
1370
|
package_default3 = {
|
|
2050
1371
|
name: "@storm-software/eslint-plugin-pnpm",
|
|
2051
|
-
version: "0.0.
|
|
1372
|
+
version: "0.0.80",
|
|
2052
1373
|
private: false,
|
|
2053
1374
|
description: "An ESLint Plugin that enforces PNPM-related rules in Storm Software projects.",
|
|
2054
1375
|
keywords: ["eslint", "eslint-plugin", "storm-software"],
|
|
@@ -2147,16 +1468,13 @@ var init_package2 = __esm({
|
|
|
2147
1468
|
};
|
|
2148
1469
|
}
|
|
2149
1470
|
});
|
|
2150
|
-
|
|
2151
|
-
// ../eslint-plugin-pnpm/src/plugin.ts
|
|
2152
|
-
var plugin5;
|
|
1471
|
+
var plugin4;
|
|
2153
1472
|
var init_plugin2 = __esm({
|
|
2154
1473
|
"../eslint-plugin-pnpm/src/plugin.ts"() {
|
|
2155
1474
|
init_cjs_shims();
|
|
2156
|
-
init_dist();
|
|
2157
1475
|
init_package2();
|
|
2158
|
-
|
|
2159
|
-
...
|
|
1476
|
+
plugin4 = {
|
|
1477
|
+
...base__default.default,
|
|
2160
1478
|
meta: {
|
|
2161
1479
|
name: "pnpm",
|
|
2162
1480
|
version: package_default3.version
|
|
@@ -2174,7 +1492,7 @@ var init_recommended2 = __esm({
|
|
|
2174
1492
|
{
|
|
2175
1493
|
name: "pnpm/recommended/setup",
|
|
2176
1494
|
plugins: {
|
|
2177
|
-
pnpm:
|
|
1495
|
+
pnpm: plugin4
|
|
2178
1496
|
}
|
|
2179
1497
|
},
|
|
2180
1498
|
{
|
|
@@ -2182,7 +1500,7 @@ var init_recommended2 = __esm({
|
|
|
2182
1500
|
ignores: GLOB_EXCLUDE,
|
|
2183
1501
|
files: ["package.json", "**/package.json"],
|
|
2184
1502
|
languageOptions: {
|
|
2185
|
-
parser:
|
|
1503
|
+
parser: parserJsonc__default.default
|
|
2186
1504
|
},
|
|
2187
1505
|
rules: {
|
|
2188
1506
|
"pnpm/json-enforce-catalog": [
|
|
@@ -2205,7 +1523,7 @@ var init_recommended2 = __esm({
|
|
|
2205
1523
|
ignores: GLOB_EXCLUDE,
|
|
2206
1524
|
files: ["pnpm-workspace.yaml", "**/pnpm-workspace.yaml"],
|
|
2207
1525
|
languageOptions: {
|
|
2208
|
-
parser:
|
|
1526
|
+
parser: parserYaml__default.default
|
|
2209
1527
|
},
|
|
2210
1528
|
rules: {
|
|
2211
1529
|
"pnpm/yaml-no-unused-catalog-item": "error",
|
|
@@ -2218,12 +1536,12 @@ var init_recommended2 = __esm({
|
|
|
2218
1536
|
});
|
|
2219
1537
|
|
|
2220
1538
|
// ../eslint-plugin-pnpm/src/configs/index.ts
|
|
2221
|
-
var
|
|
1539
|
+
var configs4;
|
|
2222
1540
|
var init_configs2 = __esm({
|
|
2223
1541
|
"../eslint-plugin-pnpm/src/configs/index.ts"() {
|
|
2224
1542
|
init_cjs_shims();
|
|
2225
1543
|
init_recommended2();
|
|
2226
|
-
|
|
1544
|
+
configs4 = {
|
|
2227
1545
|
recommended: recommended_default5
|
|
2228
1546
|
};
|
|
2229
1547
|
}
|
|
@@ -2232,22 +1550,22 @@ var init_configs2 = __esm({
|
|
|
2232
1550
|
// ../eslint-plugin-pnpm/src/index.ts
|
|
2233
1551
|
var src_exports2 = {};
|
|
2234
1552
|
__export(src_exports2, {
|
|
2235
|
-
configs: () =>
|
|
1553
|
+
configs: () => configs4,
|
|
2236
1554
|
default: () => src_default3,
|
|
2237
|
-
rules: () =>
|
|
1555
|
+
rules: () => rules4
|
|
2238
1556
|
});
|
|
2239
|
-
var eslintPlugin3, src_default3,
|
|
1557
|
+
var eslintPlugin3, src_default3, rules4;
|
|
2240
1558
|
var init_src2 = __esm({
|
|
2241
1559
|
"../eslint-plugin-pnpm/src/index.ts"() {
|
|
2242
1560
|
init_cjs_shims();
|
|
2243
1561
|
init_configs2();
|
|
2244
1562
|
init_plugin2();
|
|
2245
1563
|
eslintPlugin3 = {
|
|
2246
|
-
...
|
|
2247
|
-
configs:
|
|
1564
|
+
...plugin4,
|
|
1565
|
+
configs: configs4
|
|
2248
1566
|
};
|
|
2249
1567
|
src_default3 = eslintPlugin3;
|
|
2250
|
-
|
|
1568
|
+
rules4 = plugin4.rules;
|
|
2251
1569
|
}
|
|
2252
1570
|
});
|
|
2253
1571
|
|
|
@@ -2819,9 +2137,9 @@ var require_stylesheet = __commonJS({
|
|
|
2819
2137
|
},
|
|
2820
2138
|
getStyleReferenceFromExpression: function(node2) {
|
|
2821
2139
|
const result = [];
|
|
2822
|
-
const
|
|
2823
|
-
if (
|
|
2824
|
-
result.push(
|
|
2140
|
+
const name2 = astHelpers.getObjectName(node2);
|
|
2141
|
+
if (name2) {
|
|
2142
|
+
result.push(name2);
|
|
2825
2143
|
}
|
|
2826
2144
|
const property = astHelpers.getPropertyName(node2);
|
|
2827
2145
|
if (property) {
|
|
@@ -3217,10 +2535,10 @@ var require_split_platform_components = __commonJS({
|
|
|
3217
2535
|
return node2.name;
|
|
3218
2536
|
}
|
|
3219
2537
|
}
|
|
3220
|
-
function hasNodeWithName(nodes,
|
|
2538
|
+
function hasNodeWithName(nodes, name2) {
|
|
3221
2539
|
return nodes.some((node2) => {
|
|
3222
2540
|
const nodeName = getName(node2);
|
|
3223
|
-
return nodeName && nodeName.includes(
|
|
2541
|
+
return nodeName && nodeName.includes(name2);
|
|
3224
2542
|
});
|
|
3225
2543
|
}
|
|
3226
2544
|
function reportErrors(components, filename) {
|
|
@@ -3302,8 +2620,8 @@ var require_no_raw_text = __commonJS({
|
|
|
3302
2620
|
let curNode = parent;
|
|
3303
2621
|
while (curNode) {
|
|
3304
2622
|
if (curNode.type === "JSXElement") {
|
|
3305
|
-
const
|
|
3306
|
-
if (allowedElements.includes(
|
|
2623
|
+
const name2 = elementName(curNode);
|
|
2624
|
+
if (allowedElements.includes(name2)) {
|
|
3307
2625
|
return true;
|
|
3308
2626
|
}
|
|
3309
2627
|
}
|
|
@@ -3475,10 +2793,10 @@ var require_eslint_plugin_react_native = __commonJS({
|
|
|
3475
2793
|
"no-raw-text": require_no_raw_text(),
|
|
3476
2794
|
"no-single-element-style-arrays": require_no_single_element_style_arrays()
|
|
3477
2795
|
};
|
|
3478
|
-
function configureAsError(
|
|
2796
|
+
function configureAsError(rules6) {
|
|
3479
2797
|
const result = {};
|
|
3480
|
-
for (const key in
|
|
3481
|
-
if (!
|
|
2798
|
+
for (const key in rules6) {
|
|
2799
|
+
if (!rules6.hasOwnProperty(key)) {
|
|
3482
2800
|
continue;
|
|
3483
2801
|
}
|
|
3484
2802
|
result["react-native/" + key] = 2;
|
|
@@ -3520,547 +2838,13 @@ var require_eslint_plugin_react_native = __commonJS({
|
|
|
3520
2838
|
}
|
|
3521
2839
|
});
|
|
3522
2840
|
|
|
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
2841
|
// ../eslint-plugin-tsdoc/package.json
|
|
4058
2842
|
var package_default4;
|
|
4059
2843
|
var init_package3 = __esm({
|
|
4060
2844
|
"../eslint-plugin-tsdoc/package.json"() {
|
|
4061
2845
|
package_default4 = {
|
|
4062
2846
|
name: "@storm-software/eslint-plugin-tsdoc",
|
|
4063
|
-
version: "0.0.
|
|
2847
|
+
version: "0.0.80",
|
|
4064
2848
|
private: false,
|
|
4065
2849
|
description: "An ESLint Plugin that enforces TSDoc comments in Storm Software projects.",
|
|
4066
2850
|
keywords: ["eslint", "eslint-plugin", "storm-software"],
|
|
@@ -4114,7 +2898,6 @@ var init_package3 = __esm({
|
|
|
4114
2898
|
"@microsoft/tsdoc-config": "catalog:",
|
|
4115
2899
|
"@storm-software/package-constants": "workspace:*",
|
|
4116
2900
|
"@typescript-eslint/utils": "catalog:",
|
|
4117
|
-
ajv: "catalog:",
|
|
4118
2901
|
defu: "catalog:",
|
|
4119
2902
|
"es-errors": "1.3.0",
|
|
4120
2903
|
"fast-deep-equal": "3.1.3",
|
|
@@ -4164,16 +2947,13 @@ var init_package3 = __esm({
|
|
|
4164
2947
|
};
|
|
4165
2948
|
}
|
|
4166
2949
|
});
|
|
4167
|
-
|
|
4168
|
-
// ../eslint-plugin-tsdoc/src/plugin.ts
|
|
4169
|
-
var import_eslint_plugin_tsdoc, plugin8;
|
|
2950
|
+
var plugin7;
|
|
4170
2951
|
var init_plugin3 = __esm({
|
|
4171
2952
|
"../eslint-plugin-tsdoc/src/plugin.ts"() {
|
|
4172
2953
|
init_cjs_shims();
|
|
4173
|
-
import_eslint_plugin_tsdoc = __toESM(require_lib());
|
|
4174
2954
|
init_package3();
|
|
4175
|
-
|
|
4176
|
-
...
|
|
2955
|
+
plugin7 = {
|
|
2956
|
+
...base2__default.default,
|
|
4177
2957
|
meta: {
|
|
4178
2958
|
name: "tsdoc",
|
|
4179
2959
|
version: package_default4.version
|
|
@@ -4194,7 +2974,7 @@ var init_recommended3 = __esm({
|
|
|
4194
2974
|
ignores: GLOB_EXCLUDE,
|
|
4195
2975
|
name: "tsdoc/recommended",
|
|
4196
2976
|
plugins: {
|
|
4197
|
-
tsdoc:
|
|
2977
|
+
tsdoc: plugin7
|
|
4198
2978
|
},
|
|
4199
2979
|
rules: {
|
|
4200
2980
|
"tsdoc/syntax": ["error", { type: "recommended" }]
|
|
@@ -4205,12 +2985,12 @@ var init_recommended3 = __esm({
|
|
|
4205
2985
|
});
|
|
4206
2986
|
|
|
4207
2987
|
// ../eslint-plugin-tsdoc/src/configs/index.ts
|
|
4208
|
-
var
|
|
2988
|
+
var configs6;
|
|
4209
2989
|
var init_configs3 = __esm({
|
|
4210
2990
|
"../eslint-plugin-tsdoc/src/configs/index.ts"() {
|
|
4211
2991
|
init_cjs_shims();
|
|
4212
2992
|
init_recommended3();
|
|
4213
|
-
|
|
2993
|
+
configs6 = {
|
|
4214
2994
|
recommended: recommended_default6
|
|
4215
2995
|
};
|
|
4216
2996
|
}
|
|
@@ -4219,22 +2999,22 @@ var init_configs3 = __esm({
|
|
|
4219
2999
|
// ../eslint-plugin-tsdoc/src/index.ts
|
|
4220
3000
|
var src_exports3 = {};
|
|
4221
3001
|
__export(src_exports3, {
|
|
4222
|
-
configs: () =>
|
|
3002
|
+
configs: () => configs6,
|
|
4223
3003
|
default: () => src_default4,
|
|
4224
|
-
rules: () =>
|
|
3004
|
+
rules: () => rules5
|
|
4225
3005
|
});
|
|
4226
|
-
var eslintPlugin4, src_default4,
|
|
3006
|
+
var eslintPlugin4, src_default4, rules5;
|
|
4227
3007
|
var init_src3 = __esm({
|
|
4228
3008
|
"../eslint-plugin-tsdoc/src/index.ts"() {
|
|
4229
3009
|
init_cjs_shims();
|
|
4230
3010
|
init_configs3();
|
|
4231
3011
|
init_plugin3();
|
|
4232
3012
|
eslintPlugin4 = {
|
|
4233
|
-
...
|
|
4234
|
-
configs:
|
|
3013
|
+
...plugin7,
|
|
3014
|
+
configs: configs6
|
|
4235
3015
|
};
|
|
4236
3016
|
src_default4 = eslintPlugin4;
|
|
4237
|
-
|
|
3017
|
+
rules5 = plugin7.rules;
|
|
4238
3018
|
}
|
|
4239
3019
|
});
|
|
4240
3020
|
|
|
@@ -4284,8 +3064,8 @@ async function interopDefault(m) {
|
|
|
4284
3064
|
const resolved = await m;
|
|
4285
3065
|
return resolved.default || resolved;
|
|
4286
3066
|
}
|
|
4287
|
-
function isPackageInScope(
|
|
4288
|
-
return localPkg.isPackageExists(
|
|
3067
|
+
function isPackageInScope(name2) {
|
|
3068
|
+
return localPkg.isPackageExists(name2, { paths: [scopeUrl] });
|
|
4289
3069
|
}
|
|
4290
3070
|
async function ensurePackages(packages) {
|
|
4291
3071
|
if (process2__default.default.env.CI || process2__default.default.stdout.isTTY === false || isCwdInScope === false)
|
|
@@ -4305,9 +3085,9 @@ async function ensurePackages(packages) {
|
|
|
4305
3085
|
(i) => i.installPackage(nonExistingPackages, { dev: true })
|
|
4306
3086
|
);
|
|
4307
3087
|
}
|
|
4308
|
-
function renameRules(
|
|
3088
|
+
function renameRules(rules6, map) {
|
|
4309
3089
|
return Object.fromEntries(
|
|
4310
|
-
Object.entries(
|
|
3090
|
+
Object.entries(rules6).map(([key, value]) => {
|
|
4311
3091
|
for (const [from, to] of Object.entries(map)) {
|
|
4312
3092
|
if (key.startsWith(`${from}/`))
|
|
4313
3093
|
return [to + key.slice(from.length), value];
|
|
@@ -4947,7 +3727,7 @@ init_cjs_shims();
|
|
|
4947
3727
|
init_cjs_shims();
|
|
4948
3728
|
var _a;
|
|
4949
3729
|
// @__NO_SIDE_EFFECTS__
|
|
4950
|
-
function $constructor(
|
|
3730
|
+
function $constructor(name2, initializer2, params) {
|
|
4951
3731
|
function init(inst, def) {
|
|
4952
3732
|
if (!inst._zod) {
|
|
4953
3733
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -4959,10 +3739,10 @@ function $constructor(name3, initializer2, params) {
|
|
|
4959
3739
|
enumerable: false
|
|
4960
3740
|
});
|
|
4961
3741
|
}
|
|
4962
|
-
if (inst._zod.traits.has(
|
|
3742
|
+
if (inst._zod.traits.has(name2)) {
|
|
4963
3743
|
return;
|
|
4964
3744
|
}
|
|
4965
|
-
inst._zod.traits.add(
|
|
3745
|
+
inst._zod.traits.add(name2);
|
|
4966
3746
|
initializer2(inst, def);
|
|
4967
3747
|
const proto = _.prototype;
|
|
4968
3748
|
const keys = Object.keys(proto);
|
|
@@ -4976,7 +3756,7 @@ function $constructor(name3, initializer2, params) {
|
|
|
4976
3756
|
const Parent = params?.Parent ?? Object;
|
|
4977
3757
|
class Definition extends Parent {
|
|
4978
3758
|
}
|
|
4979
|
-
Object.defineProperty(Definition, "name", { value:
|
|
3759
|
+
Object.defineProperty(Definition, "name", { value: name2 });
|
|
4980
3760
|
function _(def) {
|
|
4981
3761
|
var _a4;
|
|
4982
3762
|
const inst = params?.Parent ? new Definition() : this;
|
|
@@ -4992,10 +3772,10 @@ function $constructor(name3, initializer2, params) {
|
|
|
4992
3772
|
value: (inst) => {
|
|
4993
3773
|
if (params?.Parent && inst instanceof params.Parent)
|
|
4994
3774
|
return true;
|
|
4995
|
-
return inst?._zod?.traits?.has(
|
|
3775
|
+
return inst?._zod?.traits?.has(name2);
|
|
4996
3776
|
}
|
|
4997
3777
|
});
|
|
4998
|
-
Object.defineProperty(_, "name", { value:
|
|
3778
|
+
Object.defineProperty(_, "name", { value: name2 });
|
|
4999
3779
|
return _;
|
|
5000
3780
|
}
|
|
5001
3781
|
var $ZodAsyncError = class extends Error {
|
|
@@ -6985,7 +5765,7 @@ async function getPackageJsonConfig(root) {
|
|
|
6985
5765
|
let license = STORM_DEFAULT_LICENSE;
|
|
6986
5766
|
let homepage = void 0;
|
|
6987
5767
|
let support = void 0;
|
|
6988
|
-
let
|
|
5768
|
+
let name2 = void 0;
|
|
6989
5769
|
let namespace = void 0;
|
|
6990
5770
|
let repository = void 0;
|
|
6991
5771
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
@@ -6997,7 +5777,7 @@ async function getPackageJsonConfig(root) {
|
|
|
6997
5777
|
if (file) {
|
|
6998
5778
|
const packageJson = JSON.parse(file);
|
|
6999
5779
|
if (packageJson.name) {
|
|
7000
|
-
|
|
5780
|
+
name2 = packageJson.name;
|
|
7001
5781
|
}
|
|
7002
5782
|
if (packageJson.namespace) {
|
|
7003
5783
|
namespace = packageJson.namespace;
|
|
@@ -7026,7 +5806,7 @@ async function getPackageJsonConfig(root) {
|
|
|
7026
5806
|
}
|
|
7027
5807
|
return {
|
|
7028
5808
|
workspaceRoot,
|
|
7029
|
-
name:
|
|
5809
|
+
name: name2,
|
|
7030
5810
|
namespace,
|
|
7031
5811
|
repository,
|
|
7032
5812
|
license,
|
|
@@ -7067,7 +5847,7 @@ function applyDefaultConfig(config7) {
|
|
|
7067
5847
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
7068
5848
|
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
7069
5849
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
7070
|
-
const
|
|
5850
|
+
const configs7 = await Promise.all([
|
|
7071
5851
|
c12.loadConfig({
|
|
7072
5852
|
cwd: workspacePath,
|
|
7073
5853
|
packageJson: true,
|
|
@@ -7098,7 +5878,7 @@ var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
|
7098
5878
|
...options
|
|
7099
5879
|
})
|
|
7100
5880
|
]);
|
|
7101
|
-
return defu__default.default(
|
|
5881
|
+
return defu__default.default(configs7[0] ?? {}, configs7[1] ?? {});
|
|
7102
5882
|
};
|
|
7103
5883
|
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
7104
5884
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
@@ -7854,7 +6634,7 @@ init_cjs_shims();
|
|
|
7854
6634
|
|
|
7855
6635
|
// ../eslint-plugin-banner/package.json
|
|
7856
6636
|
var package_default = {
|
|
7857
|
-
version: "0.0.
|
|
6637
|
+
version: "0.0.82"};
|
|
7858
6638
|
|
|
7859
6639
|
// ../eslint-plugin-banner/src/rules/banner.ts
|
|
7860
6640
|
init_cjs_shims();
|
|
@@ -7863,7 +6643,7 @@ init_cjs_shims();
|
|
|
7863
6643
|
init_cjs_shims();
|
|
7864
6644
|
function RuleCreator(urlCreator) {
|
|
7865
6645
|
return function createNamedRule({
|
|
7866
|
-
name:
|
|
6646
|
+
name: name2,
|
|
7867
6647
|
meta: meta3,
|
|
7868
6648
|
...rule
|
|
7869
6649
|
}) {
|
|
@@ -7872,7 +6652,7 @@ function RuleCreator(urlCreator) {
|
|
|
7872
6652
|
...meta3,
|
|
7873
6653
|
docs: {
|
|
7874
6654
|
...meta3.docs,
|
|
7875
|
-
url: urlCreator(
|
|
6655
|
+
url: urlCreator(name2)
|
|
7876
6656
|
}
|
|
7877
6657
|
},
|
|
7878
6658
|
...rule
|
|
@@ -7948,12 +6728,12 @@ var ACRONYMS_LIST = [
|
|
|
7948
6728
|
|
|
7949
6729
|
// ../eslint-plugin-banner/src/helpers/get-banner.ts
|
|
7950
6730
|
function getBanner(options) {
|
|
7951
|
-
const { name:
|
|
6731
|
+
const { name: name2 } = options;
|
|
7952
6732
|
let padding = " ";
|
|
7953
|
-
for (let i = 0; i <
|
|
6733
|
+
for (let i = 0; i < name2.length + 2 && padding.length > 4; i++) {
|
|
7954
6734
|
padding = padding.slice(0, -1);
|
|
7955
6735
|
}
|
|
7956
|
-
let titleName =
|
|
6736
|
+
let titleName = name2;
|
|
7957
6737
|
if (titleName) {
|
|
7958
6738
|
if (titleName?.startsWith("@")) {
|
|
7959
6739
|
titleName = titleName.slice(1);
|
|
@@ -7969,8 +6749,8 @@ function getBanner(options) {
|
|
|
7969
6749
|
const organization = options.organization || "storm-software";
|
|
7970
6750
|
const licensing = options.licensing?.replace(/\/$/, "") || "https://stormsoftware.com/licenses";
|
|
7971
6751
|
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${
|
|
6752
|
+
const repository = options.repository || `https://github.com/${organization}${name2 ? `/${name2}` : ""}`;
|
|
6753
|
+
const docs = options.docs || `https://docs.stormsoftware.com${name2 ? `/projects/${name2}` : ""}`;
|
|
7974
6754
|
const formattedOrganization = (organization.charAt(0).toUpperCase() + organization.slice(1)).split("-").filter((word) => word && word.length > 0).map((word) => {
|
|
7975
6755
|
if (ACRONYMS_LIST.includes(word.toUpperCase())) {
|
|
7976
6756
|
return word.toUpperCase();
|
|
@@ -7985,7 +6765,7 @@ ${padding}\u{1F5F2} ${formattedOrganization} ${titleName ? `- ${titleName}` : ""
|
|
|
7985
6765
|
This code was released as part of ${titleName ? `the ${titleName}` : `a ${formattedOrganization}`} project. ${titleName ? titleName : "The project"}
|
|
7986
6766
|
is maintained by ${formattedOrganization} under the ${license} license, and is
|
|
7987
6767
|
free for commercial and private use. For more information, please visit
|
|
7988
|
-
our licensing page at ${licensing}/${
|
|
6768
|
+
our licensing page at ${licensing}/${name2 ? `projects/${name2}` : ""}.
|
|
7989
6769
|
|
|
7990
6770
|
Website: ${homepage}
|
|
7991
6771
|
Repository: ${repository}
|
|
@@ -8185,7 +6965,7 @@ var banner_default = createRule({
|
|
|
8185
6965
|
],
|
|
8186
6966
|
create: (context) => {
|
|
8187
6967
|
const {
|
|
8188
|
-
name:
|
|
6968
|
+
name: name2,
|
|
8189
6969
|
license,
|
|
8190
6970
|
organization,
|
|
8191
6971
|
licensing,
|
|
@@ -8197,7 +6977,7 @@ var banner_default = createRule({
|
|
|
8197
6977
|
lineEndings
|
|
8198
6978
|
} = context.options[0];
|
|
8199
6979
|
const banner2 = getBanner({
|
|
8200
|
-
name:
|
|
6980
|
+
name: name2,
|
|
8201
6981
|
license,
|
|
8202
6982
|
organization,
|
|
8203
6983
|
licensing,
|
|
@@ -8740,7 +7520,7 @@ async function bun(options = {}) {
|
|
|
8740
7520
|
"@storm-software/eslint-plugin-bun",
|
|
8741
7521
|
"jsonc-eslint-parser"
|
|
8742
7522
|
]);
|
|
8743
|
-
const [
|
|
7523
|
+
const [plugin8, parserJsonc3] = await Promise.all([
|
|
8744
7524
|
interopDefault(Promise.resolve().then(() => (init_src(), src_exports))),
|
|
8745
7525
|
interopDefault(import('jsonc-eslint-parser'))
|
|
8746
7526
|
]);
|
|
@@ -8783,20 +7563,20 @@ async function bun(options = {}) {
|
|
|
8783
7563
|
}
|
|
8784
7564
|
});
|
|
8785
7565
|
}
|
|
8786
|
-
const
|
|
7566
|
+
const configs7 = (Array.isArray(plugin8.configs?.recommended) ? plugin8.configs.recommended : [plugin8.configs?.recommended]).filter(
|
|
8787
7567
|
(config7) => config7 && typeof config7 === "object" && "name" in config7 && !config7.name?.endsWith("setup")
|
|
8788
7568
|
);
|
|
8789
|
-
const packageJsonConfig =
|
|
7569
|
+
const packageJsonConfig = configs7.find(
|
|
8790
7570
|
(config7) => config7.name?.endsWith("package-json") ?? false
|
|
8791
7571
|
);
|
|
8792
7572
|
return [
|
|
8793
7573
|
{
|
|
8794
7574
|
name: "storm/bun/setup",
|
|
8795
7575
|
plugins: {
|
|
8796
|
-
bun:
|
|
7576
|
+
bun: plugin8
|
|
8797
7577
|
}
|
|
8798
7578
|
},
|
|
8799
|
-
...
|
|
7579
|
+
...configs7.map((config7) => ({
|
|
8800
7580
|
name: config7.name,
|
|
8801
7581
|
...config7
|
|
8802
7582
|
})),
|
|
@@ -9020,7 +7800,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9020
7800
|
options.dprintOptions ?? {}
|
|
9021
7801
|
);
|
|
9022
7802
|
const pluginFormat = await interopDefault(import('eslint-plugin-format'));
|
|
9023
|
-
const
|
|
7803
|
+
const configs7 = [
|
|
9024
7804
|
{
|
|
9025
7805
|
name: "storm/formatter/setup",
|
|
9026
7806
|
plugins: {
|
|
@@ -9029,7 +7809,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9029
7809
|
}
|
|
9030
7810
|
];
|
|
9031
7811
|
if (options.css) {
|
|
9032
|
-
|
|
7812
|
+
configs7.push(
|
|
9033
7813
|
{
|
|
9034
7814
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
9035
7815
|
languageOptions: {
|
|
@@ -9078,7 +7858,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9078
7858
|
);
|
|
9079
7859
|
}
|
|
9080
7860
|
if (options.html) {
|
|
9081
|
-
|
|
7861
|
+
configs7.push({
|
|
9082
7862
|
files: [GLOB_HTML],
|
|
9083
7863
|
languageOptions: {
|
|
9084
7864
|
parser: parserPlain
|
|
@@ -9095,7 +7875,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9095
7875
|
});
|
|
9096
7876
|
}
|
|
9097
7877
|
if (options.xml) {
|
|
9098
|
-
|
|
7878
|
+
configs7.push({
|
|
9099
7879
|
files: [GLOB_XML],
|
|
9100
7880
|
languageOptions: {
|
|
9101
7881
|
parser: parserPlain
|
|
@@ -9116,7 +7896,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9116
7896
|
});
|
|
9117
7897
|
}
|
|
9118
7898
|
if (options.svg) {
|
|
9119
|
-
|
|
7899
|
+
configs7.push({
|
|
9120
7900
|
files: [GLOB_SVG],
|
|
9121
7901
|
languageOptions: {
|
|
9122
7902
|
parser: parserPlain
|
|
@@ -9138,7 +7918,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9138
7918
|
}
|
|
9139
7919
|
if (options.markdown) {
|
|
9140
7920
|
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
9141
|
-
|
|
7921
|
+
configs7.push({
|
|
9142
7922
|
files: [GLOB_MARKDOWN],
|
|
9143
7923
|
languageOptions: {
|
|
9144
7924
|
parser: parserPlain
|
|
@@ -9159,7 +7939,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9159
7939
|
});
|
|
9160
7940
|
}
|
|
9161
7941
|
if (options.astro) {
|
|
9162
|
-
|
|
7942
|
+
configs7.push({
|
|
9163
7943
|
files: [GLOB_ASTRO],
|
|
9164
7944
|
languageOptions: {
|
|
9165
7945
|
parser: parserPlain
|
|
@@ -9175,7 +7955,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9175
7955
|
]
|
|
9176
7956
|
}
|
|
9177
7957
|
});
|
|
9178
|
-
|
|
7958
|
+
configs7.push({
|
|
9179
7959
|
files: [GLOB_ASTRO, GLOB_ASTRO_TS],
|
|
9180
7960
|
name: "storm/formatter/astro/disables",
|
|
9181
7961
|
rules: {
|
|
@@ -9190,7 +7970,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9190
7970
|
});
|
|
9191
7971
|
}
|
|
9192
7972
|
if (options.graphql) {
|
|
9193
|
-
|
|
7973
|
+
configs7.push({
|
|
9194
7974
|
files: [GLOB_GRAPHQL],
|
|
9195
7975
|
languageOptions: {
|
|
9196
7976
|
parser: parserPlain
|
|
@@ -9206,7 +7986,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
9206
7986
|
}
|
|
9207
7987
|
});
|
|
9208
7988
|
}
|
|
9209
|
-
return
|
|
7989
|
+
return configs7;
|
|
9210
7990
|
}
|
|
9211
7991
|
|
|
9212
7992
|
// src/configs/graphql.ts
|
|
@@ -9734,13 +8514,13 @@ var docsUrl = (ruleName, commitish = `v${version2}`) => `${repoUrl}/blob/${commi
|
|
|
9734
8514
|
|
|
9735
8515
|
// ../../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
8516
|
function RuleCreator3(urlCreator) {
|
|
9737
|
-
return function createNamedRule({ meta: meta3, name:
|
|
8517
|
+
return function createNamedRule({ meta: meta3, name: name2, ...rule }) {
|
|
9738
8518
|
return createRule_({
|
|
9739
8519
|
meta: {
|
|
9740
8520
|
...meta3,
|
|
9741
8521
|
docs: {
|
|
9742
8522
|
...meta3.docs,
|
|
9743
|
-
url: urlCreator(
|
|
8523
|
+
url: urlCreator(name2)
|
|
9744
8524
|
}
|
|
9745
8525
|
},
|
|
9746
8526
|
...rule
|
|
@@ -9761,9 +8541,9 @@ var createRule3 = RuleCreator3(docsUrl);
|
|
|
9761
8541
|
|
|
9762
8542
|
// ../../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
8543
|
init_cjs_shims();
|
|
9764
|
-
function declaredScope(context, node2,
|
|
8544
|
+
function declaredScope(context, node2, name2) {
|
|
9765
8545
|
const references = context.sourceCode.getScope(node2).references;
|
|
9766
|
-
const reference = references.find((x) => x.identifier.name ===
|
|
8546
|
+
const reference = references.find((x) => x.identifier.name === name2);
|
|
9767
8547
|
return reference?.resolved?.scope.type;
|
|
9768
8548
|
}
|
|
9769
8549
|
|
|
@@ -10058,49 +8838,49 @@ function getFilePackageName(filename) {
|
|
|
10058
8838
|
}
|
|
10059
8839
|
|
|
10060
8840
|
// ../../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] =
|
|
8841
|
+
function baseModule(name2) {
|
|
8842
|
+
if (isScoped(name2)) {
|
|
8843
|
+
const [scope, pkg2] = name2.split("/");
|
|
10064
8844
|
return `${scope}/${pkg2}`;
|
|
10065
8845
|
}
|
|
10066
|
-
const [pkg] =
|
|
8846
|
+
const [pkg] = name2.split("/");
|
|
10067
8847
|
return pkg;
|
|
10068
8848
|
}
|
|
10069
|
-
function isInternalRegexMatch(
|
|
8849
|
+
function isInternalRegexMatch(name2, settings) {
|
|
10070
8850
|
const internalScope = settings?.["import-x/internal-regex"];
|
|
10071
|
-
return internalScope && new RegExp(internalScope).test(
|
|
8851
|
+
return internalScope && new RegExp(internalScope).test(name2);
|
|
10072
8852
|
}
|
|
10073
|
-
function isAbsolute3(
|
|
10074
|
-
return typeof
|
|
8853
|
+
function isAbsolute3(name2) {
|
|
8854
|
+
return typeof name2 === "string" && path16__default.default.isAbsolute(name2);
|
|
10075
8855
|
}
|
|
10076
|
-
function isBuiltIn(
|
|
10077
|
-
if (modulePath || !
|
|
8856
|
+
function isBuiltIn(name2, settings, modulePath) {
|
|
8857
|
+
if (modulePath || !name2) {
|
|
10078
8858
|
return false;
|
|
10079
8859
|
}
|
|
10080
|
-
const
|
|
8860
|
+
const base3 = baseModule(name2);
|
|
10081
8861
|
const extras = settings && settings["import-x/core-modules"] || [];
|
|
10082
|
-
return Module.isBuiltin(
|
|
8862
|
+
return Module.isBuiltin(base3) || extras.includes(base3);
|
|
10083
8863
|
}
|
|
10084
|
-
function isExternalModule(
|
|
10085
|
-
return (isModule(
|
|
8864
|
+
function isExternalModule(name2, modulePath, context) {
|
|
8865
|
+
return (isModule(name2) || isScoped(name2)) && typeTest(name2, context, modulePath) === "external";
|
|
10086
8866
|
}
|
|
10087
8867
|
var moduleRegExp = /^\w/;
|
|
10088
|
-
function isModule(
|
|
10089
|
-
return !!
|
|
8868
|
+
function isModule(name2) {
|
|
8869
|
+
return !!name2 && moduleRegExp.test(name2);
|
|
10090
8870
|
}
|
|
10091
8871
|
var scopedRegExp = /^@[^/]+\/?[^/]+/;
|
|
10092
|
-
function isScoped(
|
|
10093
|
-
return !!
|
|
8872
|
+
function isScoped(name2) {
|
|
8873
|
+
return !!name2 && scopedRegExp.test(name2);
|
|
10094
8874
|
}
|
|
10095
|
-
function isRelativeToParent(
|
|
10096
|
-
return /^\.\.$|^\.\.[/\\]/.test(
|
|
8875
|
+
function isRelativeToParent(name2) {
|
|
8876
|
+
return /^\.\.$|^\.\.[/\\]/.test(name2);
|
|
10097
8877
|
}
|
|
10098
8878
|
var indexFiles = /* @__PURE__ */ new Set([".", "./", "./index", "./index.js"]);
|
|
10099
|
-
function isIndex(
|
|
10100
|
-
return indexFiles.has(
|
|
8879
|
+
function isIndex(name2) {
|
|
8880
|
+
return indexFiles.has(name2);
|
|
10101
8881
|
}
|
|
10102
|
-
function isRelativeToSibling(
|
|
10103
|
-
return /^\.[/\\]/.test(
|
|
8882
|
+
function isRelativeToSibling(name2) {
|
|
8883
|
+
return /^\.[/\\]/.test(name2);
|
|
10104
8884
|
}
|
|
10105
8885
|
function isExternalPath(filepath, context) {
|
|
10106
8886
|
if (!filepath) {
|
|
@@ -10127,28 +8907,28 @@ function isInternalPath(filepath, context) {
|
|
|
10127
8907
|
const packagePath = getContextPackagePath(context);
|
|
10128
8908
|
return !path16__default.default.relative(packagePath, filepath).startsWith("../");
|
|
10129
8909
|
}
|
|
10130
|
-
function isExternalLookingName(
|
|
10131
|
-
return isModule(
|
|
8910
|
+
function isExternalLookingName(name2) {
|
|
8911
|
+
return isModule(name2) || isScoped(name2);
|
|
10132
8912
|
}
|
|
10133
|
-
function typeTest(
|
|
8913
|
+
function typeTest(name2, context, path23) {
|
|
10134
8914
|
const { settings } = context;
|
|
10135
|
-
if (typeof
|
|
10136
|
-
if (isInternalRegexMatch(
|
|
8915
|
+
if (typeof name2 === "string") {
|
|
8916
|
+
if (isInternalRegexMatch(name2, settings)) {
|
|
10137
8917
|
return "internal";
|
|
10138
8918
|
}
|
|
10139
|
-
if (isAbsolute3(
|
|
8919
|
+
if (isAbsolute3(name2)) {
|
|
10140
8920
|
return "absolute";
|
|
10141
8921
|
}
|
|
10142
|
-
if (isBuiltIn(
|
|
8922
|
+
if (isBuiltIn(name2, settings, path23)) {
|
|
10143
8923
|
return "builtin";
|
|
10144
8924
|
}
|
|
10145
|
-
if (isRelativeToParent(
|
|
8925
|
+
if (isRelativeToParent(name2)) {
|
|
10146
8926
|
return "parent";
|
|
10147
8927
|
}
|
|
10148
|
-
if (isIndex(
|
|
8928
|
+
if (isIndex(name2)) {
|
|
10149
8929
|
return "index";
|
|
10150
8930
|
}
|
|
10151
|
-
if (isRelativeToSibling(
|
|
8931
|
+
if (isRelativeToSibling(name2)) {
|
|
10152
8932
|
return "sibling";
|
|
10153
8933
|
}
|
|
10154
8934
|
}
|
|
@@ -10158,13 +8938,13 @@ function typeTest(name3, context, path23) {
|
|
|
10158
8938
|
if (isInternalPath(path23, context)) {
|
|
10159
8939
|
return "internal";
|
|
10160
8940
|
}
|
|
10161
|
-
if (typeof
|
|
8941
|
+
if (typeof name2 === "string" && isExternalLookingName(name2)) {
|
|
10162
8942
|
return "external";
|
|
10163
8943
|
}
|
|
10164
8944
|
return "unknown";
|
|
10165
8945
|
}
|
|
10166
|
-
function importType(
|
|
10167
|
-
return typeTest(
|
|
8946
|
+
function importType(name2, context) {
|
|
8947
|
+
return typeTest(name2, context, typeof name2 === "string" ? resolve3(name2, context) : null);
|
|
10168
8948
|
}
|
|
10169
8949
|
|
|
10170
8950
|
// ../../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 +8984,32 @@ function normalizeConfigResolvers(resolvers, sourceFile) {
|
|
|
10204
8984
|
const map = /* @__PURE__ */ new Map();
|
|
10205
8985
|
for (const nameOrRecordOrObject of resolverArray) {
|
|
10206
8986
|
if (typeof nameOrRecordOrObject === "string") {
|
|
10207
|
-
const
|
|
10208
|
-
map.set(
|
|
10209
|
-
name:
|
|
8987
|
+
const name2 = nameOrRecordOrObject;
|
|
8988
|
+
map.set(name2, {
|
|
8989
|
+
name: name2,
|
|
10210
8990
|
enable: true,
|
|
10211
8991
|
options: void 0,
|
|
10212
|
-
resolver: requireResolver(
|
|
8992
|
+
resolver: requireResolver(name2, sourceFile)
|
|
10213
8993
|
});
|
|
10214
8994
|
} else if (typeof nameOrRecordOrObject === "object") {
|
|
10215
8995
|
if (nameOrRecordOrObject.name && nameOrRecordOrObject.resolver) {
|
|
10216
8996
|
const object2 = nameOrRecordOrObject;
|
|
10217
|
-
const { name:
|
|
10218
|
-
map.set(
|
|
8997
|
+
const { name: name2, enable = true, options, resolver } = object2;
|
|
8998
|
+
map.set(name2, { name: name2, enable, options, resolver });
|
|
10219
8999
|
} else {
|
|
10220
9000
|
const record2 = nameOrRecordOrObject;
|
|
10221
|
-
for (const [
|
|
10222
|
-
const resolver = requireResolver(
|
|
9001
|
+
for (const [name2, enableOrOptions] of Object.entries(record2)) {
|
|
9002
|
+
const resolver = requireResolver(name2, sourceFile);
|
|
10223
9003
|
if (typeof enableOrOptions === "boolean") {
|
|
10224
|
-
map.set(
|
|
10225
|
-
name:
|
|
9004
|
+
map.set(name2, {
|
|
9005
|
+
name: name2,
|
|
10226
9006
|
enable: enableOrOptions,
|
|
10227
9007
|
options: void 0,
|
|
10228
9008
|
resolver
|
|
10229
9009
|
});
|
|
10230
9010
|
} else {
|
|
10231
|
-
map.set(
|
|
10232
|
-
name:
|
|
9011
|
+
map.set(name2, {
|
|
9012
|
+
name: name2,
|
|
10233
9013
|
enable: true,
|
|
10234
9014
|
options: enableOrOptions,
|
|
10235
9015
|
resolver
|
|
@@ -10253,18 +9033,18 @@ try {
|
|
|
10253
9033
|
LEGACY_NODE_RESOLVERS.add(cjsRequire.resolve("eslint-import-resolver-node"));
|
|
10254
9034
|
} catch {
|
|
10255
9035
|
}
|
|
10256
|
-
function requireResolver(
|
|
10257
|
-
const resolver = tryRequire(`eslint-import-resolver-${
|
|
9036
|
+
function requireResolver(name2, sourceFile) {
|
|
9037
|
+
const resolver = tryRequire(`eslint-import-resolver-${name2}`, sourceFile) || tryRequire(name2, sourceFile) || tryRequire(path16__default.default.resolve(getBaseDir(sourceFile), name2));
|
|
10258
9038
|
if (!resolver) {
|
|
10259
|
-
if (LEGACY_NODE_RESOLVERS.has(
|
|
9039
|
+
if (LEGACY_NODE_RESOLVERS.has(name2)) {
|
|
10260
9040
|
return void 0;
|
|
10261
9041
|
}
|
|
10262
|
-
const err = new Error(`unable to load resolver "${
|
|
9042
|
+
const err = new Error(`unable to load resolver "${name2}".`);
|
|
10263
9043
|
err.name = IMPORT_RESOLVE_ERROR_NAME;
|
|
10264
9044
|
throw err;
|
|
10265
9045
|
}
|
|
10266
9046
|
if (!isLegacyResolverValid(resolver)) {
|
|
10267
|
-
const err = new Error(`${
|
|
9047
|
+
const err = new Error(`${name2} with invalid interface loaded as resolver`);
|
|
10268
9048
|
err.name = IMPORT_RESOLVE_ERROR_NAME;
|
|
10269
9049
|
throw err;
|
|
10270
9050
|
}
|
|
@@ -10518,11 +9298,11 @@ function fullResolve(modulePath, sourceFile, settings, context) {
|
|
|
10518
9298
|
};
|
|
10519
9299
|
const sourceFiles = context.physicalFilename === sourceFile || !isExternalLookingName(modulePath) ? [sourceFile] : [sourceFile, context.physicalFilename];
|
|
10520
9300
|
for (const sourceFile2 of sourceFiles) {
|
|
10521
|
-
for (const { enable, name:
|
|
9301
|
+
for (const { enable, name: name2, options, resolver } of normalizeConfigResolvers(configResolvers, sourceFile2)) {
|
|
10522
9302
|
if (!enable) {
|
|
10523
9303
|
continue;
|
|
10524
9304
|
}
|
|
10525
|
-
if (LEGACY_NODE_RESOLVERS.has(
|
|
9305
|
+
if (LEGACY_NODE_RESOLVERS.has(name2)) {
|
|
10526
9306
|
const resolverOptions = options || {};
|
|
10527
9307
|
const resolved2 = legacyNodeResolve(resolverOptions, context, modulePath, sourceFile2);
|
|
10528
9308
|
if (resolved2?.found) {
|
|
@@ -11052,44 +9832,44 @@ var ExportMap = class _ExportMap {
|
|
|
11052
9832
|
}
|
|
11053
9833
|
return size;
|
|
11054
9834
|
}
|
|
11055
|
-
has(
|
|
11056
|
-
if (this.namespace.has(
|
|
9835
|
+
has(name2) {
|
|
9836
|
+
if (this.namespace.has(name2)) {
|
|
11057
9837
|
return true;
|
|
11058
9838
|
}
|
|
11059
|
-
if (this.reexports.has(
|
|
9839
|
+
if (this.reexports.has(name2)) {
|
|
11060
9840
|
return true;
|
|
11061
9841
|
}
|
|
11062
|
-
if (
|
|
9842
|
+
if (name2 !== "default") {
|
|
11063
9843
|
for (const dep of this.dependencies) {
|
|
11064
9844
|
const innerMap = dep();
|
|
11065
9845
|
if (!innerMap) {
|
|
11066
9846
|
continue;
|
|
11067
9847
|
}
|
|
11068
|
-
if (innerMap.has(
|
|
9848
|
+
if (innerMap.has(name2)) {
|
|
11069
9849
|
return true;
|
|
11070
9850
|
}
|
|
11071
9851
|
}
|
|
11072
9852
|
}
|
|
11073
9853
|
return false;
|
|
11074
9854
|
}
|
|
11075
|
-
hasDeep(
|
|
11076
|
-
if (this.namespace.has(
|
|
9855
|
+
hasDeep(name2) {
|
|
9856
|
+
if (this.namespace.has(name2)) {
|
|
11077
9857
|
return { found: true, path: [this] };
|
|
11078
9858
|
}
|
|
11079
|
-
if (this.reexports.has(
|
|
11080
|
-
const reexports = this.reexports.get(
|
|
9859
|
+
if (this.reexports.has(name2)) {
|
|
9860
|
+
const reexports = this.reexports.get(name2);
|
|
11081
9861
|
const imported = reexports.getImport();
|
|
11082
9862
|
if (imported == null) {
|
|
11083
9863
|
return { found: true, path: [this] };
|
|
11084
9864
|
}
|
|
11085
|
-
if (imported.path === this.path && reexports.local ===
|
|
9865
|
+
if (imported.path === this.path && reexports.local === name2) {
|
|
11086
9866
|
return { found: false, path: [this] };
|
|
11087
9867
|
}
|
|
11088
9868
|
const deep = imported.hasDeep(reexports.local);
|
|
11089
9869
|
deep.path.unshift(this);
|
|
11090
9870
|
return deep;
|
|
11091
9871
|
}
|
|
11092
|
-
if (
|
|
9872
|
+
if (name2 !== "default") {
|
|
11093
9873
|
for (const dep of this.dependencies) {
|
|
11094
9874
|
const innerMap = dep();
|
|
11095
9875
|
if (innerMap == null) {
|
|
@@ -11101,7 +9881,7 @@ var ExportMap = class _ExportMap {
|
|
|
11101
9881
|
if (innerMap.path === this.path) {
|
|
11102
9882
|
continue;
|
|
11103
9883
|
}
|
|
11104
|
-
const innerValue = innerMap.hasDeep(
|
|
9884
|
+
const innerValue = innerMap.hasDeep(name2);
|
|
11105
9885
|
if (innerValue.found) {
|
|
11106
9886
|
innerValue.path.unshift(this);
|
|
11107
9887
|
return innerValue;
|
|
@@ -11110,22 +9890,22 @@ var ExportMap = class _ExportMap {
|
|
|
11110
9890
|
}
|
|
11111
9891
|
return { found: false, path: [this] };
|
|
11112
9892
|
}
|
|
11113
|
-
get(
|
|
11114
|
-
if (this.namespace.has(
|
|
11115
|
-
return this.namespace.get(
|
|
9893
|
+
get(name2) {
|
|
9894
|
+
if (this.namespace.has(name2)) {
|
|
9895
|
+
return this.namespace.get(name2);
|
|
11116
9896
|
}
|
|
11117
|
-
if (this.reexports.has(
|
|
11118
|
-
const reexports = this.reexports.get(
|
|
9897
|
+
if (this.reexports.has(name2)) {
|
|
9898
|
+
const reexports = this.reexports.get(name2);
|
|
11119
9899
|
const imported = reexports.getImport();
|
|
11120
9900
|
if (imported == null) {
|
|
11121
9901
|
return null;
|
|
11122
9902
|
}
|
|
11123
|
-
if (imported.path === this.path && reexports.local ===
|
|
9903
|
+
if (imported.path === this.path && reexports.local === name2) {
|
|
11124
9904
|
return void 0;
|
|
11125
9905
|
}
|
|
11126
9906
|
return imported.get(reexports.local);
|
|
11127
9907
|
}
|
|
11128
|
-
if (
|
|
9908
|
+
if (name2 !== "default") {
|
|
11129
9909
|
for (const dep of this.dependencies) {
|
|
11130
9910
|
const innerMap = dep();
|
|
11131
9911
|
if (!innerMap) {
|
|
@@ -11134,7 +9914,7 @@ var ExportMap = class _ExportMap {
|
|
|
11134
9914
|
if (innerMap.path === this.path) {
|
|
11135
9915
|
continue;
|
|
11136
9916
|
}
|
|
11137
|
-
const innerValue = innerMap.get(
|
|
9917
|
+
const innerValue = innerMap.get(name2);
|
|
11138
9918
|
if (innerValue !== void 0) {
|
|
11139
9919
|
return innerValue;
|
|
11140
9920
|
}
|
|
@@ -11145,9 +9925,9 @@ var ExportMap = class _ExportMap {
|
|
|
11145
9925
|
for (const [n, v] of this.namespace.entries()) {
|
|
11146
9926
|
callback.call(thisArg, v, n, this);
|
|
11147
9927
|
}
|
|
11148
|
-
for (const [
|
|
9928
|
+
for (const [name2, reexports] of this.reexports.entries()) {
|
|
11149
9929
|
const reexported = reexports.getImport();
|
|
11150
|
-
callback.call(thisArg, reexported?.get(reexports.local),
|
|
9930
|
+
callback.call(thisArg, reexported?.get(reexports.local), name2, this);
|
|
11151
9931
|
}
|
|
11152
9932
|
this.dependencies.forEach((dep) => {
|
|
11153
9933
|
const d = dep();
|
|
@@ -11436,7 +10216,7 @@ function moduleVisitor(visitor, options) {
|
|
|
11436
10216
|
return visitors;
|
|
11437
10217
|
}
|
|
11438
10218
|
function makeOptionsSchema(additionalProperties) {
|
|
11439
|
-
const
|
|
10219
|
+
const base3 = {
|
|
11440
10220
|
type: "object",
|
|
11441
10221
|
properties: {
|
|
11442
10222
|
commonjs: { type: "boolean" },
|
|
@@ -11452,10 +10232,10 @@ function makeOptionsSchema(additionalProperties) {
|
|
|
11452
10232
|
};
|
|
11453
10233
|
if (additionalProperties) {
|
|
11454
10234
|
for (const key in additionalProperties) {
|
|
11455
|
-
|
|
10235
|
+
base3.properties[key] = additionalProperties[key];
|
|
11456
10236
|
}
|
|
11457
10237
|
}
|
|
11458
|
-
return
|
|
10238
|
+
return base3;
|
|
11459
10239
|
}
|
|
11460
10240
|
makeOptionsSchema();
|
|
11461
10241
|
|
|
@@ -11937,12 +10717,12 @@ var export_default = createRule3({
|
|
|
11937
10717
|
defaultOptions: [],
|
|
11938
10718
|
create(context) {
|
|
11939
10719
|
const namespace = /* @__PURE__ */ new Map([[rootProgram, /* @__PURE__ */ new Map()]]);
|
|
11940
|
-
function addNamed(
|
|
10720
|
+
function addNamed(name2, node2, parent, isType) {
|
|
11941
10721
|
if (!namespace.has(parent)) {
|
|
11942
10722
|
namespace.set(parent, /* @__PURE__ */ new Map());
|
|
11943
10723
|
}
|
|
11944
10724
|
const named = namespace.get(parent);
|
|
11945
|
-
const key = isType ? `${tsTypePrefix}${
|
|
10725
|
+
const key = isType ? `${tsTypePrefix}${name2}` : name2;
|
|
11946
10726
|
let nodes = named.get(key);
|
|
11947
10727
|
if (nodes == null) {
|
|
11948
10728
|
nodes = /* @__PURE__ */ new Set();
|
|
@@ -11998,10 +10778,10 @@ var export_default = createRule3({
|
|
|
11998
10778
|
}
|
|
11999
10779
|
const parent = getParent(node2);
|
|
12000
10780
|
let any2 = false;
|
|
12001
|
-
remoteExports.$forEach((_,
|
|
12002
|
-
if (
|
|
10781
|
+
remoteExports.$forEach((_, name2) => {
|
|
10782
|
+
if (name2 !== "default") {
|
|
12003
10783
|
any2 = true;
|
|
12004
|
-
addNamed(
|
|
10784
|
+
addNamed(name2, node2, parent);
|
|
12005
10785
|
}
|
|
12006
10786
|
});
|
|
12007
10787
|
if (!any2) {
|
|
@@ -12014,7 +10794,7 @@ var export_default = createRule3({
|
|
|
12014
10794
|
},
|
|
12015
10795
|
"Program:exit"() {
|
|
12016
10796
|
for (const [, named] of namespace) {
|
|
12017
|
-
for (const [
|
|
10797
|
+
for (const [name2, nodes] of named) {
|
|
12018
10798
|
if (nodes.size === 0) {
|
|
12019
10799
|
continue;
|
|
12020
10800
|
}
|
|
@@ -12029,7 +10809,7 @@ var export_default = createRule3({
|
|
|
12029
10809
|
if (shouldSkipTypescriptNamespace(node2, nodes)) {
|
|
12030
10810
|
continue;
|
|
12031
10811
|
}
|
|
12032
|
-
if (
|
|
10812
|
+
if (name2 === "default") {
|
|
12033
10813
|
context.report({
|
|
12034
10814
|
node: node2,
|
|
12035
10815
|
messageId: "multiDefault"
|
|
@@ -12039,7 +10819,7 @@ var export_default = createRule3({
|
|
|
12039
10819
|
node: node2,
|
|
12040
10820
|
messageId: "multiNamed",
|
|
12041
10821
|
data: {
|
|
12042
|
-
name:
|
|
10822
|
+
name: name2.replace(tsTypePrefix, "")
|
|
12043
10823
|
}
|
|
12044
10824
|
});
|
|
12045
10825
|
}
|
|
@@ -14365,8 +13145,8 @@ var named_default = createRule3({
|
|
|
14365
13145
|
continue;
|
|
14366
13146
|
}
|
|
14367
13147
|
const imNode = im[key];
|
|
14368
|
-
const
|
|
14369
|
-
const deepLookup = imports2.hasDeep(
|
|
13148
|
+
const name2 = imNode.name || imNode.value;
|
|
13149
|
+
const deepLookup = imports2.hasDeep(name2);
|
|
14370
13150
|
if (!deepLookup.found) {
|
|
14371
13151
|
if (deepLookup.path.length > 1) {
|
|
14372
13152
|
const deepPath = deepLookup.path.map((i) => path16__default.default.relative(path16__default.default.dirname(context.physicalFilename), i.path)).join(" -> ");
|
|
@@ -14374,7 +13154,7 @@ var named_default = createRule3({
|
|
|
14374
13154
|
node: imNode,
|
|
14375
13155
|
messageId: "notFoundDeep",
|
|
14376
13156
|
data: {
|
|
14377
|
-
name:
|
|
13157
|
+
name: name2,
|
|
14378
13158
|
deepPath
|
|
14379
13159
|
}
|
|
14380
13160
|
});
|
|
@@ -14383,7 +13163,7 @@ var named_default = createRule3({
|
|
|
14383
13163
|
node: imNode,
|
|
14384
13164
|
messageId: "notFound",
|
|
14385
13165
|
data: {
|
|
14386
|
-
name:
|
|
13166
|
+
name: name2,
|
|
14387
13167
|
path: node2.source.value
|
|
14388
13168
|
}
|
|
14389
13169
|
});
|
|
@@ -15265,7 +14045,7 @@ var no_cycle_default = createRule3({
|
|
|
15265
14045
|
}
|
|
15266
14046
|
const options = context.options[0] || {};
|
|
15267
14047
|
const maxDepth = typeof options.maxDepth === "number" ? options.maxDepth : Number.POSITIVE_INFINITY;
|
|
15268
|
-
const ignoreModule = options.ignoreExternal ? (
|
|
14048
|
+
const ignoreModule = options.ignoreExternal ? (name2) => isExternalModule(name2, resolve3(name2, context), context) : () => false;
|
|
15269
14049
|
return {
|
|
15270
14050
|
...moduleVisitor(function checkSourceValue(sourceNode, importer) {
|
|
15271
14051
|
if (ignoreModule(sourceNode.value)) {
|
|
@@ -16095,8 +14875,8 @@ function getDependencies(context, packageDir) {
|
|
|
16095
14875
|
}
|
|
16096
14876
|
}
|
|
16097
14877
|
}
|
|
16098
|
-
function getModuleOriginalName(
|
|
16099
|
-
const [first, second] =
|
|
14878
|
+
function getModuleOriginalName(name2) {
|
|
14879
|
+
const [first, second] = name2.split("/");
|
|
16100
14880
|
return first.startsWith("@") ? `${first}/${second}` : first;
|
|
16101
14881
|
}
|
|
16102
14882
|
function checkDependencyDeclaration(deps, packageName, declarationStatus) {
|
|
@@ -16123,19 +14903,19 @@ function checkDependencyDeclaration(deps, packageName, declarationStatus) {
|
|
|
16123
14903
|
isInBundledDeps: result.isInBundledDeps || deps.bundledDependencies.includes(ancestorName)
|
|
16124
14904
|
}), newDeclarationStatus);
|
|
16125
14905
|
}
|
|
16126
|
-
function reportIfMissing(context, deps, depsOptions, node2,
|
|
14906
|
+
function reportIfMissing(context, deps, depsOptions, node2, name2, whitelist) {
|
|
16127
14907
|
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
14908
|
return;
|
|
16129
14909
|
}
|
|
16130
|
-
const typeOfImport = importType(
|
|
14910
|
+
const typeOfImport = importType(name2, context);
|
|
16131
14911
|
if (typeOfImport !== "external" && (typeOfImport !== "internal" || !depsOptions.verifyInternalDeps)) {
|
|
16132
14912
|
return;
|
|
16133
14913
|
}
|
|
16134
|
-
const resolved = resolve3(
|
|
14914
|
+
const resolved = resolve3(name2, context);
|
|
16135
14915
|
if (!resolved) {
|
|
16136
14916
|
return;
|
|
16137
14917
|
}
|
|
16138
|
-
const importPackageName = getModuleOriginalName(
|
|
14918
|
+
const importPackageName = getModuleOriginalName(name2);
|
|
16139
14919
|
let declarationStatus = checkDependencyDeclaration(deps, importPackageName);
|
|
16140
14920
|
if (declarationStatus.isInDeps || depsOptions.allowDevDeps && declarationStatus.isInDevDeps || depsOptions.allowPeerDeps && declarationStatus.isInPeerDeps || depsOptions.allowOptDeps && declarationStatus.isInOptDeps || depsOptions.allowBundledDeps && declarationStatus.isInBundledDeps) {
|
|
16141
14921
|
return;
|
|
@@ -16470,9 +15250,9 @@ var no_mutable_exports_default = createRule3({
|
|
|
16470
15250
|
});
|
|
16471
15251
|
}
|
|
16472
15252
|
}
|
|
16473
|
-
function checkDeclarationsInScope({ variables },
|
|
15253
|
+
function checkDeclarationsInScope({ variables }, name2) {
|
|
16474
15254
|
for (const variable of variables) {
|
|
16475
|
-
if (variable.name ===
|
|
15255
|
+
if (variable.name === name2) {
|
|
16476
15256
|
for (const def of variable.defs) {
|
|
16477
15257
|
if (def.type === "Variable" && def.parent) {
|
|
16478
15258
|
checkDeclaration(def.parent);
|
|
@@ -16824,21 +15604,21 @@ function getVariableNamesInScope(scopeManager, node2) {
|
|
|
16824
15604
|
}
|
|
16825
15605
|
function generateLocalNames(names, nameConflicts, namespaceName) {
|
|
16826
15606
|
const localNames = {};
|
|
16827
|
-
for (const
|
|
15607
|
+
for (const name2 of names) {
|
|
16828
15608
|
let localName;
|
|
16829
|
-
if (!nameConflicts[
|
|
16830
|
-
localName =
|
|
16831
|
-
} else if (nameConflicts[
|
|
15609
|
+
if (!nameConflicts[name2].has(name2)) {
|
|
15610
|
+
localName = name2;
|
|
15611
|
+
} else if (nameConflicts[name2].has(`${namespaceName}_${name2}`)) {
|
|
16832
15612
|
for (let i = 1; i < Number.POSITIVE_INFINITY; i++) {
|
|
16833
|
-
if (!nameConflicts[
|
|
16834
|
-
localName = `${namespaceName}_${
|
|
15613
|
+
if (!nameConflicts[name2].has(`${namespaceName}_${name2}_${i}`)) {
|
|
15614
|
+
localName = `${namespaceName}_${name2}_${i}`;
|
|
16835
15615
|
break;
|
|
16836
15616
|
}
|
|
16837
15617
|
}
|
|
16838
15618
|
} else {
|
|
16839
|
-
localName = `${namespaceName}_${
|
|
15619
|
+
localName = `${namespaceName}_${name2}`;
|
|
16840
15620
|
}
|
|
16841
|
-
localNames[
|
|
15621
|
+
localNames[name2] = localName;
|
|
16842
15622
|
}
|
|
16843
15623
|
return localNames;
|
|
16844
15624
|
}
|
|
@@ -18045,8 +16825,8 @@ In the meantime, if you want to keep this rule enabled, you can suppress this wa
|
|
|
18045
16825
|
}
|
|
18046
16826
|
}
|
|
18047
16827
|
}
|
|
18048
|
-
forEachDeclarationIdentifier(s.declaration, (
|
|
18049
|
-
newExportIdentifiers.add(
|
|
16828
|
+
forEachDeclarationIdentifier(s.declaration, (name2) => {
|
|
16829
|
+
newExportIdentifiers.add(name2);
|
|
18050
16830
|
});
|
|
18051
16831
|
}
|
|
18052
16832
|
}
|
|
@@ -18121,11 +16901,11 @@ In the meantime, if you want to keep this rule enabled, you can suppress this wa
|
|
|
18121
16901
|
if (astNode.type === AST_NODE_TYPES3.ExportNamedDeclaration && astNode.source) {
|
|
18122
16902
|
resolvedPath = resolve3(astNode.source.raw.replaceAll(/('|")/g, ""), context);
|
|
18123
16903
|
for (const specifier of astNode.specifiers) {
|
|
18124
|
-
const
|
|
18125
|
-
if (
|
|
16904
|
+
const name2 = getValue(specifier.local);
|
|
16905
|
+
if (name2 === DEFAULT) {
|
|
18126
16906
|
newDefaultImports.add(resolvedPath);
|
|
18127
16907
|
} else {
|
|
18128
|
-
newImports.set(
|
|
16908
|
+
newImports.set(name2, resolvedPath);
|
|
18129
16909
|
}
|
|
18130
16910
|
}
|
|
18131
16911
|
}
|
|
@@ -18323,8 +17103,8 @@ In the meantime, if you want to keep this rule enabled, you can suppress this wa
|
|
|
18323
17103
|
for (const specifier of node2.specifiers) {
|
|
18324
17104
|
checkUsage(specifier, getValue(specifier.exported), false);
|
|
18325
17105
|
}
|
|
18326
|
-
forEachDeclarationIdentifier(node2.declaration, (
|
|
18327
|
-
checkUsage(node2,
|
|
17106
|
+
forEachDeclarationIdentifier(node2.declaration, (name2, isTypeExport) => {
|
|
17107
|
+
checkUsage(node2, name2, isTypeExport);
|
|
18328
17108
|
});
|
|
18329
17109
|
}
|
|
18330
17110
|
};
|
|
@@ -19342,11 +18122,11 @@ var order_default = createRule3({
|
|
|
19342
18122
|
return {
|
|
19343
18123
|
ImportDeclaration(node2) {
|
|
19344
18124
|
if (node2.specifiers.length > 0 || options.warnOnUnassignedImports) {
|
|
19345
|
-
const
|
|
18125
|
+
const name2 = node2.source.value;
|
|
19346
18126
|
registerNode(context, {
|
|
19347
18127
|
node: node2,
|
|
19348
|
-
value:
|
|
19349
|
-
displayName:
|
|
18128
|
+
value: name2,
|
|
18129
|
+
displayName: name2,
|
|
19350
18130
|
type: "import"
|
|
19351
18131
|
}, ranks, getBlockImports(node2.parent), pathGroupsExcludedImportTypes, isSortingTypesGroup);
|
|
19352
18132
|
if (named.import) {
|
|
@@ -19468,11 +18248,11 @@ var order_default = createRule3({
|
|
|
19468
18248
|
} else {
|
|
19469
18249
|
const nameParts = getNamedCJSExports(context, node2.left);
|
|
19470
18250
|
if (nameParts && nameParts.length > 0) {
|
|
19471
|
-
const
|
|
18251
|
+
const name2 = nameParts.join(".");
|
|
19472
18252
|
getBlockExports(node2.parent.parent).push({
|
|
19473
18253
|
node: node2,
|
|
19474
|
-
value:
|
|
19475
|
-
displayName:
|
|
18254
|
+
value: name2,
|
|
18255
|
+
displayName: name2,
|
|
19476
18256
|
type: "export",
|
|
19477
18257
|
rank: 0
|
|
19478
18258
|
});
|
|
@@ -19834,7 +18614,7 @@ var getImportSource;
|
|
|
19834
18614
|
var isAllSameSubmodule;
|
|
19835
18615
|
var prefer_zod_namespace_default;
|
|
19836
18616
|
var init_prefer_zod_namespace = __esm2({ "src/rules/prefer-zod-namespace.ts"() {
|
|
19837
|
-
createRule4 = utils.ESLintUtils.RuleCreator((
|
|
18617
|
+
createRule4 = utils.ESLintUtils.RuleCreator((name2) => `https://github.com/samchungy/eslint-plugin-import-zod/blob/main/docs/rules/${name2}.md`);
|
|
19838
18618
|
getImportSource = (importedName, originalSource) => {
|
|
19839
18619
|
return importedName === "core" && originalSource === "zod/v4" ? `${originalSource}/${importedName}` : originalSource;
|
|
19840
18620
|
};
|
|
@@ -21491,7 +20271,7 @@ async function pnpm(options = {}) {
|
|
|
21491
20271
|
} = options;
|
|
21492
20272
|
const workspaceRoot = findWorkspaceRoot2();
|
|
21493
20273
|
await ensurePackages(["@storm-software/eslint-plugin-pnpm", "jsonc-eslint-parser", "yaml-eslint-parser"]);
|
|
21494
|
-
const [
|
|
20274
|
+
const [plugin8, parserJsonc3, parserYaml2] = await Promise.all([
|
|
21495
20275
|
interopDefault(Promise.resolve().then(() => (init_src2(), src_exports2))),
|
|
21496
20276
|
interopDefault(import('jsonc-eslint-parser')),
|
|
21497
20277
|
interopDefault(import('yaml-eslint-parser'))
|
|
@@ -21539,7 +20319,7 @@ async function pnpm(options = {}) {
|
|
|
21539
20319
|
{
|
|
21540
20320
|
name: "storm/pnpm/setup",
|
|
21541
20321
|
plugins: {
|
|
21542
|
-
pnpm:
|
|
20322
|
+
pnpm: plugin8
|
|
21543
20323
|
}
|
|
21544
20324
|
},
|
|
21545
20325
|
{
|
|
@@ -21847,12 +20627,12 @@ async function reactNative(options = {}) {
|
|
|
21847
20627
|
init_cjs_shims();
|
|
21848
20628
|
async function regexp(options = {}) {
|
|
21849
20629
|
const config7 = eslintPluginRegexp.configs["flat/recommended"];
|
|
21850
|
-
const
|
|
20630
|
+
const rules6 = {
|
|
21851
20631
|
...config7.rules
|
|
21852
20632
|
};
|
|
21853
20633
|
if (options.level === "warn") {
|
|
21854
|
-
for (const key in
|
|
21855
|
-
if (
|
|
20634
|
+
for (const key in rules6) {
|
|
20635
|
+
if (rules6[key] === "error") rules6[key] = "warn";
|
|
21856
20636
|
}
|
|
21857
20637
|
}
|
|
21858
20638
|
return [
|
|
@@ -21860,7 +20640,7 @@ async function regexp(options = {}) {
|
|
|
21860
20640
|
...config7,
|
|
21861
20641
|
name: "storm/regexp/rules",
|
|
21862
20642
|
rules: {
|
|
21863
|
-
...
|
|
20643
|
+
...rules6,
|
|
21864
20644
|
"regexp/no-unused-capturing-group": [
|
|
21865
20645
|
"error",
|
|
21866
20646
|
{
|
|
@@ -22183,10 +20963,10 @@ async function storybook(options = {}) {
|
|
|
22183
20963
|
// src/configs/test.ts
|
|
22184
20964
|
init_cjs_shims();
|
|
22185
20965
|
init_globs();
|
|
22186
|
-
var
|
|
20966
|
+
var plugin6;
|
|
22187
20967
|
async function test(options = {}) {
|
|
22188
20968
|
const { files = GLOB_TESTS, isInEditor = false, overrides = {} } = options;
|
|
22189
|
-
|
|
20969
|
+
plugin6 = plugin6 || {
|
|
22190
20970
|
...default4__default.default,
|
|
22191
20971
|
rules: {
|
|
22192
20972
|
...default4__default.default.rules,
|
|
@@ -22198,7 +20978,7 @@ async function test(options = {}) {
|
|
|
22198
20978
|
{
|
|
22199
20979
|
name: "storm/test/setup",
|
|
22200
20980
|
plugins: {
|
|
22201
|
-
test:
|
|
20981
|
+
test: plugin6
|
|
22202
20982
|
}
|
|
22203
20983
|
},
|
|
22204
20984
|
{
|
|
@@ -22828,7 +21608,7 @@ function getOverrides(options, key) {
|
|
|
22828
21608
|
}
|
|
22829
21609
|
function preset(options, ...userConfigs) {
|
|
22830
21610
|
const {
|
|
22831
|
-
name:
|
|
21611
|
+
name: name2,
|
|
22832
21612
|
globals = {},
|
|
22833
21613
|
banner: enableBanner = true,
|
|
22834
21614
|
astro: enableAstro = false,
|
|
@@ -22868,10 +21648,10 @@ function preset(options, ...userConfigs) {
|
|
|
22868
21648
|
if (stylisticOptions && !("jsx" in stylisticOptions)) {
|
|
22869
21649
|
stylisticOptions.jsx = enableJsx;
|
|
22870
21650
|
}
|
|
22871
|
-
const
|
|
21651
|
+
const configs7 = [];
|
|
22872
21652
|
if (enableGitignore) {
|
|
22873
21653
|
if (typeof enableGitignore !== "boolean") {
|
|
22874
|
-
|
|
21654
|
+
configs7.push(
|
|
22875
21655
|
interopDefault(import('eslint-config-flat-gitignore')).then((r) => [
|
|
22876
21656
|
r({
|
|
22877
21657
|
name: "storm/gitignore",
|
|
@@ -22880,7 +21660,7 @@ function preset(options, ...userConfigs) {
|
|
|
22880
21660
|
])
|
|
22881
21661
|
);
|
|
22882
21662
|
} else {
|
|
22883
|
-
|
|
21663
|
+
configs7.push(
|
|
22884
21664
|
interopDefault(import('eslint-config-flat-gitignore')).then((r) => [
|
|
22885
21665
|
r({
|
|
22886
21666
|
name: "storm/gitignore",
|
|
@@ -22890,7 +21670,7 @@ function preset(options, ...userConfigs) {
|
|
|
22890
21670
|
);
|
|
22891
21671
|
}
|
|
22892
21672
|
}
|
|
22893
|
-
|
|
21673
|
+
configs7.push(
|
|
22894
21674
|
ignores(options.ignores),
|
|
22895
21675
|
javascript({
|
|
22896
21676
|
globals,
|
|
@@ -22915,7 +21695,7 @@ function preset(options, ...userConfigs) {
|
|
|
22915
21695
|
}
|
|
22916
21696
|
}
|
|
22917
21697
|
if (enableTypeScript) {
|
|
22918
|
-
|
|
21698
|
+
configs7.push(
|
|
22919
21699
|
typescript({
|
|
22920
21700
|
...typescriptOptions,
|
|
22921
21701
|
tsconfigPath: typescriptOptions.tsconfigPath === false ? void 0 : typescriptOptions.tsconfigPath,
|
|
@@ -22926,25 +21706,25 @@ function preset(options, ...userConfigs) {
|
|
|
22926
21706
|
);
|
|
22927
21707
|
}
|
|
22928
21708
|
if (enableBanner) {
|
|
22929
|
-
|
|
21709
|
+
configs7.push(
|
|
22930
21710
|
banner({
|
|
22931
21711
|
...resolveSubOptions(options, "banner"),
|
|
22932
|
-
name:
|
|
21712
|
+
name: name2,
|
|
22933
21713
|
overrides: getOverrides(options, "banner")
|
|
22934
21714
|
})
|
|
22935
21715
|
);
|
|
22936
21716
|
}
|
|
22937
21717
|
if (!stylisticOptions) {
|
|
22938
|
-
|
|
21718
|
+
configs7.push(prettier());
|
|
22939
21719
|
}
|
|
22940
21720
|
if (enableCSpell) {
|
|
22941
|
-
|
|
21721
|
+
configs7.push(cspell(resolveSubOptions(options, "cspell")));
|
|
22942
21722
|
}
|
|
22943
21723
|
if (enableUnicorn) {
|
|
22944
|
-
|
|
21724
|
+
configs7.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
22945
21725
|
}
|
|
22946
21726
|
if (enableJSDoc) {
|
|
22947
|
-
|
|
21727
|
+
configs7.push(
|
|
22948
21728
|
jsdoc({
|
|
22949
21729
|
...resolveSubOptions(options, "jsdoc"),
|
|
22950
21730
|
overrides: getOverrides(options, "jsdoc")
|
|
@@ -22952,7 +21732,7 @@ function preset(options, ...userConfigs) {
|
|
|
22952
21732
|
);
|
|
22953
21733
|
}
|
|
22954
21734
|
if (enableTSDoc) {
|
|
22955
|
-
|
|
21735
|
+
configs7.push(
|
|
22956
21736
|
tsdoc({
|
|
22957
21737
|
...resolveSubOptions(options, "tsdoc"),
|
|
22958
21738
|
overrides: getOverrides(options, "tsdoc")
|
|
@@ -22960,17 +21740,17 @@ function preset(options, ...userConfigs) {
|
|
|
22960
21740
|
);
|
|
22961
21741
|
}
|
|
22962
21742
|
if (enableJsx) {
|
|
22963
|
-
|
|
21743
|
+
configs7.push(jsx());
|
|
22964
21744
|
}
|
|
22965
21745
|
if (enableZod) {
|
|
22966
|
-
|
|
21746
|
+
configs7.push(
|
|
22967
21747
|
zod({
|
|
22968
21748
|
overrides: getOverrides(options, "zod")
|
|
22969
21749
|
})
|
|
22970
21750
|
);
|
|
22971
21751
|
}
|
|
22972
21752
|
if (stylisticOptions) {
|
|
22973
|
-
|
|
21753
|
+
configs7.push(
|
|
22974
21754
|
stylistic({
|
|
22975
21755
|
...stylisticOptions,
|
|
22976
21756
|
lineEndings: stylisticOptions.lineEndings ?? "unix",
|
|
@@ -22980,10 +21760,10 @@ function preset(options, ...userConfigs) {
|
|
|
22980
21760
|
);
|
|
22981
21761
|
}
|
|
22982
21762
|
if (enableRegexp) {
|
|
22983
|
-
|
|
21763
|
+
configs7.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
22984
21764
|
}
|
|
22985
21765
|
if (enableTest) {
|
|
22986
|
-
|
|
21766
|
+
configs7.push(
|
|
22987
21767
|
test({
|
|
22988
21768
|
isInEditor,
|
|
22989
21769
|
overrides: getOverrides(options, "test")
|
|
@@ -22991,10 +21771,10 @@ function preset(options, ...userConfigs) {
|
|
|
22991
21771
|
);
|
|
22992
21772
|
}
|
|
22993
21773
|
if (enableGraphQL) {
|
|
22994
|
-
|
|
21774
|
+
configs7.push(graphql(resolveSubOptions(options, "graphql")));
|
|
22995
21775
|
}
|
|
22996
21776
|
if (enableReact) {
|
|
22997
|
-
|
|
21777
|
+
configs7.push(
|
|
22998
21778
|
react({
|
|
22999
21779
|
...typescriptOptions,
|
|
23000
21780
|
tsconfigPath: typescriptOptions.tsconfigPath === false ? void 0 : typescriptOptions.tsconfigPath,
|
|
@@ -23004,7 +21784,7 @@ function preset(options, ...userConfigs) {
|
|
|
23004
21784
|
);
|
|
23005
21785
|
}
|
|
23006
21786
|
if (enableReactNative) {
|
|
23007
|
-
|
|
21787
|
+
configs7.push(
|
|
23008
21788
|
reactNative({
|
|
23009
21789
|
...resolveSubOptions(options, "react-native"),
|
|
23010
21790
|
overrides: getOverrides(options, "react-native")
|
|
@@ -23012,13 +21792,13 @@ function preset(options, ...userConfigs) {
|
|
|
23012
21792
|
);
|
|
23013
21793
|
}
|
|
23014
21794
|
if (enableNext) {
|
|
23015
|
-
|
|
21795
|
+
configs7.push(next(resolveSubOptions(options, "next")));
|
|
23016
21796
|
}
|
|
23017
21797
|
if (enableStorybook) {
|
|
23018
|
-
|
|
21798
|
+
configs7.push(storybook(resolveSubOptions(options, "storybook")));
|
|
23019
21799
|
}
|
|
23020
21800
|
if (enableUnoCSS) {
|
|
23021
|
-
|
|
21801
|
+
configs7.push(
|
|
23022
21802
|
unocss({
|
|
23023
21803
|
...resolveSubOptions(options, "unocss"),
|
|
23024
21804
|
overrides: getOverrides(options, "unocss")
|
|
@@ -23026,7 +21806,7 @@ function preset(options, ...userConfigs) {
|
|
|
23026
21806
|
);
|
|
23027
21807
|
}
|
|
23028
21808
|
if (enableAstro) {
|
|
23029
|
-
|
|
21809
|
+
configs7.push(
|
|
23030
21810
|
astro({
|
|
23031
21811
|
overrides: getOverrides(options, "astro"),
|
|
23032
21812
|
stylistic: stylisticOptions
|
|
@@ -23034,7 +21814,7 @@ function preset(options, ...userConfigs) {
|
|
|
23034
21814
|
);
|
|
23035
21815
|
}
|
|
23036
21816
|
if (enablePnpm ?? packageManager !== "bun") {
|
|
23037
|
-
|
|
21817
|
+
configs7.push(
|
|
23038
21818
|
pnpm({
|
|
23039
21819
|
overrides: getOverrides(options, "pnpm"),
|
|
23040
21820
|
ignore: typeof enablePnpm !== "boolean" ? enablePnpm?.ignore : void 0
|
|
@@ -23042,13 +21822,13 @@ function preset(options, ...userConfigs) {
|
|
|
23042
21822
|
);
|
|
23043
21823
|
}
|
|
23044
21824
|
if (enableBun ?? packageManager === "bun") {
|
|
23045
|
-
|
|
21825
|
+
configs7.push(bun({
|
|
23046
21826
|
overrides: getOverrides(options, "bun"),
|
|
23047
21827
|
ignore: typeof enableBun !== "boolean" ? enableBun?.ignore : void 0
|
|
23048
21828
|
}));
|
|
23049
21829
|
}
|
|
23050
21830
|
if (options.jsonc ?? true) {
|
|
23051
|
-
|
|
21831
|
+
configs7.push(
|
|
23052
21832
|
jsonc({
|
|
23053
21833
|
overrides: getOverrides(options, "jsonc"),
|
|
23054
21834
|
stylistic: stylisticOptions
|
|
@@ -23056,11 +21836,11 @@ function preset(options, ...userConfigs) {
|
|
|
23056
21836
|
sortTsconfig()
|
|
23057
21837
|
);
|
|
23058
21838
|
if (stylisticOptions) {
|
|
23059
|
-
|
|
21839
|
+
configs7.push(sortPackageJson());
|
|
23060
21840
|
}
|
|
23061
21841
|
}
|
|
23062
21842
|
if (options.yaml ?? true) {
|
|
23063
|
-
|
|
21843
|
+
configs7.push(
|
|
23064
21844
|
yaml({
|
|
23065
21845
|
overrides: getOverrides(options, "yaml"),
|
|
23066
21846
|
stylistic: stylisticOptions
|
|
@@ -23068,7 +21848,7 @@ function preset(options, ...userConfigs) {
|
|
|
23068
21848
|
);
|
|
23069
21849
|
}
|
|
23070
21850
|
if (options.toml ?? true) {
|
|
23071
|
-
|
|
21851
|
+
configs7.push(
|
|
23072
21852
|
toml({
|
|
23073
21853
|
overrides: getOverrides(options, "toml"),
|
|
23074
21854
|
stylistic: stylisticOptions
|
|
@@ -23076,28 +21856,28 @@ function preset(options, ...userConfigs) {
|
|
|
23076
21856
|
);
|
|
23077
21857
|
}
|
|
23078
21858
|
if (options.markdown === true) {
|
|
23079
|
-
|
|
21859
|
+
configs7.push(
|
|
23080
21860
|
markdown({
|
|
23081
21861
|
overrides: getOverrides(options, "markdown")
|
|
23082
21862
|
})
|
|
23083
21863
|
);
|
|
23084
21864
|
}
|
|
23085
21865
|
if (enableMdx) {
|
|
23086
|
-
|
|
21866
|
+
configs7.push(
|
|
23087
21867
|
mdx({
|
|
23088
21868
|
overrides: getOverrides(options, "mdx")
|
|
23089
21869
|
})
|
|
23090
21870
|
);
|
|
23091
21871
|
}
|
|
23092
21872
|
if (options.formatters) {
|
|
23093
|
-
|
|
21873
|
+
configs7.push(
|
|
23094
21874
|
formatters(
|
|
23095
21875
|
options.formatters,
|
|
23096
21876
|
typeof stylisticOptions === "boolean" ? {} : stylisticOptions
|
|
23097
21877
|
)
|
|
23098
21878
|
);
|
|
23099
21879
|
}
|
|
23100
|
-
|
|
21880
|
+
configs7.push(disables());
|
|
23101
21881
|
if ("files" in options) {
|
|
23102
21882
|
throw new Error(
|
|
23103
21883
|
'[@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 +21889,10 @@ function preset(options, ...userConfigs) {
|
|
|
23109
21889
|
}
|
|
23110
21890
|
return acc;
|
|
23111
21891
|
}, {});
|
|
23112
|
-
if (Object.keys(fusedConfig).length)
|
|
21892
|
+
if (Object.keys(fusedConfig).length) configs7.push([fusedConfig]);
|
|
23113
21893
|
let composer = new eslintFlatConfigUtils.FlatConfigComposer();
|
|
23114
21894
|
composer = composer.append(
|
|
23115
|
-
...
|
|
21895
|
+
...configs7,
|
|
23116
21896
|
...userConfigs
|
|
23117
21897
|
);
|
|
23118
21898
|
if (autoRenamePlugins) {
|