@alextheman/eslint-plugin 5.13.0 → 5.14.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 +131 -61
- package/dist/index.js +116 -46
- package/dist/internal/index.cjs +130 -3
- package/dist/internal/index.d.cts +85 -74
- package/dist/internal/index.d.ts +85 -74
- package/dist/internal/index.js +126 -3
- package/dist/utility/index.cjs +3 -2
- package/dist/utility/index.js +2 -1
- package/package.json +17 -17
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;
|
|
@@ -6,7 +7,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
11
|
var __copyProps = (to, from, except, desc) => {
|
|
11
12
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
13
|
key = keys[i];
|
|
@@ -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.5.0/node_modules/globals/globals.json
|
|
26
27
|
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
27
28
|
module.exports = {
|
|
28
29
|
"amd": {
|
|
@@ -128,6 +129,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
128
129
|
"AudioNode": false,
|
|
129
130
|
"AudioParam": false,
|
|
130
131
|
"AudioParamMap": false,
|
|
132
|
+
"AudioPlaybackStats": false,
|
|
131
133
|
"AudioProcessingEvent": false,
|
|
132
134
|
"AudioScheduledSourceNode": false,
|
|
133
135
|
"AudioSinkInfo": false,
|
|
@@ -919,6 +921,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
919
921
|
"RTCSessionDescription": false,
|
|
920
922
|
"RTCStatsReport": false,
|
|
921
923
|
"RTCTrackEvent": false,
|
|
924
|
+
"Sanitizer": false,
|
|
922
925
|
"scheduler": false,
|
|
923
926
|
"Scheduler": false,
|
|
924
927
|
"Scheduling": false,
|
|
@@ -1120,6 +1123,9 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1120
1123
|
"TextTrackList": false,
|
|
1121
1124
|
"TextUpdateEvent": false,
|
|
1122
1125
|
"TimeEvent": false,
|
|
1126
|
+
"TimelineTrigger": false,
|
|
1127
|
+
"TimelineTriggerRange": false,
|
|
1128
|
+
"TimelineTriggerRangeList": false,
|
|
1123
1129
|
"TimeRanges": false,
|
|
1124
1130
|
"ToggleEvent": false,
|
|
1125
1131
|
"toolbar": false,
|
|
@@ -1565,6 +1571,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1565
1571
|
"PromiseRejectionEvent": false,
|
|
1566
1572
|
"prompt": false,
|
|
1567
1573
|
"queueMicrotask": false,
|
|
1574
|
+
"QuotaExceededError": false,
|
|
1568
1575
|
"ReadableByteStreamController": false,
|
|
1569
1576
|
"ReadableStream": false,
|
|
1570
1577
|
"ReadableStreamBYOBReader": false,
|
|
@@ -2355,6 +2362,70 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2355
2362
|
"WeakRef": false,
|
|
2356
2363
|
"WeakSet": false
|
|
2357
2364
|
},
|
|
2365
|
+
"es2027": {
|
|
2366
|
+
"AggregateError": false,
|
|
2367
|
+
"Array": false,
|
|
2368
|
+
"ArrayBuffer": false,
|
|
2369
|
+
"Atomics": false,
|
|
2370
|
+
"BigInt": false,
|
|
2371
|
+
"BigInt64Array": false,
|
|
2372
|
+
"BigUint64Array": false,
|
|
2373
|
+
"Boolean": false,
|
|
2374
|
+
"DataView": false,
|
|
2375
|
+
"Date": false,
|
|
2376
|
+
"decodeURI": false,
|
|
2377
|
+
"decodeURIComponent": false,
|
|
2378
|
+
"encodeURI": false,
|
|
2379
|
+
"encodeURIComponent": false,
|
|
2380
|
+
"Error": false,
|
|
2381
|
+
"escape": false,
|
|
2382
|
+
"eval": false,
|
|
2383
|
+
"EvalError": false,
|
|
2384
|
+
"FinalizationRegistry": false,
|
|
2385
|
+
"Float16Array": false,
|
|
2386
|
+
"Float32Array": false,
|
|
2387
|
+
"Float64Array": false,
|
|
2388
|
+
"Function": false,
|
|
2389
|
+
"globalThis": false,
|
|
2390
|
+
"Infinity": false,
|
|
2391
|
+
"Int16Array": false,
|
|
2392
|
+
"Int32Array": false,
|
|
2393
|
+
"Int8Array": false,
|
|
2394
|
+
"Intl": false,
|
|
2395
|
+
"isFinite": false,
|
|
2396
|
+
"isNaN": false,
|
|
2397
|
+
"Iterator": false,
|
|
2398
|
+
"JSON": false,
|
|
2399
|
+
"Map": false,
|
|
2400
|
+
"Math": false,
|
|
2401
|
+
"NaN": false,
|
|
2402
|
+
"Number": false,
|
|
2403
|
+
"Object": false,
|
|
2404
|
+
"parseFloat": false,
|
|
2405
|
+
"parseInt": false,
|
|
2406
|
+
"Promise": false,
|
|
2407
|
+
"Proxy": false,
|
|
2408
|
+
"RangeError": false,
|
|
2409
|
+
"ReferenceError": false,
|
|
2410
|
+
"Reflect": false,
|
|
2411
|
+
"RegExp": false,
|
|
2412
|
+
"Set": false,
|
|
2413
|
+
"SharedArrayBuffer": false,
|
|
2414
|
+
"String": false,
|
|
2415
|
+
"Symbol": false,
|
|
2416
|
+
"SyntaxError": false,
|
|
2417
|
+
"TypeError": false,
|
|
2418
|
+
"Uint16Array": false,
|
|
2419
|
+
"Uint32Array": false,
|
|
2420
|
+
"Uint8Array": false,
|
|
2421
|
+
"Uint8ClampedArray": false,
|
|
2422
|
+
"undefined": false,
|
|
2423
|
+
"unescape": false,
|
|
2424
|
+
"URIError": false,
|
|
2425
|
+
"WeakMap": false,
|
|
2426
|
+
"WeakRef": false,
|
|
2427
|
+
"WeakSet": false
|
|
2428
|
+
},
|
|
2358
2429
|
"es3": {
|
|
2359
2430
|
"Array": false,
|
|
2360
2431
|
"Boolean": false,
|
|
@@ -4072,6 +4143,58 @@ const unusedVarsIgnorePatterns = {
|
|
|
4072
4143
|
varsIgnorePattern: "^_"
|
|
4073
4144
|
};
|
|
4074
4145
|
//#endregion
|
|
4146
|
+
//#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
|
|
4147
|
+
const generalRestrictedImports = { patterns: [{
|
|
4148
|
+
group: ["node_modules"],
|
|
4149
|
+
message: "Do not import directly from node_modules."
|
|
4150
|
+
}] };
|
|
4151
|
+
//#endregion
|
|
4152
|
+
//#region src/utility/public/combineRestrictedImports.ts
|
|
4153
|
+
/**
|
|
4154
|
+
* Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
|
|
4155
|
+
*
|
|
4156
|
+
* @category Utility
|
|
4157
|
+
*
|
|
4158
|
+
* @param groups - Option groups to combine, applied in the order provided.
|
|
4159
|
+
*
|
|
4160
|
+
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
4161
|
+
*/
|
|
4162
|
+
function combineRestrictedImports(...groups) {
|
|
4163
|
+
const paths = [];
|
|
4164
|
+
const patterns = [];
|
|
4165
|
+
for (const group of groups) {
|
|
4166
|
+
if (group.paths) paths.push(...group.paths);
|
|
4167
|
+
if (group.patterns) patterns.push(...group.patterns);
|
|
4168
|
+
}
|
|
4169
|
+
const combinedGroup = {
|
|
4170
|
+
paths,
|
|
4171
|
+
patterns
|
|
4172
|
+
};
|
|
4173
|
+
if (combinedGroup.paths.length === 0) return omitProperties(combinedGroup, "paths");
|
|
4174
|
+
if (combinedGroup.patterns.length === 0) return omitProperties(combinedGroup, "patterns");
|
|
4175
|
+
return combinedGroup;
|
|
4176
|
+
}
|
|
4177
|
+
//#endregion
|
|
4178
|
+
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4179
|
+
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
4180
|
+
return {
|
|
4181
|
+
message: "Please use node:fs/promises instead.",
|
|
4182
|
+
name
|
|
4183
|
+
};
|
|
4184
|
+
})] });
|
|
4185
|
+
//#endregion
|
|
4186
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4187
|
+
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4188
|
+
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4189
|
+
regex: "^@mui/[^/]+$"
|
|
4190
|
+
}] });
|
|
4191
|
+
//#endregion
|
|
4192
|
+
//#region src/configs/helpers/restrictedImports/testsRestrictedImports.ts
|
|
4193
|
+
const testsRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [{
|
|
4194
|
+
message: "Use test functions from vitest instead.",
|
|
4195
|
+
name: "node:test"
|
|
4196
|
+
}] });
|
|
4197
|
+
//#endregion
|
|
4075
4198
|
//#region src/configs/helpers/sorting/sortClasses.ts
|
|
4076
4199
|
const sortClasses = {
|
|
4077
4200
|
customGroups: [],
|
|
@@ -4171,4 +4294,4 @@ const sortObjects = {
|
|
|
4171
4294
|
useConfigurationIf: {}
|
|
4172
4295
|
};
|
|
4173
4296
|
//#endregion
|
|
4174
|
-
export { reactLanguageOptions, sortClasses, sortExports, sortImports, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
|
|
4297
|
+
export { generalRestrictedImports, personalRestrictedImports, reactLanguageOptions, reactRestrictedImports, sortClasses, sortExports, sortImports, sortObjects, testsRestrictedImports, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
|
package/dist/utility/index.cjs
CHANGED
|
@@ -24,7 +24,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
let _typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
25
25
|
let _alextheman_utility = require("@alextheman/utility");
|
|
26
26
|
let zod = require("zod");
|
|
27
|
-
zod = __toESM(zod);
|
|
27
|
+
zod = __toESM(zod, 1);
|
|
28
|
+
let _alextheman_utility_v6 = require("@alextheman/utility/v6");
|
|
28
29
|
//#region src/utility/public/checkCallExpression.ts
|
|
29
30
|
/**
|
|
30
31
|
* Checks if a given node matches the expected object and property names.
|
|
@@ -101,7 +102,7 @@ function fixOnCondition(fixable, fix) {
|
|
|
101
102
|
//#endregion
|
|
102
103
|
//#region src/utility/private/camelToKebab.ts
|
|
103
104
|
function camelToKebab(string) {
|
|
104
|
-
if (string[0] === string[0].toUpperCase()) throw new
|
|
105
|
+
if (string[0] === string[0].toUpperCase()) throw new _alextheman_utility_v6.DataError({ string }, "CAMEL_TO_KEBAB_CONVERSION_ERROR", "camelCase string must start with a lowercase letter.");
|
|
105
106
|
return (0, _alextheman_utility.camelToKebab)(string, { preserveConsecutiveCapitals: false });
|
|
106
107
|
}
|
|
107
108
|
//#endregion
|
package/dist/utility/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { camelToKebab, omitProperties } from "@alextheman/utility";
|
|
3
3
|
import z from "zod";
|
|
4
|
+
import { DataError } from "@alextheman/utility/v6";
|
|
4
5
|
//#region src/utility/public/checkCallExpression.ts
|
|
5
6
|
/**
|
|
6
7
|
* Checks if a given node matches the expected object and property names.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.0",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@alextheman/utility": "5.
|
|
37
|
+
"@alextheman/utility": "5.14.0",
|
|
38
38
|
"@eslint/compat": "2.0.5",
|
|
39
|
-
"@typescript-eslint/types": "8.
|
|
40
|
-
"@typescript-eslint/utils": "8.
|
|
39
|
+
"@typescript-eslint/types": "8.59.0",
|
|
40
|
+
"@typescript-eslint/utils": "8.59.0",
|
|
41
41
|
"common-tags": "1.8.2",
|
|
42
|
-
"prettier": "3.8.
|
|
42
|
+
"prettier": "3.8.3",
|
|
43
43
|
"zod": "4.3.6"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@types/eslint": "9.6.1",
|
|
49
49
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
50
50
|
"@types/node": "25.6.0",
|
|
51
|
-
"@typescript-eslint/rule-tester": "8.
|
|
52
|
-
"alex-c-line": "2.
|
|
51
|
+
"@typescript-eslint/rule-tester": "8.59.0",
|
|
52
|
+
"alex-c-line": "2.7.2",
|
|
53
53
|
"dotenv-cli": "11.0.0",
|
|
54
|
-
"eslint": "10.2.
|
|
54
|
+
"eslint": "10.2.1",
|
|
55
55
|
"eslint-config-prettier": "10.1.8",
|
|
56
56
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
57
57
|
"eslint-plugin-import-x": "4.16.2",
|
|
@@ -60,24 +60,24 @@
|
|
|
60
60
|
"eslint-plugin-markdownlint": "0.9.0",
|
|
61
61
|
"eslint-plugin-n": "17.24.0",
|
|
62
62
|
"eslint-plugin-package-json": "0.91.1",
|
|
63
|
-
"eslint-plugin-perfectionist": "5.
|
|
63
|
+
"eslint-plugin-perfectionist": "5.9.0",
|
|
64
64
|
"eslint-plugin-prettier": "5.5.5",
|
|
65
65
|
"eslint-plugin-react": "7.37.5",
|
|
66
|
-
"eslint-plugin-react-hooks": "7.
|
|
66
|
+
"eslint-plugin-react-hooks": "7.1.1",
|
|
67
67
|
"eslint-plugin-react-refresh": "0.5.2",
|
|
68
68
|
"eslint-vitest-rule-tester": "3.1.0",
|
|
69
69
|
"execa": "9.6.1",
|
|
70
|
-
"globals": "17.
|
|
70
|
+
"globals": "17.5.0",
|
|
71
71
|
"husky": "9.1.7",
|
|
72
72
|
"jsdom": "29.0.2",
|
|
73
|
-
"markdownlint-cli2": "0.22.
|
|
73
|
+
"markdownlint-cli2": "0.22.1",
|
|
74
74
|
"tempy": "3.2.0",
|
|
75
|
-
"tsdown": "0.21.
|
|
75
|
+
"tsdown": "0.21.10",
|
|
76
76
|
"tsx": "4.21.0",
|
|
77
|
-
"typescript": "6.0.
|
|
78
|
-
"typescript-eslint": "8.
|
|
79
|
-
"vite": "8.0.
|
|
80
|
-
"vitest": "4.1.
|
|
77
|
+
"typescript": "6.0.3",
|
|
78
|
+
"typescript-eslint": "8.59.0",
|
|
79
|
+
"vite": "8.0.10",
|
|
80
|
+
"vitest": "4.1.5"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@eslint/js": ">=9.0.0",
|