@alextheman/eslint-plugin 5.12.0 → 5.13.1

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 CHANGED
@@ -1,4 +1,7 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
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;
@@ -6,18 +9,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
9
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
10
  var __getProtoOf = Object.getPrototypeOf;
8
11
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
12
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
13
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
- key = keys[i];
14
- if (!__hasOwnProp.call(to, key) && key !== except) {
15
- __defProp(to, key, {
16
- get: ((k) => from[k]).bind(null, key),
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,41 +24,42 @@ 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");
32
30
  let zod = require("zod");
33
- zod = __toESM(zod);
31
+ zod = __toESM(zod, 1);
32
+ let _alextheman_utility_v6 = require("@alextheman/utility/v6");
34
33
  let _eslint_js = require("@eslint/js");
35
- _eslint_js = __toESM(_eslint_js);
34
+ _eslint_js = __toESM(_eslint_js, 1);
36
35
  let eslint_config_prettier = require("eslint-config-prettier");
37
- eslint_config_prettier = __toESM(eslint_config_prettier);
38
- let eslint_plugin_import = require("eslint-plugin-import");
39
- eslint_plugin_import = __toESM(eslint_plugin_import);
36
+ eslint_config_prettier = __toESM(eslint_config_prettier, 1);
37
+ let eslint_import_resolver_typescript = require("eslint-import-resolver-typescript");
38
+ eslint_import_resolver_typescript = __toESM(eslint_import_resolver_typescript, 1);
39
+ let eslint_plugin_import_x = require("eslint-plugin-import-x");
40
+ eslint_plugin_import_x = __toESM(eslint_plugin_import_x, 1);
40
41
  let eslint_plugin_n = require("eslint-plugin-n");
41
- eslint_plugin_n = __toESM(eslint_plugin_n);
42
+ eslint_plugin_n = __toESM(eslint_plugin_n, 1);
42
43
  let eslint_plugin_perfectionist = require("eslint-plugin-perfectionist");
43
- eslint_plugin_perfectionist = __toESM(eslint_plugin_perfectionist);
44
+ eslint_plugin_perfectionist = __toESM(eslint_plugin_perfectionist, 1);
44
45
  let eslint_plugin_prettier = require("eslint-plugin-prettier");
45
- eslint_plugin_prettier = __toESM(eslint_plugin_prettier);
46
+ eslint_plugin_prettier = __toESM(eslint_plugin_prettier, 1);
46
47
  let typescript_eslint = require("typescript-eslint");
47
- typescript_eslint = __toESM(typescript_eslint);
48
+ typescript_eslint = __toESM(typescript_eslint, 1);
48
49
  let eslint_plugin_jsx_a11y = require("eslint-plugin-jsx-a11y");
49
- eslint_plugin_jsx_a11y = __toESM(eslint_plugin_jsx_a11y);
50
+ eslint_plugin_jsx_a11y = __toESM(eslint_plugin_jsx_a11y, 1);
50
51
  let eslint_plugin_react = require("eslint-plugin-react");
51
- eslint_plugin_react = __toESM(eslint_plugin_react);
52
+ eslint_plugin_react = __toESM(eslint_plugin_react, 1);
52
53
  let eslint_plugin_react_refresh = require("eslint-plugin-react-refresh");
53
- eslint_plugin_react_refresh = __toESM(eslint_plugin_react_refresh);
54
+ eslint_plugin_react_refresh = __toESM(eslint_plugin_react_refresh, 1);
54
55
  let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
55
- eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks);
56
+ eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks, 1);
56
57
  let eslint_plugin_package_json = require("eslint-plugin-package-json");
57
- eslint_plugin_package_json = __toESM(eslint_plugin_package_json);
58
+ eslint_plugin_package_json = __toESM(eslint_plugin_package_json, 1);
58
59
  let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
59
- eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc);
60
+ eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc, 1);
60
61
  let _alextheman_utility_node = require("@alextheman/utility/node");
61
-
62
- //#region node_modules/.pnpm/globals@17.4.0/node_modules/globals/globals.json
62
+ //#region node_modules/.pnpm/globals@17.5.0/node_modules/globals/globals.json
63
63
  var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
64
64
  module.exports = {
65
65
  "amd": {
@@ -165,6 +165,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
165
165
  "AudioNode": false,
166
166
  "AudioParam": false,
167
167
  "AudioParamMap": false,
168
+ "AudioPlaybackStats": false,
168
169
  "AudioProcessingEvent": false,
169
170
  "AudioScheduledSourceNode": false,
170
171
  "AudioSinkInfo": false,
@@ -956,6 +957,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
956
957
  "RTCSessionDescription": false,
957
958
  "RTCStatsReport": false,
958
959
  "RTCTrackEvent": false,
960
+ "Sanitizer": false,
959
961
  "scheduler": false,
960
962
  "Scheduler": false,
961
963
  "Scheduling": false,
@@ -1157,6 +1159,9 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1157
1159
  "TextTrackList": false,
1158
1160
  "TextUpdateEvent": false,
1159
1161
  "TimeEvent": false,
1162
+ "TimelineTrigger": false,
1163
+ "TimelineTriggerRange": false,
1164
+ "TimelineTriggerRangeList": false,
1160
1165
  "TimeRanges": false,
1161
1166
  "ToggleEvent": false,
1162
1167
  "toolbar": false,
@@ -1602,6 +1607,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1602
1607
  "PromiseRejectionEvent": false,
1603
1608
  "prompt": false,
1604
1609
  "queueMicrotask": false,
1610
+ "QuotaExceededError": false,
1605
1611
  "ReadableByteStreamController": false,
1606
1612
  "ReadableStream": false,
1607
1613
  "ReadableStreamBYOBReader": false,
@@ -2392,6 +2398,70 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2392
2398
  "WeakRef": false,
2393
2399
  "WeakSet": false
2394
2400
  },
2401
+ "es2027": {
2402
+ "AggregateError": false,
2403
+ "Array": false,
2404
+ "ArrayBuffer": false,
2405
+ "Atomics": false,
2406
+ "BigInt": false,
2407
+ "BigInt64Array": false,
2408
+ "BigUint64Array": false,
2409
+ "Boolean": false,
2410
+ "DataView": false,
2411
+ "Date": false,
2412
+ "decodeURI": false,
2413
+ "decodeURIComponent": false,
2414
+ "encodeURI": false,
2415
+ "encodeURIComponent": false,
2416
+ "Error": false,
2417
+ "escape": false,
2418
+ "eval": false,
2419
+ "EvalError": false,
2420
+ "FinalizationRegistry": false,
2421
+ "Float16Array": false,
2422
+ "Float32Array": false,
2423
+ "Float64Array": false,
2424
+ "Function": false,
2425
+ "globalThis": false,
2426
+ "Infinity": false,
2427
+ "Int16Array": false,
2428
+ "Int32Array": false,
2429
+ "Int8Array": false,
2430
+ "Intl": false,
2431
+ "isFinite": false,
2432
+ "isNaN": false,
2433
+ "Iterator": false,
2434
+ "JSON": false,
2435
+ "Map": false,
2436
+ "Math": false,
2437
+ "NaN": false,
2438
+ "Number": false,
2439
+ "Object": false,
2440
+ "parseFloat": false,
2441
+ "parseInt": false,
2442
+ "Promise": false,
2443
+ "Proxy": false,
2444
+ "RangeError": false,
2445
+ "ReferenceError": false,
2446
+ "Reflect": false,
2447
+ "RegExp": false,
2448
+ "Set": false,
2449
+ "SharedArrayBuffer": false,
2450
+ "String": false,
2451
+ "Symbol": false,
2452
+ "SyntaxError": false,
2453
+ "TypeError": false,
2454
+ "Uint16Array": false,
2455
+ "Uint32Array": false,
2456
+ "Uint8Array": false,
2457
+ "Uint8ClampedArray": false,
2458
+ "undefined": false,
2459
+ "unescape": false,
2460
+ "URIError": false,
2461
+ "WeakMap": false,
2462
+ "WeakRef": false,
2463
+ "WeakSet": false
2464
+ },
2395
2465
  "es3": {
2396
2466
  "Array": false,
2397
2467
  "Boolean": false,
@@ -4083,20 +4153,17 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4083
4153
  }
4084
4154
  };
4085
4155
  }));
4086
-
4087
4156
  //#endregion
4088
- //#region node_modules/.pnpm/globals@17.4.0/node_modules/globals/index.js
4157
+ //#region node_modules/.pnpm/globals@17.5.0/node_modules/globals/index.js
4089
4158
  var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4090
4159
  module.exports = require_globals$1();
4091
4160
  }));
4092
-
4093
4161
  //#endregion
4094
4162
  //#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
4095
4163
  const generalRestrictedImports = { patterns: [{
4096
4164
  group: ["node_modules"],
4097
4165
  message: "Do not import directly from node_modules."
4098
4166
  }] };
4099
-
4100
4167
  //#endregion
4101
4168
  //#region src/utility/public/checkCallExpression.ts
4102
4169
  /**
@@ -4113,7 +4180,6 @@ const generalRestrictedImports = { patterns: [{
4113
4180
  function checkCallExpression(node, objectName, propertyName) {
4114
4181
  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
4182
  }
4116
-
4117
4183
  //#endregion
4118
4184
  //#region src/utility/public/combineRestrictedImports.ts
4119
4185
  /**
@@ -4140,7 +4206,6 @@ function combineRestrictedImports(...groups) {
4140
4206
  if (combinedGroup.patterns.length === 0) return (0, _alextheman_utility.omitProperties)(combinedGroup, "patterns");
4141
4207
  return combinedGroup;
4142
4208
  }
4143
-
4144
4209
  //#endregion
4145
4210
  //#region src/utility/public/createRuleSchemaFromZodSchema.ts
4146
4211
  /**
@@ -4155,7 +4220,6 @@ function combineRestrictedImports(...groups) {
4155
4220
  function createRuleSchemaFromZodSchema(schema) {
4156
4221
  return [(0, _alextheman_utility.omitProperties)(zod.default.toJSONSchema(schema), "$schema")];
4157
4222
  }
4158
-
4159
4223
  //#endregion
4160
4224
  //#region src/utility/public/fixOnCondition.ts
4161
4225
  /**
@@ -4174,14 +4238,12 @@ function fixOnCondition(fixable, fix) {
4174
4238
  return fix(fixer);
4175
4239
  };
4176
4240
  }
4177
-
4178
4241
  //#endregion
4179
4242
  //#region src/utility/private/camelToKebab.ts
4180
4243
  function camelToKebab(string) {
4181
- 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.");
4244
+ 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.");
4182
4245
  return (0, _alextheman_utility.camelToKebab)(string, { preserveConsecutiveCapitals: false });
4183
4246
  }
4184
-
4185
4247
  //#endregion
4186
4248
  //#region src/utility/private/createConfigGroup.ts
4187
4249
  function createConfigGroup(group, configs) {
@@ -4189,7 +4251,6 @@ function createConfigGroup(group, configs) {
4189
4251
  for (const key in configs) newConfigs[`${camelToKebab(group)}/${camelToKebab(key)}`] = configs[key];
4190
4252
  return newConfigs;
4191
4253
  }
4192
-
4193
4254
  //#endregion
4194
4255
  //#region src/utility/public/flattenConfigs.ts
4195
4256
  /**
@@ -4234,7 +4295,6 @@ function flattenConfigs(config) {
4234
4295
  for (const configGroupEntries of Object.entries(config)) Object.assign(allConfigs, createConfigGroup(...configGroupEntries));
4235
4296
  return allConfigs;
4236
4297
  }
4237
-
4238
4298
  //#endregion
4239
4299
  //#region src/utility/public/getImportSpecifiersAfterRemoving.ts
4240
4300
  /**
@@ -4259,14 +4319,12 @@ function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
4259
4319
  return context.sourceCode.getText(specifier);
4260
4320
  }).join(", ");
4261
4321
  }
4262
-
4263
4322
  //#endregion
4264
4323
  //#region src/configs/helpers/restrictedImports/testsRestrictedImports.ts
4265
4324
  const testsRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [{
4266
4325
  message: "Use test functions from vitest instead.",
4267
4326
  name: "node:test"
4268
4327
  }] });
4269
-
4270
4328
  //#endregion
4271
4329
  //#region src/configs/internal/tests.ts
4272
4330
  var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
@@ -4297,7 +4355,6 @@ const internalTests = [{
4297
4355
  "no-restricted-imports": ["error", testsRestrictedImports]
4298
4356
  }
4299
4357
  }];
4300
-
4301
4358
  //#endregion
4302
4359
  //#region src/configs/plugin/base.ts
4303
4360
  function pluginBase(plugin) {
@@ -4311,7 +4368,6 @@ function pluginBase(plugin) {
4311
4368
  }
4312
4369
  }];
4313
4370
  }
4314
-
4315
4371
  //#endregion
4316
4372
  //#region src/configs/plugin/tests.ts
4317
4373
  function pluginTests(plugin) {
@@ -4326,7 +4382,6 @@ function pluginTests(plugin) {
4326
4382
  }
4327
4383
  }];
4328
4384
  }
4329
-
4330
4385
  //#endregion
4331
4386
  //#region src/configs/combined/tests.ts
4332
4387
  function combinedTests(plugin) {
@@ -4336,7 +4391,6 @@ function combinedTests(plugin) {
4336
4391
  ...internalTests
4337
4392
  ];
4338
4393
  }
4339
-
4340
4394
  //#endregion
4341
4395
  //#region src/configs/helpers/javaScriptLanguageOptions.ts
4342
4396
  const javaScriptLanguageOptions = { globals: {
@@ -4344,7 +4398,6 @@ const javaScriptLanguageOptions = { globals: {
4344
4398
  ...import_globals.default.browser,
4345
4399
  ...import_globals.default.vitest
4346
4400
  } };
4347
-
4348
4401
  //#endregion
4349
4402
  //#region src/configs/helpers/unusedVarsIgnorePatterns.ts
4350
4403
  const unusedVarsIgnorePatterns = {
@@ -4352,7 +4405,6 @@ const unusedVarsIgnorePatterns = {
4352
4405
  caughtErrorsIgnorePattern: "^_",
4353
4406
  varsIgnorePattern: "^_"
4354
4407
  };
4355
-
4356
4408
  //#endregion
4357
4409
  //#region src/configs/general/javaScript.ts
4358
4410
  const generalJavaScript = [
@@ -4370,13 +4422,13 @@ const generalJavaScript = [
4370
4422
  languageOptions: javaScriptLanguageOptions,
4371
4423
  name: "@alextheman/general/javascript",
4372
4424
  plugins: {
4373
- import: eslint_plugin_import.default,
4425
+ "import-x": eslint_plugin_import_x.default,
4374
4426
  n: eslint_plugin_n.default
4375
4427
  },
4376
4428
  rules: {
4377
4429
  eqeqeq: "error",
4378
- "import/no-duplicates": ["error", { "prefer-inline": false }],
4379
- "import/no-unresolved": "error",
4430
+ "import-x/no-duplicates": ["error", { "prefer-inline": false }],
4431
+ "import-x/no-unresolved": "error",
4380
4432
  "n/file-extension-in-import": [
4381
4433
  "error",
4382
4434
  "always",
@@ -4408,14 +4460,16 @@ const generalJavaScript = [
4408
4460
  "no-useless-return": "error",
4409
4461
  "prefer-const": "error"
4410
4462
  },
4411
- settings: { "import/resolver": { node: true } }
4463
+ settings: { "import-x/resolver": {
4464
+ name: "tsResolver",
4465
+ options: { node: true },
4466
+ resolver: eslint_import_resolver_typescript
4467
+ } }
4412
4468
  }
4413
4469
  ];
4414
-
4415
4470
  //#endregion
4416
4471
  //#region src/configs/external/prettierConfig.ts
4417
4472
  const prettierConfig = { printWidth: 100 };
4418
-
4419
4473
  //#endregion
4420
4474
  //#region src/configs/helpers/reactLanguageOptions.ts
4421
4475
  const reactLanguageOptions = {
@@ -4423,7 +4477,6 @@ const reactLanguageOptions = {
4423
4477
  globals: import_globals.default.browser,
4424
4478
  parserOptions: { ecmaFeatures: { jsx: true } }
4425
4479
  };
4426
-
4427
4480
  //#endregion
4428
4481
  //#region src/configs/helpers/typeScriptLanguageOptions.ts
4429
4482
  const typeScriptLanguageOptions = {
@@ -4435,7 +4488,6 @@ const typeScriptLanguageOptions = {
4435
4488
  tsconfigRootDir: process.cwd()
4436
4489
  }
4437
4490
  };
4438
-
4439
4491
  //#endregion
4440
4492
  //#region src/configs/helpers/sorting/sortClasses.ts
4441
4493
  const sortClasses = {
@@ -4462,7 +4514,6 @@ const sortClasses = {
4462
4514
  specialCharacters: "keep",
4463
4515
  type: "alphabetical"
4464
4516
  };
4465
-
4466
4517
  //#endregion
4467
4518
  //#region src/configs/helpers/sorting/sortExports.ts
4468
4519
  const sortExports = {
@@ -4482,7 +4533,6 @@ const sortExports = {
4482
4533
  specialCharacters: "keep",
4483
4534
  type: "alphabetical"
4484
4535
  };
4485
-
4486
4536
  //#endregion
4487
4537
  //#region src/configs/helpers/sorting/sortImports.ts
4488
4538
  const sortImports = {
@@ -4521,7 +4571,6 @@ const sortImports = {
4521
4571
  specialCharacters: "keep",
4522
4572
  type: "alphabetical"
4523
4573
  };
4524
-
4525
4574
  //#endregion
4526
4575
  //#region src/configs/helpers/sorting/sortObjects.ts
4527
4576
  const sortObjects = {
@@ -4538,7 +4587,6 @@ const sortObjects = {
4538
4587
  type: "alphabetical",
4539
4588
  useConfigurationIf: {}
4540
4589
  };
4541
-
4542
4590
  //#endregion
4543
4591
  //#region src/configs/helpers/restrictedImports/personalRestrictedImports.ts
4544
4592
  const personalRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [...["fs", "node:fs"].map((name) => {
@@ -4547,7 +4595,6 @@ const personalRestrictedImports = combineRestrictedImports(generalRestrictedImpo
4547
4595
  name
4548
4596
  };
4549
4597
  })] });
4550
-
4551
4598
  //#endregion
4552
4599
  //#region src/configs/helpers/sorting/sortNamedImports.ts
4553
4600
  const sortNamedImports = {
@@ -4562,7 +4609,6 @@ const sortNamedImports = {
4562
4609
  specialCharacters: "keep",
4563
4610
  type: "alphabetical"
4564
4611
  };
4565
-
4566
4612
  //#endregion
4567
4613
  //#region src/configs/internal/javaScript.ts
4568
4614
  function internalJavaScript(plugin) {
@@ -4577,7 +4623,6 @@ function internalJavaScript(plugin) {
4577
4623
  name: "@alextheman/internal/javascript",
4578
4624
  plugins: {
4579
4625
  "@alextheman": plugin,
4580
- import: eslint_plugin_import.default,
4581
4626
  n: eslint_plugin_n.default,
4582
4627
  perfectionist: eslint_plugin_perfectionist.default,
4583
4628
  prettier: eslint_plugin_prettier.default
@@ -4591,7 +4636,6 @@ function internalJavaScript(plugin) {
4591
4636
  "declaration",
4592
4637
  { allowArrowFunctions: false }
4593
4638
  ],
4594
- "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
4595
4639
  "n/no-extraneous-import": "off",
4596
4640
  "no-else-return": "error",
4597
4641
  "no-implicit-coercion": ["error", { allow: ["!!"] }],
@@ -4612,7 +4656,6 @@ function internalJavaScript(plugin) {
4612
4656
  rules: { "@alextheman/no-relative-imports": ["error", { depth: 0 }] }
4613
4657
  }];
4614
4658
  }
4615
-
4616
4659
  //#endregion
4617
4660
  //#region src/configs/combined/javaScript.ts
4618
4661
  function combinedJavaScript(plugin) {
@@ -4624,7 +4667,6 @@ function combinedJavaScript(plugin) {
4624
4667
  ...combinedTests(plugin)
4625
4668
  ];
4626
4669
  }
4627
-
4628
4670
  //#endregion
4629
4671
  //#region src/configs/helpers/eslint-plugin-react-hooks.ts
4630
4672
  const reactHooks = {
@@ -4635,7 +4677,6 @@ const reactHooks = {
4635
4677
  "flat/recommended-latest": eslint_plugin_react_hooks.default.configs.flat["recommended-latest"]
4636
4678
  }
4637
4679
  };
4638
-
4639
4680
  //#endregion
4640
4681
  //#region src/configs/general/react.ts
4641
4682
  const generalReact = [
@@ -4670,14 +4711,12 @@ const generalReact = [
4670
4711
  settings: { react: { version: "detect" } }
4671
4712
  }
4672
4713
  ];
4673
-
4674
4714
  //#endregion
4675
4715
  //#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
4676
4716
  const reactRestrictedImports = combineRestrictedImports(generalRestrictedImports, { patterns: [{
4677
4717
  message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
4678
4718
  regex: "^@mui/[^/]+$"
4679
4719
  }] });
4680
-
4681
4720
  //#endregion
4682
4721
  //#region src/configs/internal/react.ts
4683
4722
  const internalReact = [{
@@ -4696,7 +4735,6 @@ const internalReact = [{
4696
4735
  "react/jsx-boolean-value": "error"
4697
4736
  }
4698
4737
  }];
4699
-
4700
4738
  //#endregion
4701
4739
  //#region src/configs/combined/react.ts
4702
4740
  const combinedReact = [
@@ -4704,7 +4742,6 @@ const combinedReact = [
4704
4742
  ...generalReact,
4705
4743
  ...internalReact
4706
4744
  ];
4707
-
4708
4745
  //#endregion
4709
4746
  //#region src/configs/combined/javaScriptReact.ts
4710
4747
  function combinedJavaScriptReact(plugin) {
@@ -4714,14 +4751,12 @@ function combinedJavaScriptReact(plugin) {
4714
4751
  ...combinedReact
4715
4752
  ];
4716
4753
  }
4717
-
4718
4754
  //#endregion
4719
4755
  //#region src/configs/general/packageJson.ts
4720
4756
  const generalPackageJson = [eslint_plugin_package_json.default.configs.recommended, {
4721
4757
  plugins: { "package-json": eslint_plugin_package_json.default },
4722
4758
  rules: { "package-json/scripts-name-casing": "error" }
4723
4759
  }];
4724
-
4725
4760
  //#endregion
4726
4761
  //#region src/configs/general/typeScript.ts
4727
4762
  const generalTypeScript = [
@@ -4745,7 +4780,6 @@ const generalTypeScript = [
4745
4780
  }
4746
4781
  }
4747
4782
  ];
4748
-
4749
4783
  //#endregion
4750
4784
  //#region src/configs/internal/alexCLine.ts
4751
4785
  function internalAlexCLine(plugin) {
@@ -4764,7 +4798,6 @@ function internalAlexCLine(plugin) {
4764
4798
  }
4765
4799
  ];
4766
4800
  }
4767
-
4768
4801
  //#endregion
4769
4802
  //#region src/configs/helpers/requireJsdocOptions.ts
4770
4803
  const requireJsdocOptions = {
@@ -4775,7 +4808,6 @@ const requireJsdocOptions = {
4775
4808
  MethodDefinition: true
4776
4809
  }
4777
4810
  };
4778
-
4779
4811
  //#endregion
4780
4812
  //#region src/configs/internal/jsdoc.ts
4781
4813
  const internalJsdoc = [eslint_plugin_jsdoc.default.configs["flat/recommended-typescript-error"], { rules: {
@@ -4802,7 +4834,6 @@ const internalJsdoc = [eslint_plugin_jsdoc.default.configs["flat/recommended-typ
4802
4834
  { startLines: 1 }
4803
4835
  ]
4804
4836
  } }];
4805
-
4806
4837
  //#endregion
4807
4838
  //#region src/configs/internal/components.ts
4808
4839
  const internalComponents = [...internalJsdoc, { rules: {
@@ -4811,7 +4842,6 @@ const internalComponents = [...internalJsdoc, { rules: {
4811
4842
  "jsdoc/require-returns": "off",
4812
4843
  "jsdoc/require-tags": "off"
4813
4844
  } }];
4814
-
4815
4845
  //#endregion
4816
4846
  //#region src/configs/helpers/restrictedImports/neurosongsBackEndRestrictedImports.ts
4817
4847
  const neurosongsBackEndRestrictedImports = combineRestrictedImports(personalRestrictedImports, { paths: [
@@ -4830,7 +4860,6 @@ const neurosongsBackEndRestrictedImports = combineRestrictedImports(personalRest
4830
4860
  name: "@neurosongs/prisma-client/prisma"
4831
4861
  }
4832
4862
  ] });
4833
-
4834
4863
  //#endregion
4835
4864
  //#region src/configs/internal/neurosongsBackEnd.ts
4836
4865
  const internalNeurosongsBackEnd = [
@@ -4855,7 +4884,6 @@ const internalNeurosongsBackEnd = [
4855
4884
  ] }
4856
4885
  }
4857
4886
  ];
4858
-
4859
4887
  //#endregion
4860
4888
  //#region src/configs/helpers/restrictedImports/neurosongsFrontEndRestrictedImports.ts
4861
4889
  const neurosongsFrontEndRestrictedImports = combineRestrictedImports(personalRestrictedImports, reactRestrictedImports, {
@@ -4875,7 +4903,6 @@ const neurosongsFrontEndRestrictedImports = combineRestrictedImports(personalRes
4875
4903
  message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead."
4876
4904
  }]
4877
4905
  });
4878
-
4879
4906
  //#endregion
4880
4907
  //#region src/configs/internal/neurosongsFrontEnd.ts
4881
4908
  const internalNeurosongsFrontEnd = [{
@@ -4886,7 +4913,6 @@ const internalNeurosongsFrontEnd = [{
4886
4913
  "no-restricted-imports": ["error", neurosongsFrontEndRestrictedImports]
4887
4914
  }
4888
4915
  }];
4889
-
4890
4916
  //#endregion
4891
4917
  //#region src/configs/internal/typeScript.ts
4892
4918
  function internalTypeScript(plugin) {
@@ -4896,7 +4922,8 @@ function internalTypeScript(plugin) {
4896
4922
  name: "@alextheman/internal/typescript",
4897
4923
  plugins: {
4898
4924
  "@alextheman": plugin,
4899
- "@typescript-eslint": typescript_eslint.default.plugin
4925
+ "@typescript-eslint": typescript_eslint.default.plugin,
4926
+ "import-x": eslint_plugin_import_x.default
4900
4927
  },
4901
4928
  rules: {
4902
4929
  "@alextheman/standardise-error-messages": "off",
@@ -4906,11 +4933,16 @@ function internalTypeScript(plugin) {
4906
4933
  "@typescript-eslint/dot-notation": "error",
4907
4934
  "@typescript-eslint/method-signature-style": ["error", "property"],
4908
4935
  "@typescript-eslint/no-explicit-any": "off",
4909
- "@typescript-eslint/no-redeclare": "off"
4910
- }
4936
+ "@typescript-eslint/no-redeclare": "off",
4937
+ "import-x/consistent-type-specifier-style": ["error", "prefer-top-level"]
4938
+ },
4939
+ settings: { "import-x/resolver": {
4940
+ name: "tsResolver",
4941
+ options: { node: true },
4942
+ resolver: eslint_import_resolver_typescript
4943
+ } }
4911
4944
  }];
4912
4945
  }
4913
-
4914
4946
  //#endregion
4915
4947
  //#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
4916
4948
  const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
@@ -4936,7 +4968,6 @@ const eslintPluginRestrictedImports = combineRestrictedImports(generalRestricted
4936
4968
  name: "eslint-vitest-rule-tester"
4937
4969
  }
4938
4970
  ] });
4939
-
4940
4971
  //#endregion
4941
4972
  //#region src/configs/internal/eslintPlugin/base.ts
4942
4973
  function internalEslintPluginBase(plugin) {
@@ -4953,7 +4984,6 @@ function internalEslintPluginBase(plugin) {
4953
4984
  }
4954
4985
  }];
4955
4986
  }
4956
-
4957
4987
  //#endregion
4958
4988
  //#region src/configs/internal/eslintPlugin/configs.ts
4959
4989
  function internalEslintPluginConfigs(plugin) {
@@ -4964,7 +4994,6 @@ function internalEslintPluginConfigs(plugin) {
4964
4994
  rules: { "perfectionist/sort-objects": ["error", sortObjects] }
4965
4995
  }];
4966
4996
  }
4967
-
4968
4997
  //#endregion
4969
4998
  //#region src/configs/internal/eslintPlugin/rules.ts
4970
4999
  function internalEslintPluginRules(plugin) {
@@ -4975,7 +5004,6 @@ function internalEslintPluginRules(plugin) {
4975
5004
  rules: { "perfectionist/sort-objects": ["error", sortObjects] }
4976
5005
  }];
4977
5006
  }
4978
-
4979
5007
  //#endregion
4980
5008
  //#region src/configs/internal/eslintPlugin/utility.ts
4981
5009
  function internalEslintPluginUtility(plugin) {
@@ -4985,7 +5013,6 @@ function internalEslintPluginUtility(plugin) {
4985
5013
  rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions] }
4986
5014
  }];
4987
5015
  }
4988
-
4989
5016
  //#endregion
4990
5017
  //#region src/configs/internal/utility/base.ts
4991
5018
  function internalUtilityBase(plugin) {
@@ -5001,13 +5028,11 @@ function internalUtilityBase(plugin) {
5001
5028
  }
5002
5029
  }];
5003
5030
  }
5004
-
5005
5031
  //#endregion
5006
5032
  //#region src/configs/internal/utility/internal.ts
5007
5033
  function internalUtilityRoot$1(plugin) {
5008
5034
  return [...internalUtilityBase(plugin), { rules: { "jsdoc/require-jsdoc": "off" } }];
5009
5035
  }
5010
-
5011
5036
  //#endregion
5012
5037
  //#region src/configs/internal/utility/root.ts
5013
5038
  function internalUtilityRoot(plugin) {
@@ -5016,7 +5041,6 @@ function internalUtilityRoot(plugin) {
5016
5041
  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
5042
  }] })] } }];
5018
5043
  }
5019
-
5020
5044
  //#endregion
5021
5045
  //#region src/configs/combined/typeScript.ts
5022
5046
  function combinedTypeScript(plugin) {
@@ -5028,7 +5052,6 @@ function combinedTypeScript(plugin) {
5028
5052
  ...internalTypeScript(plugin)
5029
5053
  ];
5030
5054
  }
5031
-
5032
5055
  //#endregion
5033
5056
  //#region src/configs/combined/typeScriptPackage.ts
5034
5057
  function combinedTypeScriptPackage(plugin) {
@@ -5038,7 +5061,6 @@ function combinedTypeScriptPackage(plugin) {
5038
5061
  ...internalJsdoc
5039
5062
  ];
5040
5063
  }
5041
-
5042
5064
  //#endregion
5043
5065
  //#region src/configs/combined/typeScriptReact.ts
5044
5066
  function combinedTypeScriptReact(plugin) {
@@ -5048,7 +5070,6 @@ function combinedTypeScriptReact(plugin) {
5048
5070
  ...combinedReact
5049
5071
  ];
5050
5072
  }
5051
-
5052
5073
  //#endregion
5053
5074
  //#region src/configs/internal/packageJson.ts
5054
5075
  const internalPackageJson = [...generalPackageJson, {
@@ -5058,7 +5079,6 @@ const internalPackageJson = [...generalPackageJson, {
5058
5079
  rangeType: "pin"
5059
5080
  }] }
5060
5081
  }];
5061
-
5062
5082
  //#endregion
5063
5083
  //#region src/configs/index.ts
5064
5084
  function createAlexPluginConfigs(plugin) {
@@ -5103,13 +5123,11 @@ function createAlexPluginConfigs(plugin) {
5103
5123
  }
5104
5124
  });
5105
5125
  }
5106
-
5107
5126
  //#endregion
5108
5127
  //#region src/rules/helpers/createRule.ts
5109
5128
  const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator((ruleName) => {
5110
5129
  return ruleName;
5111
5130
  });
5112
-
5113
5131
  //#endregion
5114
5132
  //#region src/rules/consistent-test-function.ts
5115
5133
  const validTestFunctionsSchema = zod.default.enum(["test", "it"]);
@@ -5203,7 +5221,6 @@ const consistentTestFunction = createRule({
5203
5221
  };
5204
5222
  }
5205
5223
  });
5206
-
5207
5224
  //#endregion
5208
5225
  //#region src/rules/has-standards.ts
5209
5226
  const hasStandardsOptionsSchema = zod.default.object({ fixable: zod.default.boolean() }).partial();
@@ -5242,7 +5259,6 @@ const hasStandards = createRule({
5242
5259
  } };
5243
5260
  }
5244
5261
  });
5245
-
5246
5262
  //#endregion
5247
5263
  //#region src/rules/no-isolated-tests.ts
5248
5264
  const noIsolatedTests = createRule({
@@ -5264,7 +5280,6 @@ const noIsolatedTests = createRule({
5264
5280
  } };
5265
5281
  }
5266
5282
  });
5267
-
5268
5283
  //#endregion
5269
5284
  //#region src/rules/no-namespace-imports.ts
5270
5285
  const noNamespaceImportsOptionsSchema = zod.default.object({ allow: zod.default.array(zod.default.string()) }).partial();
@@ -5295,7 +5310,6 @@ const noNamespaceImports = createRule({
5295
5310
  } };
5296
5311
  }
5297
5312
  });
5298
-
5299
5313
  //#endregion
5300
5314
  //#region src/rules/no-plugin-configs-access-from-src-configs.ts
5301
5315
  const noPluginConfigAccessFromSrcConfigs = createRule({
@@ -5319,7 +5333,6 @@ const noPluginConfigAccessFromSrcConfigs = createRule({
5319
5333
  } };
5320
5334
  }
5321
5335
  });
5322
-
5323
5336
  //#endregion
5324
5337
  //#region src/rules/no-relative-imports.ts
5325
5338
  const noRelativeImportsOptionsSchema = zod.default.object({ depth: zod.default.int().nonnegative() }).partial();
@@ -5386,7 +5399,6 @@ const noRelativeImports = createRule({
5386
5399
  } };
5387
5400
  }
5388
5401
  });
5389
-
5390
5402
  //#endregion
5391
5403
  //#region src/rules/no-skipped-tests.ts
5392
5404
  const noSkippedTests = createRule({
@@ -5408,7 +5420,6 @@ const noSkippedTests = createRule({
5408
5420
  } };
5409
5421
  }
5410
5422
  });
5411
-
5412
5423
  //#endregion
5413
5424
  //#region src/rules/standardise-error-messages.ts
5414
5425
  const standardiseErrorMessagesOptionsSchema = zod.default.object({ regex: zod.default.string() }).partial();
@@ -5452,7 +5463,6 @@ const standardiseErrorMessages = createRule({
5452
5463
  };
5453
5464
  }
5454
5465
  });
5455
-
5456
5466
  //#endregion
5457
5467
  //#region src/rules/use-normalized-imports.ts
5458
5468
  const useNormalizedImportsOptionsSchema = zod.default.object({ fixable: zod.default.boolean() }).partial();
@@ -5488,101 +5498,62 @@ const useNormalizedImports = createRule({
5488
5498
  } };
5489
5499
  }
5490
5500
  });
5491
-
5492
5501
  //#endregion
5493
5502
  //#region src/rules/use-object-shorthand.ts
5494
5503
  const useObjectShorthandOptionsSchema = zod.default.object({ fixable: zod.default.boolean() }).partial();
5495
5504
  function parseUseObjectShorthandOptions(data) {
5496
5505
  return useObjectShorthandOptionsSchema.parse(data);
5497
5506
  }
5498
- const useObjectShorthand = createRule({
5499
- name: "use-object-shorthand",
5500
- meta: {
5501
- docs: { description: "Encourage the use of object shorthand (e.g. const property = \"Hello\"; const object = { property });" },
5502
- messages: { useShorthand: "{ {{source}} } is not allowed. Please use the object shorthand." },
5503
- type: "suggestion",
5504
- fixable: "code",
5505
- schema: createRuleSchemaFromZodSchema(useObjectShorthandOptionsSchema)
5506
- },
5507
- defaultOptions: [{ fixable: true }],
5508
- create(context) {
5509
- const { fixable = true } = parseUseObjectShorthandOptions(context.options[0] ?? { fixable: true });
5510
- return { Property(node) {
5511
- if (node.key.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.value.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.key.name === node.value.name && !node.shorthand) context.report({
5512
- node,
5513
- messageId: "useShorthand",
5514
- data: { source: context.sourceCode.getText(node) },
5515
- fix: fixOnCondition(fixable, (fixer) => {
5516
- const key = node.key;
5517
- return fixer.replaceTextRange([node.range[0], node.range[1]], key.name);
5518
- })
5519
- });
5520
- } };
5521
- }
5522
- });
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
5507
  //#endregion
5545
5508
  //#region src/alexPlugin.ts
5546
5509
  const alexPlugin = {
5547
5510
  meta: {
5548
- name,
5549
- version,
5511
+ name: "@alextheman/eslint-plugin",
5512
+ version: "5.13.1",
5550
5513
  namespace: "alextheman"
5551
5514
  },
5552
5515
  configs: {},
5553
- rules: rules_default
5516
+ rules: {
5517
+ "consistent-test-function": consistentTestFunction,
5518
+ "has-standards": hasStandards,
5519
+ "no-isolated-tests": noIsolatedTests,
5520
+ "no-namespace-imports": noNamespaceImports,
5521
+ "no-plugin-configs-access-from-src-configs": noPluginConfigAccessFromSrcConfigs,
5522
+ "no-relative-imports": noRelativeImports,
5523
+ "no-skipped-tests": noSkippedTests,
5524
+ "standardise-error-messages": standardiseErrorMessages,
5525
+ "use-normalized-imports": useNormalizedImports,
5526
+ "use-object-shorthand": createRule({
5527
+ name: "use-object-shorthand",
5528
+ meta: {
5529
+ docs: { description: "Encourage the use of object shorthand (e.g. const property = \"Hello\"; const object = { property });" },
5530
+ messages: { useShorthand: "{ {{source}} } is not allowed. Please use the object shorthand." },
5531
+ type: "suggestion",
5532
+ fixable: "code",
5533
+ schema: createRuleSchemaFromZodSchema(useObjectShorthandOptionsSchema)
5534
+ },
5535
+ defaultOptions: [{ fixable: true }],
5536
+ create(context) {
5537
+ const { fixable = true } = parseUseObjectShorthandOptions(context.options[0] ?? { fixable: true });
5538
+ return { Property(node) {
5539
+ if (node.key.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.value.type === _typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.key.name === node.value.name && !node.shorthand) context.report({
5540
+ node,
5541
+ messageId: "useShorthand",
5542
+ data: { source: context.sourceCode.getText(node) },
5543
+ fix: fixOnCondition(fixable, (fixer) => {
5544
+ const key = node.key;
5545
+ return fixer.replaceTextRange([node.range[0], node.range[1]], key.name);
5546
+ })
5547
+ });
5548
+ } };
5549
+ }
5550
+ })
5551
+ }
5554
5552
  };
5555
5553
  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
5554
  //#endregion
5583
5555
  //#region src/index.ts
5584
5556
  var src_default = alexPlugin;
5585
-
5586
5557
  //#endregion
5587
5558
  exports.checkCallExpression = checkCallExpression;
5588
5559
  exports.combineRestrictedImports = combineRestrictedImports;
@@ -5592,4 +5563,3 @@ exports.fixOnCondition = fixOnCondition;
5592
5563
  exports.flattenConfigs = flattenConfigs;
5593
5564
  exports.getImportSpecifiersAfterRemoving = getImportSpecifiersAfterRemoving;
5594
5565
  exports.prettierConfig = prettierConfig;
5595
- exports.typeDocConfig = typeDocConfig;