@alextheman/eslint-plugin 5.7.0 → 5.8.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 CHANGED
@@ -58,9 +58,9 @@ let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
58
58
  eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks);
59
59
  let eslint_plugin_package_json = require("eslint-plugin-package-json");
60
60
  eslint_plugin_package_json = __toESM(eslint_plugin_package_json);
61
- let _eslint_compat = require("@eslint/compat");
62
61
  let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
63
62
  eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc);
63
+ let _alextheman_utility_node = require("@alextheman/utility/node");
64
64
 
65
65
  //#region node_modules/.pnpm/globals@17.3.0/node_modules/globals/globals.json
66
66
  var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -4087,7 +4087,6 @@ var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4087
4087
 
4088
4088
  //#endregion
4089
4089
  //#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
4090
- var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
4091
4090
  const generalRestrictedImports = { patterns: [{
4092
4091
  group: ["node_modules"],
4093
4092
  message: "Do not import directly from node_modules."
@@ -4174,7 +4173,7 @@ function fixOnCondition(fixable, fix) {
4174
4173
  //#endregion
4175
4174
  //#region src/utility/private/camelToKebab.ts
4176
4175
  function camelToKebab(string) {
4177
- 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.");
4176
+ 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.");
4178
4177
  return (0, _alextheman_utility.camelToKebab)(string, { preserveConsecutiveCapitals: false });
4179
4178
  }
4180
4179
 
@@ -4265,6 +4264,7 @@ const testsRestrictedImports = combineRestrictedImports(generalRestrictedImports
4265
4264
 
4266
4265
  //#endregion
4267
4266
  //#region src/configs/internal/tests.ts
4267
+ var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
4268
4268
  const internalTests = [{
4269
4269
  files: ["**/*.test.{js,ts}"],
4270
4270
  languageOptions: { globals: {
@@ -4756,7 +4756,7 @@ const generalPackageJson = [eslint_plugin_package_json.default.configs.recommend
4756
4756
  //#endregion
4757
4757
  //#region src/configs/general/typeScript.ts
4758
4758
  const generalTypeScript = [
4759
- ...(0, _eslint_compat.fixupConfigRules)(typescript_eslint.default.configs.recommended),
4759
+ ...typescript_eslint.default.configs.recommended,
4760
4760
  ...generalJavaScript,
4761
4761
  {
4762
4762
  files: ["**/*.ts", "**/*.tsx"],
@@ -4926,7 +4926,7 @@ function internalTypeScript(plugin) {
4926
4926
  name: "@alextheman/internal/typescript",
4927
4927
  plugins: {
4928
4928
  "@alextheman": plugin,
4929
- "@typescript-eslint": (0, _eslint_compat.fixupPluginRules)(typescript_eslint.default.plugin)
4929
+ "@typescript-eslint": typescript_eslint.default.plugin
4930
4930
  },
4931
4931
  rules: {
4932
4932
  "@alextheman/standardise-error-messages": "error",
@@ -4940,22 +4940,6 @@ function internalTypeScript(plugin) {
4940
4940
  }];
4941
4941
  }
4942
4942
 
4943
- //#endregion
4944
- //#region src/configs/internal/utility.ts
4945
- function internalUtility(plugin) {
4946
- return [...combinedTypeScriptPackage(plugin), {
4947
- name: "@alextheman/internal/utility",
4948
- plugins: {
4949
- "@typescript-eslint": (0, _eslint_compat.fixupPluginRules)(typescript_eslint.default.plugin),
4950
- jsdoc: eslint_plugin_jsdoc.default
4951
- },
4952
- rules: {
4953
- "@typescript-eslint/explicit-module-boundary-types": "error",
4954
- "jsdoc/require-jsdoc": ["error", requireJsdocOptions]
4955
- }
4956
- }];
4957
- }
4958
-
4959
4943
  //#endregion
4960
4944
  //#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
4961
4945
  const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
@@ -5031,6 +5015,37 @@ function internalEslintPluginUtility(plugin) {
5031
5015
  }];
5032
5016
  }
5033
5017
 
5018
+ //#endregion
5019
+ //#region src/configs/internal/utility/base.ts
5020
+ function internalUtilityBase(plugin) {
5021
+ return [...combinedTypeScriptPackage(plugin), {
5022
+ name: "@alextheman/internal/utility",
5023
+ plugins: {
5024
+ "@typescript-eslint": typescript_eslint.default.plugin,
5025
+ jsdoc: eslint_plugin_jsdoc.default
5026
+ },
5027
+ rules: {
5028
+ "@typescript-eslint/explicit-module-boundary-types": "error",
5029
+ "jsdoc/require-jsdoc": ["error", requireJsdocOptions]
5030
+ }
5031
+ }];
5032
+ }
5033
+
5034
+ //#endregion
5035
+ //#region src/configs/internal/utility/internal.ts
5036
+ function internalUtilityRoot$1(plugin) {
5037
+ return [...internalUtilityBase(plugin), { rules: { "jsdoc/require-jsdoc": "off" } }];
5038
+ }
5039
+
5040
+ //#endregion
5041
+ //#region src/configs/internal/utility/root.ts
5042
+ function internalUtilityRoot(plugin) {
5043
+ return [...internalUtilityBase(plugin), { rules: { "no-restricted-imports": ["error", combineRestrictedImports(personalRestrictedImports, { patterns: [{
5044
+ group: ["node:"],
5045
+ 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."
5046
+ }] })] } }];
5047
+ }
5048
+
5034
5049
  //#endregion
5035
5050
  //#region src/configs/combined/typeScript.ts
5036
5051
  function combinedTypeScript(plugin) {
@@ -5096,7 +5111,9 @@ function createAlexPluginConfigs(plugin) {
5096
5111
  react: internalReact,
5097
5112
  tests: internalTests,
5098
5113
  typescript: internalTypeScript(plugin),
5099
- utility: internalUtility(plugin)
5114
+ utilityBase: internalUtilityBase(plugin),
5115
+ utilityInternal: internalUtilityRoot$1(plugin),
5116
+ utilityRoot: internalUtilityRoot(plugin)
5100
5117
  },
5101
5118
  plugin: {
5102
5119
  base: pluginBase(plugin),
@@ -5434,7 +5451,7 @@ const useNormalizedImports = createRule({
5434
5451
  create(context) {
5435
5452
  const { fixable = true } = parseUseNormalizedImportsOptions(context.options[0] ?? { fixable: true });
5436
5453
  return { ImportDeclaration(node) {
5437
- const normalizedPath = (0, _alextheman_utility.normalizeImportPath)(node.source.value);
5454
+ const normalizedPath = (0, _alextheman_utility_node.normalizeImportPath)(node.source.value);
5438
5455
  if (node.source.value !== normalizedPath) return context.report({
5439
5456
  node,
5440
5457
  messageId: "pathNotNormalized",
@@ -5500,7 +5517,7 @@ var rules_default = {
5500
5517
  //#endregion
5501
5518
  //#region package.json
5502
5519
  var name = "@alextheman/eslint-plugin";
5503
- var version = "5.7.0";
5520
+ var version = "5.8.0";
5504
5521
 
5505
5522
  //#endregion
5506
5523
  //#region src/alexPlugin.ts
package/dist/index.d.cts CHANGED
@@ -28,7 +28,7 @@ type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: R
28
28
  //#region src/configs/AlexPluginConfigGroup.d.ts
29
29
  type GeneralConfig = "javascript" | "typescript" | "react" | "packageJson";
30
30
  type PluginConfig = "base" | "tests";
31
- type InternalConfig = "javascript" | "typescript" | "react" | "tests" | "eslintPluginBase" | "eslintPluginConfigs" | "eslintPluginRules" | "eslintPluginUtility" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility" | "alexCLine" | "jsdoc" | "components";
31
+ type InternalConfig = "javascript" | "typescript" | "react" | "tests" | "eslintPluginBase" | "eslintPluginConfigs" | "eslintPluginRules" | "eslintPluginUtility" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utilityBase" | "utilityRoot" | "utilityInternal" | "alexCLine" | "jsdoc" | "components";
32
32
  type CombinedConfig = "javascript" | "typescript" | "react" | "tests" | "typescriptReact" | "javascriptReact" | "typescriptPackage";
33
33
  interface AlexPluginConfigObject {
34
34
  general: Record<GeneralConfig, Linter.Config[]>;
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: R
28
28
  //#region src/configs/AlexPluginConfigGroup.d.ts
29
29
  type GeneralConfig = "javascript" | "typescript" | "react" | "packageJson";
30
30
  type PluginConfig = "base" | "tests";
31
- type InternalConfig = "javascript" | "typescript" | "react" | "tests" | "eslintPluginBase" | "eslintPluginConfigs" | "eslintPluginRules" | "eslintPluginUtility" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utility" | "alexCLine" | "jsdoc" | "components";
31
+ type InternalConfig = "javascript" | "typescript" | "react" | "tests" | "eslintPluginBase" | "eslintPluginConfigs" | "eslintPluginRules" | "eslintPluginUtility" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utilityBase" | "utilityRoot" | "utilityInternal" | "alexCLine" | "jsdoc" | "components";
32
32
  type CombinedConfig = "javascript" | "typescript" | "react" | "tests" | "typescriptReact" | "javascriptReact" | "typescriptPackage";
33
33
  interface AlexPluginConfigObject {
34
34
  general: Record<GeneralConfig, Linter.Config[]>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DataError, camelToKebab, deepCopy, deepFreeze, normalizeImportPath, omitProperties } from "@alextheman/utility";
1
+ import { DataError, camelToKebab, deepCopy, deepFreeze, omitProperties } from "@alextheman/utility";
2
2
  import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
3
3
  import z from "zod";
4
4
  import js from "@eslint/js";
@@ -15,8 +15,8 @@ import reactPlugin from "eslint-plugin-react";
15
15
  import reactRefresh from "eslint-plugin-react-refresh";
16
16
  import reactHooksPlugin from "eslint-plugin-react-hooks";
17
17
  import packageJson from "eslint-plugin-package-json";
18
- import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
19
18
  import jsdoc from "eslint-plugin-jsdoc";
19
+ import { normalizeImportPath } from "@alextheman/utility/node";
20
20
 
21
21
  //#region \0rolldown/runtime.js
22
22
  var __create = Object.create;
@@ -4071,7 +4071,6 @@ var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4071
4071
 
4072
4072
  //#endregion
4073
4073
  //#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
4074
- var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
4075
4074
  const generalRestrictedImports = { patterns: [{
4076
4075
  group: ["node_modules"],
4077
4076
  message: "Do not import directly from node_modules."
@@ -4158,7 +4157,7 @@ function fixOnCondition(fixable, fix) {
4158
4157
  //#endregion
4159
4158
  //#region src/utility/private/camelToKebab.ts
4160
4159
  function camelToKebab$1(string) {
4161
- if (string[0] === string[0].toUpperCase()) throw new DataError(string, "CAMEL_TO_KEBAB_CONVERSION_ERROR", "camelCase string must start with a lowercase letter.");
4160
+ if (string[0] === string[0].toUpperCase()) throw new DataError({ string }, "CAMEL_TO_KEBAB_CONVERSION_ERROR", "camelCase string must start with a lowercase letter.");
4162
4161
  return camelToKebab(string, { preserveConsecutiveCapitals: false });
4163
4162
  }
4164
4163
 
@@ -4249,6 +4248,7 @@ const testsRestrictedImports = combineRestrictedImports(generalRestrictedImports
4249
4248
 
4250
4249
  //#endregion
4251
4250
  //#region src/configs/internal/tests.ts
4251
+ var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
4252
4252
  const internalTests = [{
4253
4253
  files: ["**/*.test.{js,ts}"],
4254
4254
  languageOptions: { globals: {
@@ -4740,7 +4740,7 @@ const generalPackageJson = [packageJson.configs.recommended, {
4740
4740
  //#endregion
4741
4741
  //#region src/configs/general/typeScript.ts
4742
4742
  const generalTypeScript = [
4743
- ...fixupConfigRules(tseslint.configs.recommended),
4743
+ ...tseslint.configs.recommended,
4744
4744
  ...generalJavaScript,
4745
4745
  {
4746
4746
  files: ["**/*.ts", "**/*.tsx"],
@@ -4910,7 +4910,7 @@ function internalTypeScript(plugin) {
4910
4910
  name: "@alextheman/internal/typescript",
4911
4911
  plugins: {
4912
4912
  "@alextheman": plugin,
4913
- "@typescript-eslint": fixupPluginRules(tseslint.plugin)
4913
+ "@typescript-eslint": tseslint.plugin
4914
4914
  },
4915
4915
  rules: {
4916
4916
  "@alextheman/standardise-error-messages": "error",
@@ -4924,22 +4924,6 @@ function internalTypeScript(plugin) {
4924
4924
  }];
4925
4925
  }
4926
4926
 
4927
- //#endregion
4928
- //#region src/configs/internal/utility.ts
4929
- function internalUtility(plugin) {
4930
- return [...combinedTypeScriptPackage(plugin), {
4931
- name: "@alextheman/internal/utility",
4932
- plugins: {
4933
- "@typescript-eslint": fixupPluginRules(tseslint.plugin),
4934
- jsdoc
4935
- },
4936
- rules: {
4937
- "@typescript-eslint/explicit-module-boundary-types": "error",
4938
- "jsdoc/require-jsdoc": ["error", requireJsdocOptions]
4939
- }
4940
- }];
4941
- }
4942
-
4943
4927
  //#endregion
4944
4928
  //#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
4945
4929
  const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
@@ -5015,6 +4999,37 @@ function internalEslintPluginUtility(plugin) {
5015
4999
  }];
5016
5000
  }
5017
5001
 
5002
+ //#endregion
5003
+ //#region src/configs/internal/utility/base.ts
5004
+ function internalUtilityBase(plugin) {
5005
+ return [...combinedTypeScriptPackage(plugin), {
5006
+ name: "@alextheman/internal/utility",
5007
+ plugins: {
5008
+ "@typescript-eslint": tseslint.plugin,
5009
+ jsdoc
5010
+ },
5011
+ rules: {
5012
+ "@typescript-eslint/explicit-module-boundary-types": "error",
5013
+ "jsdoc/require-jsdoc": ["error", requireJsdocOptions]
5014
+ }
5015
+ }];
5016
+ }
5017
+
5018
+ //#endregion
5019
+ //#region src/configs/internal/utility/internal.ts
5020
+ function internalUtilityRoot$1(plugin) {
5021
+ return [...internalUtilityBase(plugin), { rules: { "jsdoc/require-jsdoc": "off" } }];
5022
+ }
5023
+
5024
+ //#endregion
5025
+ //#region src/configs/internal/utility/root.ts
5026
+ function internalUtilityRoot(plugin) {
5027
+ return [...internalUtilityBase(plugin), { rules: { "no-restricted-imports": ["error", combineRestrictedImports(personalRestrictedImports, { patterns: [{
5028
+ group: ["node:"],
5029
+ 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."
5030
+ }] })] } }];
5031
+ }
5032
+
5018
5033
  //#endregion
5019
5034
  //#region src/configs/combined/typeScript.ts
5020
5035
  function combinedTypeScript(plugin) {
@@ -5080,7 +5095,9 @@ function createAlexPluginConfigs(plugin) {
5080
5095
  react: internalReact,
5081
5096
  tests: internalTests,
5082
5097
  typescript: internalTypeScript(plugin),
5083
- utility: internalUtility(plugin)
5098
+ utilityBase: internalUtilityBase(plugin),
5099
+ utilityInternal: internalUtilityRoot$1(plugin),
5100
+ utilityRoot: internalUtilityRoot(plugin)
5084
5101
  },
5085
5102
  plugin: {
5086
5103
  base: pluginBase(plugin),
@@ -5484,7 +5501,7 @@ var rules_default = {
5484
5501
  //#endregion
5485
5502
  //#region package.json
5486
5503
  var name = "@alextheman/eslint-plugin";
5487
- var version = "5.7.0";
5504
+ var version = "5.8.0";
5488
5505
 
5489
5506
  //#endregion
5490
5507
  //#region src/alexPlugin.ts
@@ -111,7 +111,7 @@ function fixOnCondition(fixable, fix) {
111
111
  //#endregion
112
112
  //#region src/utility/private/camelToKebab.ts
113
113
  function camelToKebab(string) {
114
- 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.");
114
+ 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.");
115
115
  return (0, _alextheman_utility.camelToKebab)(string, { preserveConsecutiveCapitals: false });
116
116
  }
117
117
 
@@ -82,7 +82,7 @@ function fixOnCondition(fixable, fix) {
82
82
  //#endregion
83
83
  //#region src/utility/private/camelToKebab.ts
84
84
  function camelToKebab$1(string) {
85
- if (string[0] === string[0].toUpperCase()) throw new DataError(string, "CAMEL_TO_KEBAB_CONVERSION_ERROR", "camelCase string must start with a lowercase letter.");
85
+ if (string[0] === string[0].toUpperCase()) throw new DataError({ string }, "CAMEL_TO_KEBAB_CONVERSION_ERROR", "camelCase string must start with a lowercase letter.");
86
86
  return camelToKebab(string, { preserveConsecutiveCapitals: false });
87
87
  }
88
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "A package to provide custom ESLint rules and configs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,7 @@
9
9
  "license": "MIT",
10
10
  "author": "alextheman",
11
11
  "type": "module",
12
+ "sideEffects": false,
12
13
  "exports": {
13
14
  ".": {
14
15
  "types": "./dist/index.d.ts",
@@ -29,10 +30,10 @@
29
30
  "dist"
30
31
  ],
31
32
  "dependencies": {
32
- "@alextheman/utility": "^4.13.0",
33
+ "@alextheman/utility": "^5.1.3",
33
34
  "@eslint/compat": "^2.0.2",
34
- "@typescript-eslint/types": "^8.54.0",
35
- "@typescript-eslint/utils": "^8.54.0",
35
+ "@typescript-eslint/types": "^8.56.0",
36
+ "@typescript-eslint/utils": "^8.56.0",
36
37
  "common-tags": "^1.8.2",
37
38
  "prettier": "^3.8.1",
38
39
  "zod": "^4.3.6"
@@ -42,19 +43,19 @@
42
43
  "@types/common-tags": "^1.8.4",
43
44
  "@types/eslint": "^9.6.1",
44
45
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
45
- "@types/node": "^25.2.1",
46
- "@typescript-eslint/rule-tester": "^8.54.0",
47
- "alex-c-line": "^1.23.1",
46
+ "@types/node": "^25.3.0",
47
+ "@typescript-eslint/rule-tester": "^8.56.0",
48
+ "alex-c-line": "^1.28.0",
48
49
  "dotenv-cli": "^11.0.0",
49
- "eslint": "^10.0.0",
50
+ "eslint": "^10.0.1",
50
51
  "eslint-config-prettier": "^10.1.8",
51
52
  "eslint-import-resolver-typescript": "^4.4.4",
52
53
  "eslint-plugin-import": "^2.32.0",
53
- "eslint-plugin-jsdoc": "^62.5.3",
54
+ "eslint-plugin-jsdoc": "^62.7.0",
54
55
  "eslint-plugin-jsx-a11y": "^6.10.2",
55
- "eslint-plugin-n": "^17.23.2",
56
- "eslint-plugin-package-json": "^0.88.2",
57
- "eslint-plugin-perfectionist": "^5.5.0",
56
+ "eslint-plugin-n": "^17.24.0",
57
+ "eslint-plugin-package-json": "^0.89.0",
58
+ "eslint-plugin-perfectionist": "^5.6.0",
58
59
  "eslint-plugin-prettier": "^5.5.5",
59
60
  "eslint-plugin-react": "^7.37.5",
60
61
  "eslint-plugin-react-hooks": "^7.0.1",
@@ -62,15 +63,15 @@
62
63
  "eslint-vitest-rule-tester": "^3.1.0",
63
64
  "globals": "^17.3.0",
64
65
  "husky": "^9.1.7",
65
- "jsdom": "^28.0.0",
66
+ "jsdom": "^28.1.0",
66
67
  "tsdown": "^0.20.3",
67
68
  "tsx": "^4.21.0",
68
- "typedoc": "^0.28.16",
69
+ "typedoc": "^0.28.17",
69
70
  "typedoc-plugin-markdown": "^4.10.0",
70
71
  "typedoc-rhineai-theme": "^1.2.0",
71
72
  "typescript": "^5.9.3",
72
- "typescript-eslint": "^8.54.0",
73
- "vite-tsconfig-paths": "^6.0.5",
73
+ "typescript-eslint": "^8.56.0",
74
+ "vite-tsconfig-paths": "^6.1.1",
74
75
  "vitest": "^4.0.18"
75
76
  },
76
77
  "peerDependencies": {