@alextheman/eslint-plugin 5.13.1 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +32 -21
- package/dist/index.js +32 -21
- package/dist/internal/index.cjs +69 -1
- package/dist/internal/index.d.cts +85 -74
- package/dist/internal/index.d.ts +85 -74
- package/dist/internal/index.js +66 -2
- package/package.json +28 -27
package/dist/index.cjs
CHANGED
|
@@ -46,8 +46,8 @@ let eslint_plugin_prettier = require("eslint-plugin-prettier");
|
|
|
46
46
|
eslint_plugin_prettier = __toESM(eslint_plugin_prettier, 1);
|
|
47
47
|
let typescript_eslint = require("typescript-eslint");
|
|
48
48
|
typescript_eslint = __toESM(typescript_eslint, 1);
|
|
49
|
-
let
|
|
50
|
-
|
|
49
|
+
let eslint_plugin_jsx_a11y_x = require("eslint-plugin-jsx-a11y-x");
|
|
50
|
+
eslint_plugin_jsx_a11y_x = __toESM(eslint_plugin_jsx_a11y_x, 1);
|
|
51
51
|
let eslint_plugin_react = require("eslint-plugin-react");
|
|
52
52
|
eslint_plugin_react = __toESM(eslint_plugin_react, 1);
|
|
53
53
|
let eslint_plugin_react_refresh = require("eslint-plugin-react-refresh");
|
|
@@ -59,7 +59,7 @@ eslint_plugin_package_json = __toESM(eslint_plugin_package_json, 1);
|
|
|
59
59
|
let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
|
|
60
60
|
eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc, 1);
|
|
61
61
|
let _alextheman_utility_node = require("@alextheman/utility/node");
|
|
62
|
-
//#region node_modules/.pnpm/globals@17.
|
|
62
|
+
//#region node_modules/.pnpm/globals@17.6.0/node_modules/globals/globals.json
|
|
63
63
|
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
64
64
|
module.exports = {
|
|
65
65
|
"amd": {
|
|
@@ -1272,9 +1272,13 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1272
1272
|
"XRAnchorSet": false,
|
|
1273
1273
|
"XRBoundedReferenceSpace": false,
|
|
1274
1274
|
"XRCamera": false,
|
|
1275
|
+
"XRCompositionLayer": false,
|
|
1275
1276
|
"XRCPUDepthInformation": false,
|
|
1277
|
+
"XRCubeLayer": false,
|
|
1278
|
+
"XRCylinderLayer": false,
|
|
1276
1279
|
"XRDepthInformation": false,
|
|
1277
1280
|
"XRDOMOverlayState": false,
|
|
1281
|
+
"XREquirectLayer": false,
|
|
1278
1282
|
"XRFrame": false,
|
|
1279
1283
|
"XRHand": false,
|
|
1280
1284
|
"XRHitTestResult": false,
|
|
@@ -1286,9 +1290,14 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1286
1290
|
"XRJointPose": false,
|
|
1287
1291
|
"XRJointSpace": false,
|
|
1288
1292
|
"XRLayer": false,
|
|
1293
|
+
"XRLayerEvent": false,
|
|
1289
1294
|
"XRLightEstimate": false,
|
|
1290
1295
|
"XRLightProbe": false,
|
|
1296
|
+
"XRPlane": false,
|
|
1297
|
+
"XRPlaneSet": false,
|
|
1291
1298
|
"XRPose": false,
|
|
1299
|
+
"XRProjectionLayer": false,
|
|
1300
|
+
"XRQuadLayer": false,
|
|
1292
1301
|
"XRRay": false,
|
|
1293
1302
|
"XRReferenceSpace": false,
|
|
1294
1303
|
"XRReferenceSpaceEvent": false,
|
|
@@ -1297,6 +1306,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1297
1306
|
"XRSession": false,
|
|
1298
1307
|
"XRSessionEvent": false,
|
|
1299
1308
|
"XRSpace": false,
|
|
1309
|
+
"XRSubImage": false,
|
|
1300
1310
|
"XRSystem": false,
|
|
1301
1311
|
"XRTransientInputHitTestResult": false,
|
|
1302
1312
|
"XRTransientInputHitTestSource": false,
|
|
@@ -1307,6 +1317,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1307
1317
|
"XRWebGLBinding": false,
|
|
1308
1318
|
"XRWebGLDepthInformation": false,
|
|
1309
1319
|
"XRWebGLLayer": false,
|
|
1320
|
+
"XRWebGLSubImage": false,
|
|
1310
1321
|
"XSLTProcessor": false
|
|
1311
1322
|
},
|
|
1312
1323
|
"builtin": {
|
|
@@ -4154,7 +4165,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4154
4165
|
};
|
|
4155
4166
|
}));
|
|
4156
4167
|
//#endregion
|
|
4157
|
-
//#region node_modules/.pnpm/globals@17.
|
|
4168
|
+
//#region node_modules/.pnpm/globals@17.6.0/node_modules/globals/index.js
|
|
4158
4169
|
var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4159
4170
|
module.exports = require_globals$1();
|
|
4160
4171
|
}));
|
|
@@ -4489,6 +4500,20 @@ const typeScriptLanguageOptions = {
|
|
|
4489
4500
|
}
|
|
4490
4501
|
};
|
|
4491
4502
|
//#endregion
|
|
4503
|
+
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4504
|
+
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
4505
|
+
return {
|
|
4506
|
+
message: "Please use node:fs/promises instead.",
|
|
4507
|
+
name
|
|
4508
|
+
};
|
|
4509
|
+
})] });
|
|
4510
|
+
//#endregion
|
|
4511
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4512
|
+
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4513
|
+
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4514
|
+
regex: "^@mui/[^/]+$"
|
|
4515
|
+
}] });
|
|
4516
|
+
//#endregion
|
|
4492
4517
|
//#region src/configs/helpers/sorting/sortClasses.ts
|
|
4493
4518
|
const sortClasses = {
|
|
4494
4519
|
customGroups: [],
|
|
@@ -4588,14 +4613,6 @@ const sortObjects = {
|
|
|
4588
4613
|
useConfigurationIf: {}
|
|
4589
4614
|
};
|
|
4590
4615
|
//#endregion
|
|
4591
|
-
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4592
|
-
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
4593
|
-
return {
|
|
4594
|
-
message: "Please use node:fs/promises instead.",
|
|
4595
|
-
name
|
|
4596
|
-
};
|
|
4597
|
-
})] });
|
|
4598
|
-
//#endregion
|
|
4599
4616
|
//#region src/configs/helpers/sorting/sortNamedImports.ts
|
|
4600
4617
|
const sortNamedImports = {
|
|
4601
4618
|
fallbackSort: { type: "unsorted" },
|
|
@@ -4682,7 +4699,7 @@ const reactHooks = {
|
|
|
4682
4699
|
const generalReact = [
|
|
4683
4700
|
eslint_plugin_react.default.configs.flat.recommended,
|
|
4684
4701
|
eslint_plugin_react.default.configs.flat["jsx-runtime"],
|
|
4685
|
-
|
|
4702
|
+
eslint_plugin_jsx_a11y_x.default.configs.recommended,
|
|
4686
4703
|
{
|
|
4687
4704
|
languageOptions: reactLanguageOptions,
|
|
4688
4705
|
name: "@alextheman/general/react",
|
|
@@ -4712,12 +4729,6 @@ const generalReact = [
|
|
|
4712
4729
|
}
|
|
4713
4730
|
];
|
|
4714
4731
|
//#endregion
|
|
4715
|
-
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4716
|
-
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4717
|
-
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4718
|
-
regex: "^@mui/[^/]+$"
|
|
4719
|
-
}] });
|
|
4720
|
-
//#endregion
|
|
4721
4732
|
//#region src/configs/internal/react.ts
|
|
4722
4733
|
const internalReact = [{
|
|
4723
4734
|
languageOptions: reactLanguageOptions,
|
|
@@ -5225,7 +5236,7 @@ const consistentTestFunction = createRule({
|
|
|
5225
5236
|
//#region src/rules/has-standards.ts
|
|
5226
5237
|
const hasStandardsOptionsSchema = zod.default.object({ fixable: zod.default.boolean() }).partial();
|
|
5227
5238
|
function parseHasStandardsOptions(input) {
|
|
5228
|
-
return
|
|
5239
|
+
return _alextheman_utility.az.with(hasStandardsOptionsSchema).parse(input);
|
|
5229
5240
|
}
|
|
5230
5241
|
const defaultOptions = { fixable: false };
|
|
5231
5242
|
const targetValue = "I have standards, you'd better have some too!";
|
|
@@ -5509,7 +5520,7 @@ function parseUseObjectShorthandOptions(data) {
|
|
|
5509
5520
|
const alexPlugin = {
|
|
5510
5521
|
meta: {
|
|
5511
5522
|
name: "@alextheman/eslint-plugin",
|
|
5512
|
-
version: "5.
|
|
5523
|
+
version: "5.15.0",
|
|
5513
5524
|
namespace: "alextheman"
|
|
5514
5525
|
},
|
|
5515
5526
|
configs: {},
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { camelToKebab, deepCopy, deepFreeze, normaliseIndents, omitProperties
|
|
1
|
+
import { az, camelToKebab, deepCopy, deepFreeze, normaliseIndents, omitProperties } from "@alextheman/utility";
|
|
2
2
|
import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
3
3
|
import z from "zod";
|
|
4
4
|
import { DataError } from "@alextheman/utility/v6";
|
|
@@ -10,7 +10,7 @@ import nodePlugin from "eslint-plugin-n";
|
|
|
10
10
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
11
11
|
import prettierPlugin from "eslint-plugin-prettier";
|
|
12
12
|
import tseslint from "typescript-eslint";
|
|
13
|
-
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
13
|
+
import jsxA11y from "eslint-plugin-jsx-a11y-x";
|
|
14
14
|
import reactPlugin from "eslint-plugin-react";
|
|
15
15
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
16
16
|
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
@@ -40,7 +40,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
40
40
|
enumerable: true
|
|
41
41
|
}) : target, mod));
|
|
42
42
|
//#endregion
|
|
43
|
-
//#region node_modules/.pnpm/globals@17.
|
|
43
|
+
//#region node_modules/.pnpm/globals@17.6.0/node_modules/globals/globals.json
|
|
44
44
|
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
45
45
|
module.exports = {
|
|
46
46
|
"amd": {
|
|
@@ -1253,9 +1253,13 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1253
1253
|
"XRAnchorSet": false,
|
|
1254
1254
|
"XRBoundedReferenceSpace": false,
|
|
1255
1255
|
"XRCamera": false,
|
|
1256
|
+
"XRCompositionLayer": false,
|
|
1256
1257
|
"XRCPUDepthInformation": false,
|
|
1258
|
+
"XRCubeLayer": false,
|
|
1259
|
+
"XRCylinderLayer": false,
|
|
1257
1260
|
"XRDepthInformation": false,
|
|
1258
1261
|
"XRDOMOverlayState": false,
|
|
1262
|
+
"XREquirectLayer": false,
|
|
1259
1263
|
"XRFrame": false,
|
|
1260
1264
|
"XRHand": false,
|
|
1261
1265
|
"XRHitTestResult": false,
|
|
@@ -1267,9 +1271,14 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1267
1271
|
"XRJointPose": false,
|
|
1268
1272
|
"XRJointSpace": false,
|
|
1269
1273
|
"XRLayer": false,
|
|
1274
|
+
"XRLayerEvent": false,
|
|
1270
1275
|
"XRLightEstimate": false,
|
|
1271
1276
|
"XRLightProbe": false,
|
|
1277
|
+
"XRPlane": false,
|
|
1278
|
+
"XRPlaneSet": false,
|
|
1272
1279
|
"XRPose": false,
|
|
1280
|
+
"XRProjectionLayer": false,
|
|
1281
|
+
"XRQuadLayer": false,
|
|
1273
1282
|
"XRRay": false,
|
|
1274
1283
|
"XRReferenceSpace": false,
|
|
1275
1284
|
"XRReferenceSpaceEvent": false,
|
|
@@ -1278,6 +1287,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1278
1287
|
"XRSession": false,
|
|
1279
1288
|
"XRSessionEvent": false,
|
|
1280
1289
|
"XRSpace": false,
|
|
1290
|
+
"XRSubImage": false,
|
|
1281
1291
|
"XRSystem": false,
|
|
1282
1292
|
"XRTransientInputHitTestResult": false,
|
|
1283
1293
|
"XRTransientInputHitTestSource": false,
|
|
@@ -1288,6 +1298,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1288
1298
|
"XRWebGLBinding": false,
|
|
1289
1299
|
"XRWebGLDepthInformation": false,
|
|
1290
1300
|
"XRWebGLLayer": false,
|
|
1301
|
+
"XRWebGLSubImage": false,
|
|
1291
1302
|
"XSLTProcessor": false
|
|
1292
1303
|
},
|
|
1293
1304
|
"builtin": {
|
|
@@ -4135,7 +4146,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4135
4146
|
};
|
|
4136
4147
|
}));
|
|
4137
4148
|
//#endregion
|
|
4138
|
-
//#region node_modules/.pnpm/globals@17.
|
|
4149
|
+
//#region node_modules/.pnpm/globals@17.6.0/node_modules/globals/index.js
|
|
4139
4150
|
var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4140
4151
|
module.exports = require_globals$1();
|
|
4141
4152
|
}));
|
|
@@ -4470,6 +4481,20 @@ const typeScriptLanguageOptions = {
|
|
|
4470
4481
|
}
|
|
4471
4482
|
};
|
|
4472
4483
|
//#endregion
|
|
4484
|
+
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4485
|
+
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
4486
|
+
return {
|
|
4487
|
+
message: "Please use node:fs/promises instead.",
|
|
4488
|
+
name
|
|
4489
|
+
};
|
|
4490
|
+
})] });
|
|
4491
|
+
//#endregion
|
|
4492
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4493
|
+
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4494
|
+
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4495
|
+
regex: "^@mui/[^/]+$"
|
|
4496
|
+
}] });
|
|
4497
|
+
//#endregion
|
|
4473
4498
|
//#region src/configs/helpers/sorting/sortClasses.ts
|
|
4474
4499
|
const sortClasses = {
|
|
4475
4500
|
customGroups: [],
|
|
@@ -4569,14 +4594,6 @@ const sortObjects = {
|
|
|
4569
4594
|
useConfigurationIf: {}
|
|
4570
4595
|
};
|
|
4571
4596
|
//#endregion
|
|
4572
|
-
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4573
|
-
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
4574
|
-
return {
|
|
4575
|
-
message: "Please use node:fs/promises instead.",
|
|
4576
|
-
name
|
|
4577
|
-
};
|
|
4578
|
-
})] });
|
|
4579
|
-
//#endregion
|
|
4580
4597
|
//#region src/configs/helpers/sorting/sortNamedImports.ts
|
|
4581
4598
|
const sortNamedImports = {
|
|
4582
4599
|
fallbackSort: { type: "unsorted" },
|
|
@@ -4663,7 +4680,7 @@ const reactHooks = {
|
|
|
4663
4680
|
const generalReact = [
|
|
4664
4681
|
reactPlugin.configs.flat.recommended,
|
|
4665
4682
|
reactPlugin.configs.flat["jsx-runtime"],
|
|
4666
|
-
jsxA11y.
|
|
4683
|
+
jsxA11y.configs.recommended,
|
|
4667
4684
|
{
|
|
4668
4685
|
languageOptions: reactLanguageOptions,
|
|
4669
4686
|
name: "@alextheman/general/react",
|
|
@@ -4693,12 +4710,6 @@ const generalReact = [
|
|
|
4693
4710
|
}
|
|
4694
4711
|
];
|
|
4695
4712
|
//#endregion
|
|
4696
|
-
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4697
|
-
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4698
|
-
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4699
|
-
regex: "^@mui/[^/]+$"
|
|
4700
|
-
}] });
|
|
4701
|
-
//#endregion
|
|
4702
4713
|
//#region src/configs/internal/react.ts
|
|
4703
4714
|
const internalReact = [{
|
|
4704
4715
|
languageOptions: reactLanguageOptions,
|
|
@@ -5206,7 +5217,7 @@ const consistentTestFunction = createRule({
|
|
|
5206
5217
|
//#region src/rules/has-standards.ts
|
|
5207
5218
|
const hasStandardsOptionsSchema = z.object({ fixable: z.boolean() }).partial();
|
|
5208
5219
|
function parseHasStandardsOptions(input) {
|
|
5209
|
-
return
|
|
5220
|
+
return az.with(hasStandardsOptionsSchema).parse(input);
|
|
5210
5221
|
}
|
|
5211
5222
|
const defaultOptions = { fixable: false };
|
|
5212
5223
|
const targetValue = "I have standards, you'd better have some too!";
|
|
@@ -5490,7 +5501,7 @@ function parseUseObjectShorthandOptions(data) {
|
|
|
5490
5501
|
const alexPlugin = {
|
|
5491
5502
|
meta: {
|
|
5492
5503
|
name: "@alextheman/eslint-plugin",
|
|
5493
|
-
version: "5.
|
|
5504
|
+
version: "5.15.0",
|
|
5494
5505
|
namespace: "alextheman"
|
|
5495
5506
|
},
|
|
5496
5507
|
configs: {},
|
package/dist/internal/index.cjs
CHANGED
|
@@ -24,7 +24,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
//#endregion
|
|
25
25
|
let typescript_eslint = require("typescript-eslint");
|
|
26
26
|
typescript_eslint = __toESM(typescript_eslint, 1);
|
|
27
|
-
|
|
27
|
+
let _alextheman_utility = require("@alextheman/utility");
|
|
28
|
+
//#region node_modules/.pnpm/globals@17.6.0/node_modules/globals/globals.json
|
|
28
29
|
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
29
30
|
module.exports = {
|
|
30
31
|
"amd": {
|
|
@@ -1237,9 +1238,13 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1237
1238
|
"XRAnchorSet": false,
|
|
1238
1239
|
"XRBoundedReferenceSpace": false,
|
|
1239
1240
|
"XRCamera": false,
|
|
1241
|
+
"XRCompositionLayer": false,
|
|
1240
1242
|
"XRCPUDepthInformation": false,
|
|
1243
|
+
"XRCubeLayer": false,
|
|
1244
|
+
"XRCylinderLayer": false,
|
|
1241
1245
|
"XRDepthInformation": false,
|
|
1242
1246
|
"XRDOMOverlayState": false,
|
|
1247
|
+
"XREquirectLayer": false,
|
|
1243
1248
|
"XRFrame": false,
|
|
1244
1249
|
"XRHand": false,
|
|
1245
1250
|
"XRHitTestResult": false,
|
|
@@ -1251,9 +1256,14 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1251
1256
|
"XRJointPose": false,
|
|
1252
1257
|
"XRJointSpace": false,
|
|
1253
1258
|
"XRLayer": false,
|
|
1259
|
+
"XRLayerEvent": false,
|
|
1254
1260
|
"XRLightEstimate": false,
|
|
1255
1261
|
"XRLightProbe": false,
|
|
1262
|
+
"XRPlane": false,
|
|
1263
|
+
"XRPlaneSet": false,
|
|
1256
1264
|
"XRPose": false,
|
|
1265
|
+
"XRProjectionLayer": false,
|
|
1266
|
+
"XRQuadLayer": false,
|
|
1257
1267
|
"XRRay": false,
|
|
1258
1268
|
"XRReferenceSpace": false,
|
|
1259
1269
|
"XRReferenceSpaceEvent": false,
|
|
@@ -1262,6 +1272,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1262
1272
|
"XRSession": false,
|
|
1263
1273
|
"XRSessionEvent": false,
|
|
1264
1274
|
"XRSpace": false,
|
|
1275
|
+
"XRSubImage": false,
|
|
1265
1276
|
"XRSystem": false,
|
|
1266
1277
|
"XRTransientInputHitTestResult": false,
|
|
1267
1278
|
"XRTransientInputHitTestSource": false,
|
|
@@ -1272,6 +1283,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1272
1283
|
"XRWebGLBinding": false,
|
|
1273
1284
|
"XRWebGLDepthInformation": false,
|
|
1274
1285
|
"XRWebGLLayer": false,
|
|
1286
|
+
"XRWebGLSubImage": false,
|
|
1275
1287
|
"XSLTProcessor": false
|
|
1276
1288
|
},
|
|
1277
1289
|
"builtin": {
|
|
@@ -4144,6 +4156,58 @@ const unusedVarsIgnorePatterns = {
|
|
|
4144
4156
|
varsIgnorePattern: "^_"
|
|
4145
4157
|
};
|
|
4146
4158
|
//#endregion
|
|
4159
|
+
//#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
|
|
4160
|
+
const generalRestrictedImports = { patterns: [{
|
|
4161
|
+
group: ["node_modules"],
|
|
4162
|
+
message: "Do not import directly from node_modules."
|
|
4163
|
+
}] };
|
|
4164
|
+
//#endregion
|
|
4165
|
+
//#region src/utility/public/combineRestrictedImports.ts
|
|
4166
|
+
/**
|
|
4167
|
+
* Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
|
|
4168
|
+
*
|
|
4169
|
+
* @category Utility
|
|
4170
|
+
*
|
|
4171
|
+
* @param groups - Option groups to combine, applied in the order provided.
|
|
4172
|
+
*
|
|
4173
|
+
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
4174
|
+
*/
|
|
4175
|
+
function combineRestrictedImports(...groups) {
|
|
4176
|
+
const paths = [];
|
|
4177
|
+
const patterns = [];
|
|
4178
|
+
for (const group of groups) {
|
|
4179
|
+
if (group.paths) paths.push(...group.paths);
|
|
4180
|
+
if (group.patterns) patterns.push(...group.patterns);
|
|
4181
|
+
}
|
|
4182
|
+
const combinedGroup = {
|
|
4183
|
+
paths,
|
|
4184
|
+
patterns
|
|
4185
|
+
};
|
|
4186
|
+
if (combinedGroup.paths.length === 0) return (0, _alextheman_utility.omitProperties)(combinedGroup, "paths");
|
|
4187
|
+
if (combinedGroup.patterns.length === 0) return (0, _alextheman_utility.omitProperties)(combinedGroup, "patterns");
|
|
4188
|
+
return combinedGroup;
|
|
4189
|
+
}
|
|
4190
|
+
//#endregion
|
|
4191
|
+
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4192
|
+
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
4193
|
+
return {
|
|
4194
|
+
message: "Please use node:fs/promises instead.",
|
|
4195
|
+
name
|
|
4196
|
+
};
|
|
4197
|
+
})] });
|
|
4198
|
+
//#endregion
|
|
4199
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4200
|
+
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4201
|
+
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4202
|
+
regex: "^@mui/[^/]+$"
|
|
4203
|
+
}] });
|
|
4204
|
+
//#endregion
|
|
4205
|
+
//#region src/configs/helpers/restrictedImports/testsRestrictedImports.ts
|
|
4206
|
+
const testsRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [{
|
|
4207
|
+
message: "Use test functions from vitest instead.",
|
|
4208
|
+
name: "node:test"
|
|
4209
|
+
}] });
|
|
4210
|
+
//#endregion
|
|
4147
4211
|
//#region src/configs/helpers/sorting/sortClasses.ts
|
|
4148
4212
|
const sortClasses = {
|
|
4149
4213
|
customGroups: [],
|
|
@@ -4243,10 +4307,14 @@ const sortObjects = {
|
|
|
4243
4307
|
useConfigurationIf: {}
|
|
4244
4308
|
};
|
|
4245
4309
|
//#endregion
|
|
4310
|
+
exports.generalRestrictedImports = generalRestrictedImports;
|
|
4311
|
+
exports.personalRestrictedImports = personalRestrictedImports;
|
|
4246
4312
|
exports.reactLanguageOptions = reactLanguageOptions;
|
|
4313
|
+
exports.reactRestrictedImports = reactRestrictedImports;
|
|
4247
4314
|
exports.sortClasses = sortClasses;
|
|
4248
4315
|
exports.sortExports = sortExports;
|
|
4249
4316
|
exports.sortImports = sortImports;
|
|
4250
4317
|
exports.sortObjects = sortObjects;
|
|
4318
|
+
exports.testsRestrictedImports = testsRestrictedImports;
|
|
4251
4319
|
exports.typeScriptLanguageOptions = typeScriptLanguageOptions;
|
|
4252
4320
|
exports.unusedVarsIgnorePatterns = unusedVarsIgnorePatterns;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Linter } from "eslint";
|
|
2
|
-
|
|
3
2
|
//#region src/configs/helpers/reactLanguageOptions.d.ts
|
|
4
3
|
declare const reactLanguageOptions: Linter.LanguageOptions;
|
|
5
4
|
//#endregion
|
|
@@ -13,78 +12,6 @@ declare const unusedVarsIgnorePatterns: {
|
|
|
13
12
|
varsIgnorePattern: string;
|
|
14
13
|
};
|
|
15
14
|
//#endregion
|
|
16
|
-
//#region src/configs/helpers/sorting/sortClasses.d.ts
|
|
17
|
-
declare const sortClasses: {
|
|
18
|
-
customGroups: never[];
|
|
19
|
-
fallbackSort: {
|
|
20
|
-
type: string;
|
|
21
|
-
};
|
|
22
|
-
groups: (string | string[])[];
|
|
23
|
-
ignoreCase: boolean;
|
|
24
|
-
newlinesBetween: number;
|
|
25
|
-
order: string;
|
|
26
|
-
partitionByComment: boolean;
|
|
27
|
-
partitionByNewLine: boolean;
|
|
28
|
-
specialCharacters: string;
|
|
29
|
-
type: string;
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/configs/helpers/sorting/sortExports.d.ts
|
|
33
|
-
declare const sortExports: {
|
|
34
|
-
customGroups: never[];
|
|
35
|
-
fallbackSort: {
|
|
36
|
-
type: string;
|
|
37
|
-
};
|
|
38
|
-
groups: string[];
|
|
39
|
-
ignoreCase: boolean;
|
|
40
|
-
newlinesBetween: number;
|
|
41
|
-
order: string;
|
|
42
|
-
partitionByComment: boolean;
|
|
43
|
-
partitionByNewLine: boolean;
|
|
44
|
-
specialCharacters: string;
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/configs/helpers/sorting/sortImports.d.ts
|
|
49
|
-
declare const sortImports: {
|
|
50
|
-
customGroups: ({
|
|
51
|
-
elementNamePattern: string[];
|
|
52
|
-
groupName: string;
|
|
53
|
-
selector?: undefined;
|
|
54
|
-
} | {
|
|
55
|
-
elementNamePattern: string[];
|
|
56
|
-
groupName: string;
|
|
57
|
-
selector: string;
|
|
58
|
-
})[];
|
|
59
|
-
groups: string[];
|
|
60
|
-
ignoreCase: boolean;
|
|
61
|
-
internalPattern: string[];
|
|
62
|
-
newlinesBetween: number;
|
|
63
|
-
order: string;
|
|
64
|
-
partitionByComment: boolean;
|
|
65
|
-
partitionByNewLine: boolean;
|
|
66
|
-
specialCharacters: string;
|
|
67
|
-
type: string;
|
|
68
|
-
};
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/configs/helpers/sorting/sortObjects.d.ts
|
|
71
|
-
declare const sortObjects: {
|
|
72
|
-
customGroups: never[];
|
|
73
|
-
fallbackSort: {
|
|
74
|
-
type: string;
|
|
75
|
-
};
|
|
76
|
-
groups: never[];
|
|
77
|
-
ignoreCase: boolean;
|
|
78
|
-
newlinesBetween: string;
|
|
79
|
-
order: string;
|
|
80
|
-
partitionByComment: boolean;
|
|
81
|
-
partitionByNewLine: boolean;
|
|
82
|
-
specialCharacters: string;
|
|
83
|
-
styledComponents: boolean;
|
|
84
|
-
type: string;
|
|
85
|
-
useConfigurationIf: {};
|
|
86
|
-
};
|
|
87
|
-
//#endregion
|
|
88
15
|
//#region src/utility/public/NoRestrictedImportsOptions.d.ts
|
|
89
16
|
interface RestrictedPathImportBase {
|
|
90
17
|
message: string;
|
|
@@ -157,4 +84,88 @@ interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
|
157
84
|
*/
|
|
158
85
|
type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestrictedImportsOptionsPatternsOnly | NoRestrictedImportsOptionsPathsAndPatterns;
|
|
159
86
|
//#endregion
|
|
160
|
-
|
|
87
|
+
//#region src/configs/helpers/restrictedImports/generalRestrictedImports.d.ts
|
|
88
|
+
declare const generalRestrictedImports: NoRestrictedImportsOptions;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.d.ts
|
|
91
|
+
declare const personalRestrictedImports: NoRestrictedImportsOptions;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.d.ts
|
|
94
|
+
declare const reactRestrictedImports: NoRestrictedImportsOptions;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/configs/helpers/restrictedImports/testsRestrictedImports.d.ts
|
|
97
|
+
declare const testsRestrictedImports: NoRestrictedImportsOptions;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/configs/helpers/sorting/sortClasses.d.ts
|
|
100
|
+
declare const sortClasses: {
|
|
101
|
+
customGroups: never[];
|
|
102
|
+
fallbackSort: {
|
|
103
|
+
type: string;
|
|
104
|
+
};
|
|
105
|
+
groups: (string | string[])[];
|
|
106
|
+
ignoreCase: boolean;
|
|
107
|
+
newlinesBetween: number;
|
|
108
|
+
order: string;
|
|
109
|
+
partitionByComment: boolean;
|
|
110
|
+
partitionByNewLine: boolean;
|
|
111
|
+
specialCharacters: string;
|
|
112
|
+
type: string;
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/configs/helpers/sorting/sortExports.d.ts
|
|
116
|
+
declare const sortExports: {
|
|
117
|
+
customGroups: never[];
|
|
118
|
+
fallbackSort: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
groups: string[];
|
|
122
|
+
ignoreCase: boolean;
|
|
123
|
+
newlinesBetween: number;
|
|
124
|
+
order: string;
|
|
125
|
+
partitionByComment: boolean;
|
|
126
|
+
partitionByNewLine: boolean;
|
|
127
|
+
specialCharacters: string;
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/configs/helpers/sorting/sortImports.d.ts
|
|
132
|
+
declare const sortImports: {
|
|
133
|
+
customGroups: ({
|
|
134
|
+
elementNamePattern: string[];
|
|
135
|
+
groupName: string;
|
|
136
|
+
selector?: undefined;
|
|
137
|
+
} | {
|
|
138
|
+
elementNamePattern: string[];
|
|
139
|
+
groupName: string;
|
|
140
|
+
selector: string;
|
|
141
|
+
})[];
|
|
142
|
+
groups: string[];
|
|
143
|
+
ignoreCase: boolean;
|
|
144
|
+
internalPattern: string[];
|
|
145
|
+
newlinesBetween: number;
|
|
146
|
+
order: string;
|
|
147
|
+
partitionByComment: boolean;
|
|
148
|
+
partitionByNewLine: boolean;
|
|
149
|
+
specialCharacters: string;
|
|
150
|
+
type: string;
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/configs/helpers/sorting/sortObjects.d.ts
|
|
154
|
+
declare const sortObjects: {
|
|
155
|
+
customGroups: never[];
|
|
156
|
+
fallbackSort: {
|
|
157
|
+
type: string;
|
|
158
|
+
};
|
|
159
|
+
groups: never[];
|
|
160
|
+
ignoreCase: boolean;
|
|
161
|
+
newlinesBetween: string;
|
|
162
|
+
order: string;
|
|
163
|
+
partitionByComment: boolean;
|
|
164
|
+
partitionByNewLine: boolean;
|
|
165
|
+
specialCharacters: string;
|
|
166
|
+
styledComponents: boolean;
|
|
167
|
+
type: string;
|
|
168
|
+
useConfigurationIf: {};
|
|
169
|
+
};
|
|
170
|
+
//#endregion
|
|
171
|
+
export { type NoRestrictedImportsOptions, type RestrictedPathImport, type RestrictedPatternImport, generalRestrictedImports, personalRestrictedImports, reactLanguageOptions, reactRestrictedImports, sortClasses, sortExports, sortImports, sortObjects, testsRestrictedImports, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Linter } from "eslint";
|
|
2
|
-
|
|
3
2
|
//#region src/configs/helpers/reactLanguageOptions.d.ts
|
|
4
3
|
declare const reactLanguageOptions: Linter.LanguageOptions;
|
|
5
4
|
//#endregion
|
|
@@ -13,78 +12,6 @@ declare const unusedVarsIgnorePatterns: {
|
|
|
13
12
|
varsIgnorePattern: string;
|
|
14
13
|
};
|
|
15
14
|
//#endregion
|
|
16
|
-
//#region src/configs/helpers/sorting/sortClasses.d.ts
|
|
17
|
-
declare const sortClasses: {
|
|
18
|
-
customGroups: never[];
|
|
19
|
-
fallbackSort: {
|
|
20
|
-
type: string;
|
|
21
|
-
};
|
|
22
|
-
groups: (string | string[])[];
|
|
23
|
-
ignoreCase: boolean;
|
|
24
|
-
newlinesBetween: number;
|
|
25
|
-
order: string;
|
|
26
|
-
partitionByComment: boolean;
|
|
27
|
-
partitionByNewLine: boolean;
|
|
28
|
-
specialCharacters: string;
|
|
29
|
-
type: string;
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/configs/helpers/sorting/sortExports.d.ts
|
|
33
|
-
declare const sortExports: {
|
|
34
|
-
customGroups: never[];
|
|
35
|
-
fallbackSort: {
|
|
36
|
-
type: string;
|
|
37
|
-
};
|
|
38
|
-
groups: string[];
|
|
39
|
-
ignoreCase: boolean;
|
|
40
|
-
newlinesBetween: number;
|
|
41
|
-
order: string;
|
|
42
|
-
partitionByComment: boolean;
|
|
43
|
-
partitionByNewLine: boolean;
|
|
44
|
-
specialCharacters: string;
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/configs/helpers/sorting/sortImports.d.ts
|
|
49
|
-
declare const sortImports: {
|
|
50
|
-
customGroups: ({
|
|
51
|
-
elementNamePattern: string[];
|
|
52
|
-
groupName: string;
|
|
53
|
-
selector?: undefined;
|
|
54
|
-
} | {
|
|
55
|
-
elementNamePattern: string[];
|
|
56
|
-
groupName: string;
|
|
57
|
-
selector: string;
|
|
58
|
-
})[];
|
|
59
|
-
groups: string[];
|
|
60
|
-
ignoreCase: boolean;
|
|
61
|
-
internalPattern: string[];
|
|
62
|
-
newlinesBetween: number;
|
|
63
|
-
order: string;
|
|
64
|
-
partitionByComment: boolean;
|
|
65
|
-
partitionByNewLine: boolean;
|
|
66
|
-
specialCharacters: string;
|
|
67
|
-
type: string;
|
|
68
|
-
};
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/configs/helpers/sorting/sortObjects.d.ts
|
|
71
|
-
declare const sortObjects: {
|
|
72
|
-
customGroups: never[];
|
|
73
|
-
fallbackSort: {
|
|
74
|
-
type: string;
|
|
75
|
-
};
|
|
76
|
-
groups: never[];
|
|
77
|
-
ignoreCase: boolean;
|
|
78
|
-
newlinesBetween: string;
|
|
79
|
-
order: string;
|
|
80
|
-
partitionByComment: boolean;
|
|
81
|
-
partitionByNewLine: boolean;
|
|
82
|
-
specialCharacters: string;
|
|
83
|
-
styledComponents: boolean;
|
|
84
|
-
type: string;
|
|
85
|
-
useConfigurationIf: {};
|
|
86
|
-
};
|
|
87
|
-
//#endregion
|
|
88
15
|
//#region src/utility/public/NoRestrictedImportsOptions.d.ts
|
|
89
16
|
interface RestrictedPathImportBase {
|
|
90
17
|
message: string;
|
|
@@ -157,4 +84,88 @@ interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
|
157
84
|
*/
|
|
158
85
|
type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestrictedImportsOptionsPatternsOnly | NoRestrictedImportsOptionsPathsAndPatterns;
|
|
159
86
|
//#endregion
|
|
160
|
-
|
|
87
|
+
//#region src/configs/helpers/restrictedImports/generalRestrictedImports.d.ts
|
|
88
|
+
declare const generalRestrictedImports: NoRestrictedImportsOptions;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.d.ts
|
|
91
|
+
declare const personalRestrictedImports: NoRestrictedImportsOptions;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.d.ts
|
|
94
|
+
declare const reactRestrictedImports: NoRestrictedImportsOptions;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/configs/helpers/restrictedImports/testsRestrictedImports.d.ts
|
|
97
|
+
declare const testsRestrictedImports: NoRestrictedImportsOptions;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/configs/helpers/sorting/sortClasses.d.ts
|
|
100
|
+
declare const sortClasses: {
|
|
101
|
+
customGroups: never[];
|
|
102
|
+
fallbackSort: {
|
|
103
|
+
type: string;
|
|
104
|
+
};
|
|
105
|
+
groups: (string | string[])[];
|
|
106
|
+
ignoreCase: boolean;
|
|
107
|
+
newlinesBetween: number;
|
|
108
|
+
order: string;
|
|
109
|
+
partitionByComment: boolean;
|
|
110
|
+
partitionByNewLine: boolean;
|
|
111
|
+
specialCharacters: string;
|
|
112
|
+
type: string;
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/configs/helpers/sorting/sortExports.d.ts
|
|
116
|
+
declare const sortExports: {
|
|
117
|
+
customGroups: never[];
|
|
118
|
+
fallbackSort: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
groups: string[];
|
|
122
|
+
ignoreCase: boolean;
|
|
123
|
+
newlinesBetween: number;
|
|
124
|
+
order: string;
|
|
125
|
+
partitionByComment: boolean;
|
|
126
|
+
partitionByNewLine: boolean;
|
|
127
|
+
specialCharacters: string;
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/configs/helpers/sorting/sortImports.d.ts
|
|
132
|
+
declare const sortImports: {
|
|
133
|
+
customGroups: ({
|
|
134
|
+
elementNamePattern: string[];
|
|
135
|
+
groupName: string;
|
|
136
|
+
selector?: undefined;
|
|
137
|
+
} | {
|
|
138
|
+
elementNamePattern: string[];
|
|
139
|
+
groupName: string;
|
|
140
|
+
selector: string;
|
|
141
|
+
})[];
|
|
142
|
+
groups: string[];
|
|
143
|
+
ignoreCase: boolean;
|
|
144
|
+
internalPattern: string[];
|
|
145
|
+
newlinesBetween: number;
|
|
146
|
+
order: string;
|
|
147
|
+
partitionByComment: boolean;
|
|
148
|
+
partitionByNewLine: boolean;
|
|
149
|
+
specialCharacters: string;
|
|
150
|
+
type: string;
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/configs/helpers/sorting/sortObjects.d.ts
|
|
154
|
+
declare const sortObjects: {
|
|
155
|
+
customGroups: never[];
|
|
156
|
+
fallbackSort: {
|
|
157
|
+
type: string;
|
|
158
|
+
};
|
|
159
|
+
groups: never[];
|
|
160
|
+
ignoreCase: boolean;
|
|
161
|
+
newlinesBetween: string;
|
|
162
|
+
order: string;
|
|
163
|
+
partitionByComment: boolean;
|
|
164
|
+
partitionByNewLine: boolean;
|
|
165
|
+
specialCharacters: string;
|
|
166
|
+
styledComponents: boolean;
|
|
167
|
+
type: string;
|
|
168
|
+
useConfigurationIf: {};
|
|
169
|
+
};
|
|
170
|
+
//#endregion
|
|
171
|
+
export { type NoRestrictedImportsOptions, type RestrictedPathImport, type RestrictedPatternImport, generalRestrictedImports, personalRestrictedImports, reactLanguageOptions, reactRestrictedImports, sortClasses, sortExports, sortImports, sortObjects, testsRestrictedImports, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
|
package/dist/internal/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import tseslint from "typescript-eslint";
|
|
2
|
+
import { omitProperties } from "@alextheman/utility";
|
|
2
3
|
//#region \0rolldown/runtime.js
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
@@ -22,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
23
|
enumerable: true
|
|
23
24
|
}) : target, mod));
|
|
24
25
|
//#endregion
|
|
25
|
-
//#region node_modules/.pnpm/globals@17.
|
|
26
|
+
//#region node_modules/.pnpm/globals@17.6.0/node_modules/globals/globals.json
|
|
26
27
|
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
27
28
|
module.exports = {
|
|
28
29
|
"amd": {
|
|
@@ -1235,9 +1236,13 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1235
1236
|
"XRAnchorSet": false,
|
|
1236
1237
|
"XRBoundedReferenceSpace": false,
|
|
1237
1238
|
"XRCamera": false,
|
|
1239
|
+
"XRCompositionLayer": false,
|
|
1238
1240
|
"XRCPUDepthInformation": false,
|
|
1241
|
+
"XRCubeLayer": false,
|
|
1242
|
+
"XRCylinderLayer": false,
|
|
1239
1243
|
"XRDepthInformation": false,
|
|
1240
1244
|
"XRDOMOverlayState": false,
|
|
1245
|
+
"XREquirectLayer": false,
|
|
1241
1246
|
"XRFrame": false,
|
|
1242
1247
|
"XRHand": false,
|
|
1243
1248
|
"XRHitTestResult": false,
|
|
@@ -1249,9 +1254,14 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1249
1254
|
"XRJointPose": false,
|
|
1250
1255
|
"XRJointSpace": false,
|
|
1251
1256
|
"XRLayer": false,
|
|
1257
|
+
"XRLayerEvent": false,
|
|
1252
1258
|
"XRLightEstimate": false,
|
|
1253
1259
|
"XRLightProbe": false,
|
|
1260
|
+
"XRPlane": false,
|
|
1261
|
+
"XRPlaneSet": false,
|
|
1254
1262
|
"XRPose": false,
|
|
1263
|
+
"XRProjectionLayer": false,
|
|
1264
|
+
"XRQuadLayer": false,
|
|
1255
1265
|
"XRRay": false,
|
|
1256
1266
|
"XRReferenceSpace": false,
|
|
1257
1267
|
"XRReferenceSpaceEvent": false,
|
|
@@ -1260,6 +1270,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1260
1270
|
"XRSession": false,
|
|
1261
1271
|
"XRSessionEvent": false,
|
|
1262
1272
|
"XRSpace": false,
|
|
1273
|
+
"XRSubImage": false,
|
|
1263
1274
|
"XRSystem": false,
|
|
1264
1275
|
"XRTransientInputHitTestResult": false,
|
|
1265
1276
|
"XRTransientInputHitTestSource": false,
|
|
@@ -1270,6 +1281,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1270
1281
|
"XRWebGLBinding": false,
|
|
1271
1282
|
"XRWebGLDepthInformation": false,
|
|
1272
1283
|
"XRWebGLLayer": false,
|
|
1284
|
+
"XRWebGLSubImage": false,
|
|
1273
1285
|
"XSLTProcessor": false
|
|
1274
1286
|
},
|
|
1275
1287
|
"builtin": {
|
|
@@ -4142,6 +4154,58 @@ const unusedVarsIgnorePatterns = {
|
|
|
4142
4154
|
varsIgnorePattern: "^_"
|
|
4143
4155
|
};
|
|
4144
4156
|
//#endregion
|
|
4157
|
+
//#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
|
|
4158
|
+
const generalRestrictedImports = { patterns: [{
|
|
4159
|
+
group: ["node_modules"],
|
|
4160
|
+
message: "Do not import directly from node_modules."
|
|
4161
|
+
}] };
|
|
4162
|
+
//#endregion
|
|
4163
|
+
//#region src/utility/public/combineRestrictedImports.ts
|
|
4164
|
+
/**
|
|
4165
|
+
* Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
|
|
4166
|
+
*
|
|
4167
|
+
* @category Utility
|
|
4168
|
+
*
|
|
4169
|
+
* @param groups - Option groups to combine, applied in the order provided.
|
|
4170
|
+
*
|
|
4171
|
+
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
4172
|
+
*/
|
|
4173
|
+
function combineRestrictedImports(...groups) {
|
|
4174
|
+
const paths = [];
|
|
4175
|
+
const patterns = [];
|
|
4176
|
+
for (const group of groups) {
|
|
4177
|
+
if (group.paths) paths.push(...group.paths);
|
|
4178
|
+
if (group.patterns) patterns.push(...group.patterns);
|
|
4179
|
+
}
|
|
4180
|
+
const combinedGroup = {
|
|
4181
|
+
paths,
|
|
4182
|
+
patterns
|
|
4183
|
+
};
|
|
4184
|
+
if (combinedGroup.paths.length === 0) return omitProperties(combinedGroup, "paths");
|
|
4185
|
+
if (combinedGroup.patterns.length === 0) return omitProperties(combinedGroup, "patterns");
|
|
4186
|
+
return combinedGroup;
|
|
4187
|
+
}
|
|
4188
|
+
//#endregion
|
|
4189
|
+
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4190
|
+
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
4191
|
+
return {
|
|
4192
|
+
message: "Please use node:fs/promises instead.",
|
|
4193
|
+
name
|
|
4194
|
+
};
|
|
4195
|
+
})] });
|
|
4196
|
+
//#endregion
|
|
4197
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4198
|
+
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4199
|
+
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4200
|
+
regex: "^@mui/[^/]+$"
|
|
4201
|
+
}] });
|
|
4202
|
+
//#endregion
|
|
4203
|
+
//#region src/configs/helpers/restrictedImports/testsRestrictedImports.ts
|
|
4204
|
+
const testsRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [{
|
|
4205
|
+
message: "Use test functions from vitest instead.",
|
|
4206
|
+
name: "node:test"
|
|
4207
|
+
}] });
|
|
4208
|
+
//#endregion
|
|
4145
4209
|
//#region src/configs/helpers/sorting/sortClasses.ts
|
|
4146
4210
|
const sortClasses = {
|
|
4147
4211
|
customGroups: [],
|
|
@@ -4241,4 +4305,4 @@ const sortObjects = {
|
|
|
4241
4305
|
useConfigurationIf: {}
|
|
4242
4306
|
};
|
|
4243
4307
|
//#endregion
|
|
4244
|
-
export { reactLanguageOptions, sortClasses, sortExports, sortImports, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
|
|
4308
|
+
export { generalRestrictedImports, personalRestrictedImports, reactLanguageOptions, reactRestrictedImports, sortClasses, sortExports, sortImports, sortObjects, testsRestrictedImports, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.15.0",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,61 +33,62 @@
|
|
|
33
33
|
"files": [
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=22.3.0"
|
|
38
|
+
},
|
|
36
39
|
"dependencies": {
|
|
37
|
-
"@alextheman/utility": "5.
|
|
38
|
-
"@eslint/compat": "2.0
|
|
39
|
-
"@typescript-eslint/types": "8.
|
|
40
|
-
"@typescript-eslint/utils": "8.
|
|
40
|
+
"@alextheman/utility": "5.18.2",
|
|
41
|
+
"@eslint/compat": "2.1.0",
|
|
42
|
+
"@typescript-eslint/types": "8.59.3",
|
|
43
|
+
"@typescript-eslint/utils": "8.59.3",
|
|
41
44
|
"common-tags": "1.8.2",
|
|
42
45
|
"prettier": "3.8.3",
|
|
43
|
-
"zod": "4.3
|
|
46
|
+
"zod": "4.4.3"
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
46
49
|
"@eslint/js": "10.0.1",
|
|
47
50
|
"@types/common-tags": "1.8.4",
|
|
48
51
|
"@types/eslint": "9.6.1",
|
|
49
52
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
50
|
-
"@types/node": "25.
|
|
51
|
-
"@typescript-eslint/rule-tester": "8.
|
|
52
|
-
"alex-c-line": "2.7.
|
|
53
|
+
"@types/node": "25.8.0",
|
|
54
|
+
"@typescript-eslint/rule-tester": "8.59.3",
|
|
55
|
+
"alex-c-line": "2.7.2",
|
|
53
56
|
"dotenv-cli": "11.0.0",
|
|
54
|
-
"eslint": "10.
|
|
57
|
+
"eslint": "10.3.0",
|
|
55
58
|
"eslint-config-prettier": "10.1.8",
|
|
56
59
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
57
60
|
"eslint-plugin-import-x": "4.16.2",
|
|
58
61
|
"eslint-plugin-jsdoc": "62.9.0",
|
|
59
|
-
"eslint-plugin-jsx-a11y": "
|
|
60
|
-
"eslint-plugin-
|
|
61
|
-
"eslint-plugin-
|
|
62
|
-
"eslint-plugin-
|
|
63
|
-
"eslint-plugin-perfectionist": "5.8.0",
|
|
62
|
+
"eslint-plugin-jsx-a11y-x": "0.2.0",
|
|
63
|
+
"eslint-plugin-n": "18.0.1",
|
|
64
|
+
"eslint-plugin-package-json": "0.91.2",
|
|
65
|
+
"eslint-plugin-perfectionist": "5.9.0",
|
|
64
66
|
"eslint-plugin-prettier": "5.5.5",
|
|
65
67
|
"eslint-plugin-react": "7.37.5",
|
|
66
68
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
67
69
|
"eslint-plugin-react-refresh": "0.5.2",
|
|
68
70
|
"eslint-vitest-rule-tester": "3.1.0",
|
|
69
71
|
"execa": "9.6.1",
|
|
70
|
-
"globals": "17.
|
|
72
|
+
"globals": "17.6.0",
|
|
71
73
|
"husky": "9.1.7",
|
|
72
|
-
"jsdom": "29.
|
|
73
|
-
"markdownlint-cli2": "0.22.
|
|
74
|
+
"jsdom": "29.1.1",
|
|
75
|
+
"markdownlint-cli2": "0.22.1",
|
|
74
76
|
"tempy": "3.2.0",
|
|
75
|
-
"tsdown": "0.
|
|
76
|
-
"tsx": "4.
|
|
77
|
+
"tsdown": "0.22.0",
|
|
78
|
+
"tsx": "4.22.0",
|
|
77
79
|
"typescript": "6.0.3",
|
|
78
|
-
"typescript-eslint": "8.
|
|
79
|
-
"vite": "8.0.
|
|
80
|
-
"vitest": "4.1.
|
|
80
|
+
"typescript-eslint": "8.59.3",
|
|
81
|
+
"vite": "8.0.13",
|
|
82
|
+
"vitest": "4.1.6"
|
|
81
83
|
},
|
|
82
84
|
"peerDependencies": {
|
|
83
85
|
"@eslint/js": ">=9.0.0",
|
|
84
86
|
"eslint": ">=9.0.0",
|
|
85
87
|
"eslint-config-prettier": ">=10.0.0",
|
|
86
|
-
"eslint-import-resolver-typescript": "4.4.4",
|
|
88
|
+
"eslint-import-resolver-typescript": ">=4.4.4",
|
|
87
89
|
"eslint-plugin-import-x": ">=4.16.2",
|
|
88
90
|
"eslint-plugin-jsdoc": ">=61.5.0",
|
|
89
|
-
"eslint-plugin-jsx-a11y": ">=
|
|
90
|
-
"eslint-plugin-markdownlint": "0.9.0",
|
|
91
|
+
"eslint-plugin-jsx-a11y-x": ">=0.2.0",
|
|
91
92
|
"eslint-plugin-n": ">=17.23.1",
|
|
92
93
|
"eslint-plugin-package-json": ">=0.85.0",
|
|
93
94
|
"eslint-plugin-perfectionist": ">=5.0.0",
|
|
@@ -108,7 +109,7 @@
|
|
|
108
109
|
"format-prettier": "pnpm run format-prettier-typescript && pnpm run format-prettier-javascript && pnpm run format-prettier-yml",
|
|
109
110
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
110
111
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
111
|
-
"format-prettier-yml": "prettier --write \"./**/*.yml\"",
|
|
112
|
+
"format-prettier-yml": "prettier --write \"./**/*.{yml,yaml}\"",
|
|
112
113
|
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-markdownlint && pnpm run lint-prettier && pnpm run lint-pre-release",
|
|
113
114
|
"lint-and-build": "tsx src/utility/checkConfigChanges.ts || pnpm run build && pnpm run lint",
|
|
114
115
|
"lint-eslint": "eslint \"{src,tests}/**/*.ts\" \"package.json\"",
|