@alextheman/eslint-plugin 5.12.0 → 5.13.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/README.md +1 -1
- package/dist/index.cjs +46 -146
- package/dist/index.d.cts +1 -6
- package/dist/index.d.ts +1 -6
- package/dist/index.js +41 -144
- package/dist/internal/index.cjs +11 -32
- package/dist/internal/index.js +10 -31
- package/dist/utility/index.cjs +8 -22
- package/dist/utility/index.js +1 -10
- package/package.json +24 -26
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
//#region \0rolldown/runtime.js
|
|
3
6
|
var __create = Object.create;
|
|
4
7
|
var __defProp = Object.defineProperty;
|
|
@@ -8,16 +11,12 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
8
11
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
12
|
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
13
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
21
20
|
}
|
|
22
21
|
return to;
|
|
23
22
|
};
|
|
@@ -25,7 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
24
|
value: mod,
|
|
26
25
|
enumerable: true
|
|
27
26
|
}) : target, mod));
|
|
28
|
-
|
|
29
27
|
//#endregion
|
|
30
28
|
let _alextheman_utility = require("@alextheman/utility");
|
|
31
29
|
let _typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
@@ -35,8 +33,10 @@ let _eslint_js = require("@eslint/js");
|
|
|
35
33
|
_eslint_js = __toESM(_eslint_js);
|
|
36
34
|
let eslint_config_prettier = require("eslint-config-prettier");
|
|
37
35
|
eslint_config_prettier = __toESM(eslint_config_prettier);
|
|
38
|
-
let
|
|
39
|
-
|
|
36
|
+
let eslint_import_resolver_typescript = require("eslint-import-resolver-typescript");
|
|
37
|
+
eslint_import_resolver_typescript = __toESM(eslint_import_resolver_typescript);
|
|
38
|
+
let eslint_plugin_import_x = require("eslint-plugin-import-x");
|
|
39
|
+
eslint_plugin_import_x = __toESM(eslint_plugin_import_x);
|
|
40
40
|
let eslint_plugin_n = require("eslint-plugin-n");
|
|
41
41
|
eslint_plugin_n = __toESM(eslint_plugin_n);
|
|
42
42
|
let eslint_plugin_perfectionist = require("eslint-plugin-perfectionist");
|
|
@@ -58,7 +58,6 @@ eslint_plugin_package_json = __toESM(eslint_plugin_package_json);
|
|
|
58
58
|
let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
|
|
59
59
|
eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc);
|
|
60
60
|
let _alextheman_utility_node = require("@alextheman/utility/node");
|
|
61
|
-
|
|
62
61
|
//#region node_modules/.pnpm/globals@17.4.0/node_modules/globals/globals.json
|
|
63
62
|
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
64
63
|
module.exports = {
|
|
@@ -4083,20 +4082,17 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4083
4082
|
}
|
|
4084
4083
|
};
|
|
4085
4084
|
}));
|
|
4086
|
-
|
|
4087
4085
|
//#endregion
|
|
4088
4086
|
//#region node_modules/.pnpm/globals@17.4.0/node_modules/globals/index.js
|
|
4089
4087
|
var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4090
4088
|
module.exports = require_globals$1();
|
|
4091
4089
|
}));
|
|
4092
|
-
|
|
4093
4090
|
//#endregion
|
|
4094
4091
|
//#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
|
|
4095
4092
|
const generalRestrictedImports = { patterns: [{
|
|
4096
4093
|
group: ["node_modules"],
|
|
4097
4094
|
message: "Do not import directly from node_modules."
|
|
4098
4095
|
}] };
|
|
4099
|
-
|
|
4100
4096
|
//#endregion
|
|
4101
4097
|
//#region src/utility/public/checkCallExpression.ts
|
|
4102
4098
|
/**
|
|
@@ -4113,7 +4109,6 @@ const generalRestrictedImports = { patterns: [{
|
|
|
4113
4109
|
function checkCallExpression(node, objectName, propertyName) {
|
|
4114
4110
|
return node.callee.type === _typescript_eslint_utils.AST_NODE_TYPES.MemberExpression && node.callee.object.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
|
|
4115
4111
|
}
|
|
4116
|
-
|
|
4117
4112
|
//#endregion
|
|
4118
4113
|
//#region src/utility/public/combineRestrictedImports.ts
|
|
4119
4114
|
/**
|
|
@@ -4140,7 +4135,6 @@ function combineRestrictedImports(...groups) {
|
|
|
4140
4135
|
if (combinedGroup.patterns.length === 0) return (0, _alextheman_utility.omitProperties)(combinedGroup, "patterns");
|
|
4141
4136
|
return combinedGroup;
|
|
4142
4137
|
}
|
|
4143
|
-
|
|
4144
4138
|
//#endregion
|
|
4145
4139
|
//#region src/utility/public/createRuleSchemaFromZodSchema.ts
|
|
4146
4140
|
/**
|
|
@@ -4155,7 +4149,6 @@ function combineRestrictedImports(...groups) {
|
|
|
4155
4149
|
function createRuleSchemaFromZodSchema(schema) {
|
|
4156
4150
|
return [(0, _alextheman_utility.omitProperties)(zod.default.toJSONSchema(schema), "$schema")];
|
|
4157
4151
|
}
|
|
4158
|
-
|
|
4159
4152
|
//#endregion
|
|
4160
4153
|
//#region src/utility/public/fixOnCondition.ts
|
|
4161
4154
|
/**
|
|
@@ -4174,14 +4167,12 @@ function fixOnCondition(fixable, fix) {
|
|
|
4174
4167
|
return fix(fixer);
|
|
4175
4168
|
};
|
|
4176
4169
|
}
|
|
4177
|
-
|
|
4178
4170
|
//#endregion
|
|
4179
4171
|
//#region src/utility/private/camelToKebab.ts
|
|
4180
4172
|
function camelToKebab(string) {
|
|
4181
4173
|
if (string[0] === string[0].toUpperCase()) throw new _alextheman_utility.DataError({ string }, "CAMEL_TO_KEBAB_CONVERSION_ERROR", "camelCase string must start with a lowercase letter.");
|
|
4182
4174
|
return (0, _alextheman_utility.camelToKebab)(string, { preserveConsecutiveCapitals: false });
|
|
4183
4175
|
}
|
|
4184
|
-
|
|
4185
4176
|
//#endregion
|
|
4186
4177
|
//#region src/utility/private/createConfigGroup.ts
|
|
4187
4178
|
function createConfigGroup(group, configs) {
|
|
@@ -4189,7 +4180,6 @@ function createConfigGroup(group, configs) {
|
|
|
4189
4180
|
for (const key in configs) newConfigs[`${camelToKebab(group)}/${camelToKebab(key)}`] = configs[key];
|
|
4190
4181
|
return newConfigs;
|
|
4191
4182
|
}
|
|
4192
|
-
|
|
4193
4183
|
//#endregion
|
|
4194
4184
|
//#region src/utility/public/flattenConfigs.ts
|
|
4195
4185
|
/**
|
|
@@ -4234,7 +4224,6 @@ function flattenConfigs(config) {
|
|
|
4234
4224
|
for (const configGroupEntries of Object.entries(config)) Object.assign(allConfigs, createConfigGroup(...configGroupEntries));
|
|
4235
4225
|
return allConfigs;
|
|
4236
4226
|
}
|
|
4237
|
-
|
|
4238
4227
|
//#endregion
|
|
4239
4228
|
//#region src/utility/public/getImportSpecifiersAfterRemoving.ts
|
|
4240
4229
|
/**
|
|
@@ -4259,14 +4248,12 @@ function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
|
|
|
4259
4248
|
return context.sourceCode.getText(specifier);
|
|
4260
4249
|
}).join(", ");
|
|
4261
4250
|
}
|
|
4262
|
-
|
|
4263
4251
|
//#endregion
|
|
4264
4252
|
//#region src/configs/helpers/restrictedImports/testsRestrictedImports.ts
|
|
4265
4253
|
const testsRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [{
|
|
4266
4254
|
message: "Use test functions from vitest instead.",
|
|
4267
4255
|
name: "node:test"
|
|
4268
4256
|
}] });
|
|
4269
|
-
|
|
4270
4257
|
//#endregion
|
|
4271
4258
|
//#region src/configs/internal/tests.ts
|
|
4272
4259
|
var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
|
|
@@ -4297,7 +4284,6 @@ const internalTests = [{
|
|
|
4297
4284
|
"no-restricted-imports": ["error", testsRestrictedImports]
|
|
4298
4285
|
}
|
|
4299
4286
|
}];
|
|
4300
|
-
|
|
4301
4287
|
//#endregion
|
|
4302
4288
|
//#region src/configs/plugin/base.ts
|
|
4303
4289
|
function pluginBase(plugin) {
|
|
@@ -4311,7 +4297,6 @@ function pluginBase(plugin) {
|
|
|
4311
4297
|
}
|
|
4312
4298
|
}];
|
|
4313
4299
|
}
|
|
4314
|
-
|
|
4315
4300
|
//#endregion
|
|
4316
4301
|
//#region src/configs/plugin/tests.ts
|
|
4317
4302
|
function pluginTests(plugin) {
|
|
@@ -4326,7 +4311,6 @@ function pluginTests(plugin) {
|
|
|
4326
4311
|
}
|
|
4327
4312
|
}];
|
|
4328
4313
|
}
|
|
4329
|
-
|
|
4330
4314
|
//#endregion
|
|
4331
4315
|
//#region src/configs/combined/tests.ts
|
|
4332
4316
|
function combinedTests(plugin) {
|
|
@@ -4336,7 +4320,6 @@ function combinedTests(plugin) {
|
|
|
4336
4320
|
...internalTests
|
|
4337
4321
|
];
|
|
4338
4322
|
}
|
|
4339
|
-
|
|
4340
4323
|
//#endregion
|
|
4341
4324
|
//#region src/configs/helpers/javaScriptLanguageOptions.ts
|
|
4342
4325
|
const javaScriptLanguageOptions = { globals: {
|
|
@@ -4344,7 +4327,6 @@ const javaScriptLanguageOptions = { globals: {
|
|
|
4344
4327
|
...import_globals.default.browser,
|
|
4345
4328
|
...import_globals.default.vitest
|
|
4346
4329
|
} };
|
|
4347
|
-
|
|
4348
4330
|
//#endregion
|
|
4349
4331
|
//#region src/configs/helpers/unusedVarsIgnorePatterns.ts
|
|
4350
4332
|
const unusedVarsIgnorePatterns = {
|
|
@@ -4352,7 +4334,6 @@ const unusedVarsIgnorePatterns = {
|
|
|
4352
4334
|
caughtErrorsIgnorePattern: "^_",
|
|
4353
4335
|
varsIgnorePattern: "^_"
|
|
4354
4336
|
};
|
|
4355
|
-
|
|
4356
4337
|
//#endregion
|
|
4357
4338
|
//#region src/configs/general/javaScript.ts
|
|
4358
4339
|
const generalJavaScript = [
|
|
@@ -4370,13 +4351,13 @@ const generalJavaScript = [
|
|
|
4370
4351
|
languageOptions: javaScriptLanguageOptions,
|
|
4371
4352
|
name: "@alextheman/general/javascript",
|
|
4372
4353
|
plugins: {
|
|
4373
|
-
import:
|
|
4354
|
+
"import-x": eslint_plugin_import_x.default,
|
|
4374
4355
|
n: eslint_plugin_n.default
|
|
4375
4356
|
},
|
|
4376
4357
|
rules: {
|
|
4377
4358
|
eqeqeq: "error",
|
|
4378
|
-
"import/no-duplicates": ["error", { "prefer-inline": false }],
|
|
4379
|
-
"import/no-unresolved": "error",
|
|
4359
|
+
"import-x/no-duplicates": ["error", { "prefer-inline": false }],
|
|
4360
|
+
"import-x/no-unresolved": "error",
|
|
4380
4361
|
"n/file-extension-in-import": [
|
|
4381
4362
|
"error",
|
|
4382
4363
|
"always",
|
|
@@ -4408,14 +4389,16 @@ const generalJavaScript = [
|
|
|
4408
4389
|
"no-useless-return": "error",
|
|
4409
4390
|
"prefer-const": "error"
|
|
4410
4391
|
},
|
|
4411
|
-
settings: { "import/resolver": {
|
|
4392
|
+
settings: { "import-x/resolver": {
|
|
4393
|
+
name: "tsResolver",
|
|
4394
|
+
options: { node: true },
|
|
4395
|
+
resolver: eslint_import_resolver_typescript
|
|
4396
|
+
} }
|
|
4412
4397
|
}
|
|
4413
4398
|
];
|
|
4414
|
-
|
|
4415
4399
|
//#endregion
|
|
4416
4400
|
//#region src/configs/external/prettierConfig.ts
|
|
4417
4401
|
const prettierConfig = { printWidth: 100 };
|
|
4418
|
-
|
|
4419
4402
|
//#endregion
|
|
4420
4403
|
//#region src/configs/helpers/reactLanguageOptions.ts
|
|
4421
4404
|
const reactLanguageOptions = {
|
|
@@ -4423,7 +4406,6 @@ const reactLanguageOptions = {
|
|
|
4423
4406
|
globals: import_globals.default.browser,
|
|
4424
4407
|
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
4425
4408
|
};
|
|
4426
|
-
|
|
4427
4409
|
//#endregion
|
|
4428
4410
|
//#region src/configs/helpers/typeScriptLanguageOptions.ts
|
|
4429
4411
|
const typeScriptLanguageOptions = {
|
|
@@ -4435,7 +4417,6 @@ const typeScriptLanguageOptions = {
|
|
|
4435
4417
|
tsconfigRootDir: process.cwd()
|
|
4436
4418
|
}
|
|
4437
4419
|
};
|
|
4438
|
-
|
|
4439
4420
|
//#endregion
|
|
4440
4421
|
//#region src/configs/helpers/sorting/sortClasses.ts
|
|
4441
4422
|
const sortClasses = {
|
|
@@ -4462,7 +4443,6 @@ const sortClasses = {
|
|
|
4462
4443
|
specialCharacters: "keep",
|
|
4463
4444
|
type: "alphabetical"
|
|
4464
4445
|
};
|
|
4465
|
-
|
|
4466
4446
|
//#endregion
|
|
4467
4447
|
//#region src/configs/helpers/sorting/sortExports.ts
|
|
4468
4448
|
const sortExports = {
|
|
@@ -4482,7 +4462,6 @@ const sortExports = {
|
|
|
4482
4462
|
specialCharacters: "keep",
|
|
4483
4463
|
type: "alphabetical"
|
|
4484
4464
|
};
|
|
4485
|
-
|
|
4486
4465
|
//#endregion
|
|
4487
4466
|
//#region src/configs/helpers/sorting/sortImports.ts
|
|
4488
4467
|
const sortImports = {
|
|
@@ -4521,7 +4500,6 @@ const sortImports = {
|
|
|
4521
4500
|
specialCharacters: "keep",
|
|
4522
4501
|
type: "alphabetical"
|
|
4523
4502
|
};
|
|
4524
|
-
|
|
4525
4503
|
//#endregion
|
|
4526
4504
|
//#region src/configs/helpers/sorting/sortObjects.ts
|
|
4527
4505
|
const sortObjects = {
|
|
@@ -4538,7 +4516,6 @@ const sortObjects = {
|
|
|
4538
4516
|
type: "alphabetical",
|
|
4539
4517
|
useConfigurationIf: {}
|
|
4540
4518
|
};
|
|
4541
|
-
|
|
4542
4519
|
//#endregion
|
|
4543
4520
|
//#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
|
|
4544
4521
|
const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
|
|
@@ -4547,7 +4524,6 @@ const personalRestrictedImports = combineRestrictedImports(generalRestrictedImpo
|
|
|
4547
4524
|
name
|
|
4548
4525
|
};
|
|
4549
4526
|
})] });
|
|
4550
|
-
|
|
4551
4527
|
//#endregion
|
|
4552
4528
|
//#region src/configs/helpers/sorting/sortNamedImports.ts
|
|
4553
4529
|
const sortNamedImports = {
|
|
@@ -4562,7 +4538,6 @@ const sortNamedImports = {
|
|
|
4562
4538
|
specialCharacters: "keep",
|
|
4563
4539
|
type: "alphabetical"
|
|
4564
4540
|
};
|
|
4565
|
-
|
|
4566
4541
|
//#endregion
|
|
4567
4542
|
//#region src/configs/internal/javaScript.ts
|
|
4568
4543
|
function internalJavaScript(plugin) {
|
|
@@ -4577,7 +4552,6 @@ function internalJavaScript(plugin) {
|
|
|
4577
4552
|
name: "@alextheman/internal/javascript",
|
|
4578
4553
|
plugins: {
|
|
4579
4554
|
"@alextheman": plugin,
|
|
4580
|
-
import: eslint_plugin_import.default,
|
|
4581
4555
|
n: eslint_plugin_n.default,
|
|
4582
4556
|
perfectionist: eslint_plugin_perfectionist.default,
|
|
4583
4557
|
prettier: eslint_plugin_prettier.default
|
|
@@ -4591,7 +4565,6 @@ function internalJavaScript(plugin) {
|
|
|
4591
4565
|
"declaration",
|
|
4592
4566
|
{ allowArrowFunctions: false }
|
|
4593
4567
|
],
|
|
4594
|
-
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
4595
4568
|
"n/no-extraneous-import": "off",
|
|
4596
4569
|
"no-else-return": "error",
|
|
4597
4570
|
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
@@ -4612,7 +4585,6 @@ function internalJavaScript(plugin) {
|
|
|
4612
4585
|
rules: { "@alextheman/no-relative-imports": ["error", { depth: 0 }] }
|
|
4613
4586
|
}];
|
|
4614
4587
|
}
|
|
4615
|
-
|
|
4616
4588
|
//#endregion
|
|
4617
4589
|
//#region src/configs/combined/javaScript.ts
|
|
4618
4590
|
function combinedJavaScript(plugin) {
|
|
@@ -4624,7 +4596,6 @@ function combinedJavaScript(plugin) {
|
|
|
4624
4596
|
...combinedTests(plugin)
|
|
4625
4597
|
];
|
|
4626
4598
|
}
|
|
4627
|
-
|
|
4628
4599
|
//#endregion
|
|
4629
4600
|
//#region src/configs/helpers/eslint-plugin-react-hooks.ts
|
|
4630
4601
|
const reactHooks = {
|
|
@@ -4635,7 +4606,6 @@ const reactHooks = {
|
|
|
4635
4606
|
"flat/recommended-latest": eslint_plugin_react_hooks.default.configs.flat["recommended-latest"]
|
|
4636
4607
|
}
|
|
4637
4608
|
};
|
|
4638
|
-
|
|
4639
4609
|
//#endregion
|
|
4640
4610
|
//#region src/configs/general/react.ts
|
|
4641
4611
|
const generalReact = [
|
|
@@ -4670,14 +4640,12 @@ const generalReact = [
|
|
|
4670
4640
|
settings: { react: { version: "detect" } }
|
|
4671
4641
|
}
|
|
4672
4642
|
];
|
|
4673
|
-
|
|
4674
4643
|
//#endregion
|
|
4675
4644
|
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
4676
4645
|
const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
|
|
4677
4646
|
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4678
4647
|
regex: "^@mui/[^/]+$"
|
|
4679
4648
|
}] });
|
|
4680
|
-
|
|
4681
4649
|
//#endregion
|
|
4682
4650
|
//#region src/configs/internal/react.ts
|
|
4683
4651
|
const internalReact = [{
|
|
@@ -4696,7 +4664,6 @@ const internalReact = [{
|
|
|
4696
4664
|
"react/jsx-boolean-value": "error"
|
|
4697
4665
|
}
|
|
4698
4666
|
}];
|
|
4699
|
-
|
|
4700
4667
|
//#endregion
|
|
4701
4668
|
//#region src/configs/combined/react.ts
|
|
4702
4669
|
const combinedReact = [
|
|
@@ -4704,7 +4671,6 @@ const combinedReact = [
|
|
|
4704
4671
|
...generalReact,
|
|
4705
4672
|
...internalReact
|
|
4706
4673
|
];
|
|
4707
|
-
|
|
4708
4674
|
//#endregion
|
|
4709
4675
|
//#region src/configs/combined/javaScriptReact.ts
|
|
4710
4676
|
function combinedJavaScriptReact(plugin) {
|
|
@@ -4714,14 +4680,12 @@ function combinedJavaScriptReact(plugin) {
|
|
|
4714
4680
|
...combinedReact
|
|
4715
4681
|
];
|
|
4716
4682
|
}
|
|
4717
|
-
|
|
4718
4683
|
//#endregion
|
|
4719
4684
|
//#region src/configs/general/packageJson.ts
|
|
4720
4685
|
const generalPackageJson = [eslint_plugin_package_json.default.configs.recommended, {
|
|
4721
4686
|
plugins: { "package-json": eslint_plugin_package_json.default },
|
|
4722
4687
|
rules: { "package-json/scripts-name-casing": "error" }
|
|
4723
4688
|
}];
|
|
4724
|
-
|
|
4725
4689
|
//#endregion
|
|
4726
4690
|
//#region src/configs/general/typeScript.ts
|
|
4727
4691
|
const generalTypeScript = [
|
|
@@ -4745,7 +4709,6 @@ const generalTypeScript = [
|
|
|
4745
4709
|
}
|
|
4746
4710
|
}
|
|
4747
4711
|
];
|
|
4748
|
-
|
|
4749
4712
|
//#endregion
|
|
4750
4713
|
//#region src/configs/internal/alexCLine.ts
|
|
4751
4714
|
function internalAlexCLine(plugin) {
|
|
@@ -4764,7 +4727,6 @@ function internalAlexCLine(plugin) {
|
|
|
4764
4727
|
}
|
|
4765
4728
|
];
|
|
4766
4729
|
}
|
|
4767
|
-
|
|
4768
4730
|
//#endregion
|
|
4769
4731
|
//#region src/configs/helpers/requireJsdocOptions.ts
|
|
4770
4732
|
const requireJsdocOptions = {
|
|
@@ -4775,7 +4737,6 @@ const requireJsdocOptions = {
|
|
|
4775
4737
|
MethodDefinition: true
|
|
4776
4738
|
}
|
|
4777
4739
|
};
|
|
4778
|
-
|
|
4779
4740
|
//#endregion
|
|
4780
4741
|
//#region src/configs/internal/jsdoc.ts
|
|
4781
4742
|
const internalJsdoc = [eslint_plugin_jsdoc.default.configs["flat/recommended-typescript-error"], { rules: {
|
|
@@ -4802,7 +4763,6 @@ const internalJsdoc = [eslint_plugin_jsdoc.default.configs["flat/recommended-typ
|
|
|
4802
4763
|
{ startLines: 1 }
|
|
4803
4764
|
]
|
|
4804
4765
|
} }];
|
|
4805
|
-
|
|
4806
4766
|
//#endregion
|
|
4807
4767
|
//#region src/configs/internal/components.ts
|
|
4808
4768
|
const internalComponents = [...internalJsdoc, { rules: {
|
|
@@ -4811,7 +4771,6 @@ const internalComponents = [...internalJsdoc, { rules: {
|
|
|
4811
4771
|
"jsdoc/require-returns": "off",
|
|
4812
4772
|
"jsdoc/require-tags": "off"
|
|
4813
4773
|
} }];
|
|
4814
|
-
|
|
4815
4774
|
//#endregion
|
|
4816
4775
|
//#region src/configs/helpers/restrictedImports/neurosongsBackEndRestrictedImports.ts
|
|
4817
4776
|
const neurosongsBackEndRestrictedImports = combineRestrictedImports(personalRestrictedImports, { paths: [
|
|
@@ -4830,7 +4789,6 @@ const neurosongsBackEndRestrictedImports = combineRestrictedImports(personalRest
|
|
|
4830
4789
|
name: "@neurosongs/prisma-client/prisma"
|
|
4831
4790
|
}
|
|
4832
4791
|
] });
|
|
4833
|
-
|
|
4834
4792
|
//#endregion
|
|
4835
4793
|
//#region src/configs/internal/neurosongsBackEnd.ts
|
|
4836
4794
|
const internalNeurosongsBackEnd = [
|
|
@@ -4855,7 +4813,6 @@ const internalNeurosongsBackEnd = [
|
|
|
4855
4813
|
] }
|
|
4856
4814
|
}
|
|
4857
4815
|
];
|
|
4858
|
-
|
|
4859
4816
|
//#endregion
|
|
4860
4817
|
//#region src/configs/helpers/restrictedImports/neurosongsFrontEndRestrictedImports.ts
|
|
4861
4818
|
const neurosongsFrontEndRestrictedImports = combineRestrictedImports(personalRestrictedImports, reactRestrictedImports, {
|
|
@@ -4875,7 +4832,6 @@ const neurosongsFrontEndRestrictedImports = combineRestrictedImports(personalRes
|
|
|
4875
4832
|
message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead."
|
|
4876
4833
|
}]
|
|
4877
4834
|
});
|
|
4878
|
-
|
|
4879
4835
|
//#endregion
|
|
4880
4836
|
//#region src/configs/internal/neurosongsFrontEnd.ts
|
|
4881
4837
|
const internalNeurosongsFrontEnd = [{
|
|
@@ -4886,7 +4842,6 @@ const internalNeurosongsFrontEnd = [{
|
|
|
4886
4842
|
"no-restricted-imports": ["error", neurosongsFrontEndRestrictedImports]
|
|
4887
4843
|
}
|
|
4888
4844
|
}];
|
|
4889
|
-
|
|
4890
4845
|
//#endregion
|
|
4891
4846
|
//#region src/configs/internal/typeScript.ts
|
|
4892
4847
|
function internalTypeScript(plugin) {
|
|
@@ -4896,7 +4851,8 @@ function internalTypeScript(plugin) {
|
|
|
4896
4851
|
name: "@alextheman/internal/typescript",
|
|
4897
4852
|
plugins: {
|
|
4898
4853
|
"@alextheman": plugin,
|
|
4899
|
-
"@typescript-eslint": typescript_eslint.default.plugin
|
|
4854
|
+
"@typescript-eslint": typescript_eslint.default.plugin,
|
|
4855
|
+
"import-x": eslint_plugin_import_x.default
|
|
4900
4856
|
},
|
|
4901
4857
|
rules: {
|
|
4902
4858
|
"@alextheman/standardise-error-messages": "off",
|
|
@@ -4906,11 +4862,16 @@ function internalTypeScript(plugin) {
|
|
|
4906
4862
|
"@typescript-eslint/dot-notation": "error",
|
|
4907
4863
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
4908
4864
|
"@typescript-eslint/no-explicit-any": "off",
|
|
4909
|
-
"@typescript-eslint/no-redeclare": "off"
|
|
4910
|
-
|
|
4865
|
+
"@typescript-eslint/no-redeclare": "off",
|
|
4866
|
+
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
|
4867
|
+
},
|
|
4868
|
+
settings: { "import-x/resolver": {
|
|
4869
|
+
name: "tsResolver",
|
|
4870
|
+
options: { node: true },
|
|
4871
|
+
resolver: eslint_import_resolver_typescript
|
|
4872
|
+
} }
|
|
4911
4873
|
}];
|
|
4912
4874
|
}
|
|
4913
|
-
|
|
4914
4875
|
//#endregion
|
|
4915
4876
|
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
4916
4877
|
const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
|
|
@@ -4936,7 +4897,6 @@ const eslintPluginRestrictedImports = combineRestrictedImports(generalRestricted
|
|
|
4936
4897
|
name: "eslint-vitest-rule-tester"
|
|
4937
4898
|
}
|
|
4938
4899
|
] });
|
|
4939
|
-
|
|
4940
4900
|
//#endregion
|
|
4941
4901
|
//#region src/configs/internal/eslintPlugin/base.ts
|
|
4942
4902
|
function internalEslintPluginBase(plugin) {
|
|
@@ -4953,7 +4913,6 @@ function internalEslintPluginBase(plugin) {
|
|
|
4953
4913
|
}
|
|
4954
4914
|
}];
|
|
4955
4915
|
}
|
|
4956
|
-
|
|
4957
4916
|
//#endregion
|
|
4958
4917
|
//#region src/configs/internal/eslintPlugin/configs.ts
|
|
4959
4918
|
function internalEslintPluginConfigs(plugin) {
|
|
@@ -4964,7 +4923,6 @@ function internalEslintPluginConfigs(plugin) {
|
|
|
4964
4923
|
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
4965
4924
|
}];
|
|
4966
4925
|
}
|
|
4967
|
-
|
|
4968
4926
|
//#endregion
|
|
4969
4927
|
//#region src/configs/internal/eslintPlugin/rules.ts
|
|
4970
4928
|
function internalEslintPluginRules(plugin) {
|
|
@@ -4975,7 +4933,6 @@ function internalEslintPluginRules(plugin) {
|
|
|
4975
4933
|
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
4976
4934
|
}];
|
|
4977
4935
|
}
|
|
4978
|
-
|
|
4979
4936
|
//#endregion
|
|
4980
4937
|
//#region src/configs/internal/eslintPlugin/utility.ts
|
|
4981
4938
|
function internalEslintPluginUtility(plugin) {
|
|
@@ -4985,7 +4942,6 @@ function internalEslintPluginUtility(plugin) {
|
|
|
4985
4942
|
rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions] }
|
|
4986
4943
|
}];
|
|
4987
4944
|
}
|
|
4988
|
-
|
|
4989
4945
|
//#endregion
|
|
4990
4946
|
//#region src/configs/internal/utility/base.ts
|
|
4991
4947
|
function internalUtilityBase(plugin) {
|
|
@@ -5001,13 +4957,11 @@ function internalUtilityBase(plugin) {
|
|
|
5001
4957
|
}
|
|
5002
4958
|
}];
|
|
5003
4959
|
}
|
|
5004
|
-
|
|
5005
4960
|
//#endregion
|
|
5006
4961
|
//#region src/configs/internal/utility/internal.ts
|
|
5007
4962
|
function internalUtilityRoot$1(plugin) {
|
|
5008
4963
|
return [...internalUtilityBase(plugin), { rules: { "jsdoc/require-jsdoc": "off" } }];
|
|
5009
4964
|
}
|
|
5010
|
-
|
|
5011
4965
|
//#endregion
|
|
5012
4966
|
//#region src/configs/internal/utility/root.ts
|
|
5013
4967
|
function internalUtilityRoot(plugin) {
|
|
@@ -5016,7 +4970,6 @@ function internalUtilityRoot(plugin) {
|
|
|
5016
4970
|
message: "Do not import node builtins from the root of utility. Please either refactor the usage so that the node builtin is not needed, or move this over to the \"@alextheman/utility/node\" entrypoint."
|
|
5017
4971
|
}] })] } }];
|
|
5018
4972
|
}
|
|
5019
|
-
|
|
5020
4973
|
//#endregion
|
|
5021
4974
|
//#region src/configs/combined/typeScript.ts
|
|
5022
4975
|
function combinedTypeScript(plugin) {
|
|
@@ -5028,7 +4981,6 @@ function combinedTypeScript(plugin) {
|
|
|
5028
4981
|
...internalTypeScript(plugin)
|
|
5029
4982
|
];
|
|
5030
4983
|
}
|
|
5031
|
-
|
|
5032
4984
|
//#endregion
|
|
5033
4985
|
//#region src/configs/combined/typeScriptPackage.ts
|
|
5034
4986
|
function combinedTypeScriptPackage(plugin) {
|
|
@@ -5038,7 +4990,6 @@ function combinedTypeScriptPackage(plugin) {
|
|
|
5038
4990
|
...internalJsdoc
|
|
5039
4991
|
];
|
|
5040
4992
|
}
|
|
5041
|
-
|
|
5042
4993
|
//#endregion
|
|
5043
4994
|
//#region src/configs/combined/typeScriptReact.ts
|
|
5044
4995
|
function combinedTypeScriptReact(plugin) {
|
|
@@ -5048,7 +4999,6 @@ function combinedTypeScriptReact(plugin) {
|
|
|
5048
4999
|
...combinedReact
|
|
5049
5000
|
];
|
|
5050
5001
|
}
|
|
5051
|
-
|
|
5052
5002
|
//#endregion
|
|
5053
5003
|
//#region src/configs/internal/packageJson.ts
|
|
5054
5004
|
const internalPackageJson = [...generalPackageJson, {
|
|
@@ -5058,7 +5008,6 @@ const internalPackageJson = [...generalPackageJson, {
|
|
|
5058
5008
|
rangeType: "pin"
|
|
5059
5009
|
}] }
|
|
5060
5010
|
}];
|
|
5061
|
-
|
|
5062
5011
|
//#endregion
|
|
5063
5012
|
//#region src/configs/index.ts
|
|
5064
5013
|
function createAlexPluginConfigs(plugin) {
|
|
@@ -5103,13 +5052,11 @@ function createAlexPluginConfigs(plugin) {
|
|
|
5103
5052
|
}
|
|
5104
5053
|
});
|
|
5105
5054
|
}
|
|
5106
|
-
|
|
5107
5055
|
//#endregion
|
|
5108
5056
|
//#region src/rules/helpers/createRule.ts
|
|
5109
5057
|
const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator((ruleName) => {
|
|
5110
5058
|
return ruleName;
|
|
5111
5059
|
});
|
|
5112
|
-
|
|
5113
5060
|
//#endregion
|
|
5114
5061
|
//#region src/rules/consistent-test-function.ts
|
|
5115
5062
|
const validTestFunctionsSchema = zod.default.enum(["test", "it"]);
|
|
@@ -5203,7 +5150,6 @@ const consistentTestFunction = createRule({
|
|
|
5203
5150
|
};
|
|
5204
5151
|
}
|
|
5205
5152
|
});
|
|
5206
|
-
|
|
5207
5153
|
//#endregion
|
|
5208
5154
|
//#region src/rules/has-standards.ts
|
|
5209
5155
|
const hasStandardsOptionsSchema = zod.default.object({ fixable: zod.default.boolean() }).partial();
|
|
@@ -5242,7 +5188,6 @@ const hasStandards = createRule({
|
|
|
5242
5188
|
} };
|
|
5243
5189
|
}
|
|
5244
5190
|
});
|
|
5245
|
-
|
|
5246
5191
|
//#endregion
|
|
5247
5192
|
//#region src/rules/no-isolated-tests.ts
|
|
5248
5193
|
const noIsolatedTests = createRule({
|
|
@@ -5264,7 +5209,6 @@ const noIsolatedTests = createRule({
|
|
|
5264
5209
|
} };
|
|
5265
5210
|
}
|
|
5266
5211
|
});
|
|
5267
|
-
|
|
5268
5212
|
//#endregion
|
|
5269
5213
|
//#region src/rules/no-namespace-imports.ts
|
|
5270
5214
|
const noNamespaceImportsOptionsSchema = zod.default.object({ allow: zod.default.array(zod.default.string()) }).partial();
|
|
@@ -5295,7 +5239,6 @@ const noNamespaceImports = createRule({
|
|
|
5295
5239
|
} };
|
|
5296
5240
|
}
|
|
5297
5241
|
});
|
|
5298
|
-
|
|
5299
5242
|
//#endregion
|
|
5300
5243
|
//#region src/rules/no-plugin-configs-access-from-src-configs.ts
|
|
5301
5244
|
const noPluginConfigAccessFromSrcConfigs = createRule({
|
|
@@ -5319,7 +5262,6 @@ const noPluginConfigAccessFromSrcConfigs = createRule({
|
|
|
5319
5262
|
} };
|
|
5320
5263
|
}
|
|
5321
5264
|
});
|
|
5322
|
-
|
|
5323
5265
|
//#endregion
|
|
5324
5266
|
//#region src/rules/no-relative-imports.ts
|
|
5325
5267
|
const noRelativeImportsOptionsSchema = zod.default.object({ depth: zod.default.int().nonnegative() }).partial();
|
|
@@ -5386,7 +5328,6 @@ const noRelativeImports = createRule({
|
|
|
5386
5328
|
} };
|
|
5387
5329
|
}
|
|
5388
5330
|
});
|
|
5389
|
-
|
|
5390
5331
|
//#endregion
|
|
5391
5332
|
//#region src/rules/no-skipped-tests.ts
|
|
5392
5333
|
const noSkippedTests = createRule({
|
|
@@ -5408,7 +5349,6 @@ const noSkippedTests = createRule({
|
|
|
5408
5349
|
} };
|
|
5409
5350
|
}
|
|
5410
5351
|
});
|
|
5411
|
-
|
|
5412
5352
|
//#endregion
|
|
5413
5353
|
//#region src/rules/standardise-error-messages.ts
|
|
5414
5354
|
const standardiseErrorMessagesOptionsSchema = zod.default.object({ regex: zod.default.string() }).partial();
|
|
@@ -5452,7 +5392,6 @@ const standardiseErrorMessages = createRule({
|
|
|
5452
5392
|
};
|
|
5453
5393
|
}
|
|
5454
5394
|
});
|
|
5455
|
-
|
|
5456
5395
|
//#endregion
|
|
5457
5396
|
//#region src/rules/use-normalized-imports.ts
|
|
5458
5397
|
const useNormalizedImportsOptionsSchema = zod.default.object({ fixable: zod.default.boolean() }).partial();
|
|
@@ -5488,7 +5427,6 @@ const useNormalizedImports = createRule({
|
|
|
5488
5427
|
} };
|
|
5489
5428
|
}
|
|
5490
5429
|
});
|
|
5491
|
-
|
|
5492
5430
|
//#endregion
|
|
5493
5431
|
//#region src/rules/use-object-shorthand.ts
|
|
5494
5432
|
const useObjectShorthandOptionsSchema = zod.default.object({ fixable: zod.default.boolean() }).partial();
|
|
@@ -5520,69 +5458,32 @@ const useObjectShorthand = createRule({
|
|
|
5520
5458
|
} };
|
|
5521
5459
|
}
|
|
5522
5460
|
});
|
|
5523
|
-
|
|
5524
|
-
//#endregion
|
|
5525
|
-
//#region src/rules/index.ts
|
|
5526
|
-
var rules_default = {
|
|
5527
|
-
"consistent-test-function": consistentTestFunction,
|
|
5528
|
-
"has-standards": hasStandards,
|
|
5529
|
-
"no-isolated-tests": noIsolatedTests,
|
|
5530
|
-
"no-namespace-imports": noNamespaceImports,
|
|
5531
|
-
"no-plugin-configs-access-from-src-configs": noPluginConfigAccessFromSrcConfigs,
|
|
5532
|
-
"no-relative-imports": noRelativeImports,
|
|
5533
|
-
"no-skipped-tests": noSkippedTests,
|
|
5534
|
-
"standardise-error-messages": standardiseErrorMessages,
|
|
5535
|
-
"use-normalized-imports": useNormalizedImports,
|
|
5536
|
-
"use-object-shorthand": useObjectShorthand
|
|
5537
|
-
};
|
|
5538
|
-
|
|
5539
|
-
//#endregion
|
|
5540
|
-
//#region package.json
|
|
5541
|
-
var name = "@alextheman/eslint-plugin";
|
|
5542
|
-
var version = "5.12.0";
|
|
5543
|
-
|
|
5544
5461
|
//#endregion
|
|
5545
5462
|
//#region src/alexPlugin.ts
|
|
5546
5463
|
const alexPlugin = {
|
|
5547
5464
|
meta: {
|
|
5548
|
-
name,
|
|
5549
|
-
version,
|
|
5465
|
+
name: "@alextheman/eslint-plugin",
|
|
5466
|
+
version: "5.13.0",
|
|
5550
5467
|
namespace: "alextheman"
|
|
5551
5468
|
},
|
|
5552
5469
|
configs: {},
|
|
5553
|
-
rules:
|
|
5470
|
+
rules: {
|
|
5471
|
+
"consistent-test-function": consistentTestFunction,
|
|
5472
|
+
"has-standards": hasStandards,
|
|
5473
|
+
"no-isolated-tests": noIsolatedTests,
|
|
5474
|
+
"no-namespace-imports": noNamespaceImports,
|
|
5475
|
+
"no-plugin-configs-access-from-src-configs": noPluginConfigAccessFromSrcConfigs,
|
|
5476
|
+
"no-relative-imports": noRelativeImports,
|
|
5477
|
+
"no-skipped-tests": noSkippedTests,
|
|
5478
|
+
"standardise-error-messages": standardiseErrorMessages,
|
|
5479
|
+
"use-normalized-imports": useNormalizedImports,
|
|
5480
|
+
"use-object-shorthand": useObjectShorthand
|
|
5481
|
+
}
|
|
5554
5482
|
};
|
|
5555
5483
|
alexPlugin.configs = createAlexPluginConfigs((0, _alextheman_utility.deepFreeze)((0, _alextheman_utility.deepCopy)(alexPlugin)));
|
|
5556
|
-
|
|
5557
|
-
//#endregion
|
|
5558
|
-
//#region src/configs/external/typeDocConfig.ts
|
|
5559
|
-
function typeDocConfig(entryPoints = ["./src/index.ts"]) {
|
|
5560
|
-
return {
|
|
5561
|
-
disableSources: true,
|
|
5562
|
-
entryPoints,
|
|
5563
|
-
excludeNotDocumented: true,
|
|
5564
|
-
includeVersion: true,
|
|
5565
|
-
outputs: [{
|
|
5566
|
-
name: "html",
|
|
5567
|
-
options: { navigation: {
|
|
5568
|
-
excludeReferences: false,
|
|
5569
|
-
includeCategories: true,
|
|
5570
|
-
includeFolders: true,
|
|
5571
|
-
includeGroups: true
|
|
5572
|
-
} },
|
|
5573
|
-
path: "docs/features/html"
|
|
5574
|
-
}, {
|
|
5575
|
-
name: "markdown",
|
|
5576
|
-
path: "docs/features/markdown"
|
|
5577
|
-
}],
|
|
5578
|
-
plugin: ["typedoc-plugin-markdown", "typedoc-rhineai-theme"]
|
|
5579
|
-
};
|
|
5580
|
-
}
|
|
5581
|
-
|
|
5582
5484
|
//#endregion
|
|
5583
5485
|
//#region src/index.ts
|
|
5584
5486
|
var src_default = alexPlugin;
|
|
5585
|
-
|
|
5586
5487
|
//#endregion
|
|
5587
5488
|
exports.checkCallExpression = checkCallExpression;
|
|
5588
5489
|
exports.combineRestrictedImports = combineRestrictedImports;
|
|
@@ -5592,4 +5493,3 @@ exports.fixOnCondition = fixOnCondition;
|
|
|
5592
5493
|
exports.flattenConfigs = flattenConfigs;
|
|
5593
5494
|
exports.getImportSpecifiersAfterRemoving = getImportSpecifiersAfterRemoving;
|
|
5594
5495
|
exports.prettierConfig = prettierConfig;
|
|
5595
|
-
exports.typeDocConfig = typeDocConfig;
|