@alextheman/eslint-plugin 5.6.2 → 5.7.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 +110 -71
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +110 -71
- package/package.json +11 -11
package/dist/index.cjs
CHANGED
|
@@ -58,7 +58,6 @@ 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);
|
|
64
63
|
|
|
@@ -4756,7 +4755,7 @@ const generalPackageJson = [eslint_plugin_package_json.default.configs.recommend
|
|
|
4756
4755
|
//#endregion
|
|
4757
4756
|
//#region src/configs/general/typeScript.ts
|
|
4758
4757
|
const generalTypeScript = [
|
|
4759
|
-
...
|
|
4758
|
+
...typescript_eslint.default.configs.recommended,
|
|
4760
4759
|
...generalJavaScript,
|
|
4761
4760
|
{
|
|
4762
4761
|
files: ["**/*.ts", "**/*.tsx"],
|
|
@@ -4842,61 +4841,6 @@ const internalComponents = [...internalJsdoc, { rules: {
|
|
|
4842
4841
|
"jsdoc/require-returns": "off"
|
|
4843
4842
|
} }];
|
|
4844
4843
|
|
|
4845
|
-
//#endregion
|
|
4846
|
-
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
4847
|
-
const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
|
|
4848
|
-
{
|
|
4849
|
-
importNames: ["default"],
|
|
4850
|
-
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
4851
|
-
name: "src/alexPlugin"
|
|
4852
|
-
},
|
|
4853
|
-
...["src/index", "src"].map((name) => {
|
|
4854
|
-
return {
|
|
4855
|
-
message: "Do not import directly from the index file.",
|
|
4856
|
-
name
|
|
4857
|
-
};
|
|
4858
|
-
}),
|
|
4859
|
-
{
|
|
4860
|
-
importNames: ["default"],
|
|
4861
|
-
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
|
|
4862
|
-
name: "eslint-plugin-react-hooks"
|
|
4863
|
-
},
|
|
4864
|
-
{
|
|
4865
|
-
importNames: ["createRuleTester"],
|
|
4866
|
-
message: "Please import createRuleTester from \"tests/rule-testers/createRuleTester\" instead.",
|
|
4867
|
-
name: "eslint-vitest-rule-tester"
|
|
4868
|
-
}
|
|
4869
|
-
] });
|
|
4870
|
-
|
|
4871
|
-
//#endregion
|
|
4872
|
-
//#region src/configs/internal/eslintPlugin.ts
|
|
4873
|
-
function internalEslintPlugin(plugin) {
|
|
4874
|
-
return [
|
|
4875
|
-
...combinedTypeScriptPackage(plugin),
|
|
4876
|
-
{
|
|
4877
|
-
name: "@alextheman/internal/eslint-plugin",
|
|
4878
|
-
plugins: {
|
|
4879
|
-
"@alextheman": plugin,
|
|
4880
|
-
jsdoc: eslint_plugin_jsdoc.default,
|
|
4881
|
-
perfectionist: eslint_plugin_perfectionist.default
|
|
4882
|
-
},
|
|
4883
|
-
rules: {
|
|
4884
|
-
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
4885
|
-
"jsdoc/require-jsdoc": "off",
|
|
4886
|
-
"no-restricted-imports": ["error", eslintPluginRestrictedImports]
|
|
4887
|
-
}
|
|
4888
|
-
},
|
|
4889
|
-
{
|
|
4890
|
-
files: ["src/rules/index.ts", "src/configs/**"],
|
|
4891
|
-
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
4892
|
-
},
|
|
4893
|
-
{
|
|
4894
|
-
files: ["src/utility/public/**"],
|
|
4895
|
-
rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions] }
|
|
4896
|
-
}
|
|
4897
|
-
];
|
|
4898
|
-
}
|
|
4899
|
-
|
|
4900
4844
|
//#endregion
|
|
4901
4845
|
//#region src/configs/helpers/restrictedImports/neurosongsBackEndRestrictedImports.ts
|
|
4902
4846
|
const neurosongsBackEndRestrictedImports = combineRestrictedImports(personalRestrictedImports, { paths: [
|
|
@@ -4981,7 +4925,7 @@ function internalTypeScript(plugin) {
|
|
|
4981
4925
|
name: "@alextheman/internal/typescript",
|
|
4982
4926
|
plugins: {
|
|
4983
4927
|
"@alextheman": plugin,
|
|
4984
|
-
"@typescript-eslint":
|
|
4928
|
+
"@typescript-eslint": typescript_eslint.default.plugin
|
|
4985
4929
|
},
|
|
4986
4930
|
rules: {
|
|
4987
4931
|
"@alextheman/standardise-error-messages": "error",
|
|
@@ -4996,12 +4940,87 @@ function internalTypeScript(plugin) {
|
|
|
4996
4940
|
}
|
|
4997
4941
|
|
|
4998
4942
|
//#endregion
|
|
4999
|
-
//#region src/configs/
|
|
5000
|
-
|
|
4943
|
+
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
4944
|
+
const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
|
|
4945
|
+
{
|
|
4946
|
+
importNames: ["default"],
|
|
4947
|
+
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
4948
|
+
name: "src/alexPlugin"
|
|
4949
|
+
},
|
|
4950
|
+
...["src/index", "src"].map((name) => {
|
|
4951
|
+
return {
|
|
4952
|
+
message: "Do not import directly from the index file.",
|
|
4953
|
+
name
|
|
4954
|
+
};
|
|
4955
|
+
}),
|
|
4956
|
+
{
|
|
4957
|
+
importNames: ["default"],
|
|
4958
|
+
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
|
|
4959
|
+
name: "eslint-plugin-react-hooks"
|
|
4960
|
+
},
|
|
4961
|
+
{
|
|
4962
|
+
importNames: ["createRuleTester"],
|
|
4963
|
+
message: "Please import createRuleTester from \"tests/rule-testers/createRuleTester\" instead.",
|
|
4964
|
+
name: "eslint-vitest-rule-tester"
|
|
4965
|
+
}
|
|
4966
|
+
] });
|
|
4967
|
+
|
|
4968
|
+
//#endregion
|
|
4969
|
+
//#region src/configs/internal/eslintPlugin/base.ts
|
|
4970
|
+
function internalEslintPluginBase(plugin) {
|
|
4971
|
+
return [...combinedTypeScriptPackage(plugin), {
|
|
4972
|
+
name: "@alextheman/internal/eslint-plugin-base",
|
|
4973
|
+
plugins: {
|
|
4974
|
+
"@alextheman": plugin,
|
|
4975
|
+
jsdoc: eslint_plugin_jsdoc.default
|
|
4976
|
+
},
|
|
4977
|
+
rules: {
|
|
4978
|
+
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
4979
|
+
"jsdoc/require-jsdoc": "off",
|
|
4980
|
+
"no-restricted-imports": ["error", eslintPluginRestrictedImports]
|
|
4981
|
+
}
|
|
4982
|
+
}];
|
|
4983
|
+
}
|
|
4984
|
+
|
|
4985
|
+
//#endregion
|
|
4986
|
+
//#region src/configs/internal/eslintPlugin/configs.ts
|
|
4987
|
+
function internalEslintPluginConfigs(plugin) {
|
|
4988
|
+
return [...internalEslintPluginBase(plugin), {
|
|
4989
|
+
files: ["**/*.ts"],
|
|
4990
|
+
name: "@alextheman/internal/eslint-plugin-configs",
|
|
4991
|
+
plugins: { perfectionist: eslint_plugin_perfectionist.default },
|
|
4992
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
4993
|
+
}];
|
|
4994
|
+
}
|
|
4995
|
+
|
|
4996
|
+
//#endregion
|
|
4997
|
+
//#region src/configs/internal/eslintPlugin/rules.ts
|
|
4998
|
+
function internalEslintPluginRules(plugin) {
|
|
4999
|
+
return [...internalEslintPluginBase(plugin), {
|
|
5000
|
+
files: ["index.ts"],
|
|
5001
|
+
name: "@alextheman/internal/eslint-plugin-rules",
|
|
5002
|
+
plugins: { perfectionist: eslint_plugin_perfectionist.default },
|
|
5003
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
5004
|
+
}];
|
|
5005
|
+
}
|
|
5006
|
+
|
|
5007
|
+
//#endregion
|
|
5008
|
+
//#region src/configs/internal/eslintPlugin/utility.ts
|
|
5009
|
+
function internalEslintPluginUtility(plugin) {
|
|
5010
|
+
return [...internalEslintPluginBase(plugin), {
|
|
5011
|
+
files: ["**/*.ts"],
|
|
5012
|
+
name: "@alextheman/internal/eslint-plugin-utility",
|
|
5013
|
+
rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions] }
|
|
5014
|
+
}];
|
|
5015
|
+
}
|
|
5016
|
+
|
|
5017
|
+
//#endregion
|
|
5018
|
+
//#region src/configs/internal/utility/base.ts
|
|
5019
|
+
function internalUtilityBase(plugin) {
|
|
5001
5020
|
return [...combinedTypeScriptPackage(plugin), {
|
|
5002
5021
|
name: "@alextheman/internal/utility",
|
|
5003
5022
|
plugins: {
|
|
5004
|
-
"@typescript-eslint":
|
|
5023
|
+
"@typescript-eslint": typescript_eslint.default.plugin,
|
|
5005
5024
|
jsdoc: eslint_plugin_jsdoc.default
|
|
5006
5025
|
},
|
|
5007
5026
|
rules: {
|
|
@@ -5011,6 +5030,21 @@ function internalUtility(plugin) {
|
|
|
5011
5030
|
}];
|
|
5012
5031
|
}
|
|
5013
5032
|
|
|
5033
|
+
//#endregion
|
|
5034
|
+
//#region src/configs/internal/utility/internal.ts
|
|
5035
|
+
function internalUtilityRoot$1(plugin) {
|
|
5036
|
+
return [...internalUtilityBase(plugin), { rules: { "jsdoc/require-jsdoc": "off" } }];
|
|
5037
|
+
}
|
|
5038
|
+
|
|
5039
|
+
//#endregion
|
|
5040
|
+
//#region src/configs/internal/utility/root.ts
|
|
5041
|
+
function internalUtilityRoot(plugin) {
|
|
5042
|
+
return [...internalUtilityBase(plugin), { rules: { "no-restricted-imports": ["error", combineRestrictedImports(personalRestrictedImports, { patterns: [{
|
|
5043
|
+
group: ["node:"],
|
|
5044
|
+
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."
|
|
5045
|
+
}] })] } }];
|
|
5046
|
+
}
|
|
5047
|
+
|
|
5014
5048
|
//#endregion
|
|
5015
5049
|
//#region src/configs/combined/typeScript.ts
|
|
5016
5050
|
function combinedTypeScript(plugin) {
|
|
@@ -5048,13 +5082,13 @@ function combinedTypeScriptReact(plugin) {
|
|
|
5048
5082
|
function createAlexPluginConfigs(plugin) {
|
|
5049
5083
|
return flattenConfigs({
|
|
5050
5084
|
combined: {
|
|
5051
|
-
javascript:
|
|
5052
|
-
javascriptReact:
|
|
5053
|
-
react:
|
|
5054
|
-
tests:
|
|
5055
|
-
typescript:
|
|
5056
|
-
typescriptPackage:
|
|
5057
|
-
typescriptReact:
|
|
5085
|
+
javascript: combinedJavaScript(plugin),
|
|
5086
|
+
javascriptReact: combinedJavaScriptReact(plugin),
|
|
5087
|
+
react: combinedReact,
|
|
5088
|
+
tests: combinedTests(plugin),
|
|
5089
|
+
typescript: combinedTypeScript(plugin),
|
|
5090
|
+
typescriptPackage: combinedTypeScriptPackage(plugin),
|
|
5091
|
+
typescriptReact: combinedTypeScriptReact(plugin)
|
|
5058
5092
|
},
|
|
5059
5093
|
general: {
|
|
5060
5094
|
javascript: generalJavaScript,
|
|
@@ -5065,7 +5099,10 @@ function createAlexPluginConfigs(plugin) {
|
|
|
5065
5099
|
internal: {
|
|
5066
5100
|
alexCLine: internalAlexCLine(plugin),
|
|
5067
5101
|
components: internalComponents,
|
|
5068
|
-
|
|
5102
|
+
eslintPluginBase: internalEslintPluginBase(plugin),
|
|
5103
|
+
eslintPluginConfigs: internalEslintPluginConfigs(plugin),
|
|
5104
|
+
eslintPluginRules: internalEslintPluginRules(plugin),
|
|
5105
|
+
eslintPluginUtility: internalEslintPluginUtility(plugin),
|
|
5069
5106
|
javascript: internalJavaScript(plugin),
|
|
5070
5107
|
jsdoc: internalJsdoc,
|
|
5071
5108
|
neurosongsBackEnd: internalNeurosongsBackEnd,
|
|
@@ -5073,7 +5110,9 @@ function createAlexPluginConfigs(plugin) {
|
|
|
5073
5110
|
react: internalReact,
|
|
5074
5111
|
tests: internalTests,
|
|
5075
5112
|
typescript: internalTypeScript(plugin),
|
|
5076
|
-
|
|
5113
|
+
utilityBase: internalUtilityBase(plugin),
|
|
5114
|
+
utilityInternal: internalUtilityRoot$1(plugin),
|
|
5115
|
+
utilityRoot: internalUtilityRoot(plugin)
|
|
5077
5116
|
},
|
|
5078
5117
|
plugin: {
|
|
5079
5118
|
base: pluginBase(plugin),
|
|
@@ -5477,7 +5516,7 @@ var rules_default = {
|
|
|
5477
5516
|
//#endregion
|
|
5478
5517
|
//#region package.json
|
|
5479
5518
|
var name = "@alextheman/eslint-plugin";
|
|
5480
|
-
var version = "5.
|
|
5519
|
+
var version = "5.7.1";
|
|
5481
5520
|
|
|
5482
5521
|
//#endregion
|
|
5483
5522
|
//#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" | "
|
|
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" | "
|
|
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
|
@@ -15,7 +15,6 @@ 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";
|
|
20
19
|
|
|
21
20
|
//#region \0rolldown/runtime.js
|
|
@@ -4740,7 +4739,7 @@ const generalPackageJson = [packageJson.configs.recommended, {
|
|
|
4740
4739
|
//#endregion
|
|
4741
4740
|
//#region src/configs/general/typeScript.ts
|
|
4742
4741
|
const generalTypeScript = [
|
|
4743
|
-
...
|
|
4742
|
+
...tseslint.configs.recommended,
|
|
4744
4743
|
...generalJavaScript,
|
|
4745
4744
|
{
|
|
4746
4745
|
files: ["**/*.ts", "**/*.tsx"],
|
|
@@ -4826,61 +4825,6 @@ const internalComponents = [...internalJsdoc, { rules: {
|
|
|
4826
4825
|
"jsdoc/require-returns": "off"
|
|
4827
4826
|
} }];
|
|
4828
4827
|
|
|
4829
|
-
//#endregion
|
|
4830
|
-
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
4831
|
-
const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
|
|
4832
|
-
{
|
|
4833
|
-
importNames: ["default"],
|
|
4834
|
-
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
4835
|
-
name: "src/alexPlugin"
|
|
4836
|
-
},
|
|
4837
|
-
...["src/index", "src"].map((name) => {
|
|
4838
|
-
return {
|
|
4839
|
-
message: "Do not import directly from the index file.",
|
|
4840
|
-
name
|
|
4841
|
-
};
|
|
4842
|
-
}),
|
|
4843
|
-
{
|
|
4844
|
-
importNames: ["default"],
|
|
4845
|
-
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
|
|
4846
|
-
name: "eslint-plugin-react-hooks"
|
|
4847
|
-
},
|
|
4848
|
-
{
|
|
4849
|
-
importNames: ["createRuleTester"],
|
|
4850
|
-
message: "Please import createRuleTester from \"tests/rule-testers/createRuleTester\" instead.",
|
|
4851
|
-
name: "eslint-vitest-rule-tester"
|
|
4852
|
-
}
|
|
4853
|
-
] });
|
|
4854
|
-
|
|
4855
|
-
//#endregion
|
|
4856
|
-
//#region src/configs/internal/eslintPlugin.ts
|
|
4857
|
-
function internalEslintPlugin(plugin) {
|
|
4858
|
-
return [
|
|
4859
|
-
...combinedTypeScriptPackage(plugin),
|
|
4860
|
-
{
|
|
4861
|
-
name: "@alextheman/internal/eslint-plugin",
|
|
4862
|
-
plugins: {
|
|
4863
|
-
"@alextheman": plugin,
|
|
4864
|
-
jsdoc,
|
|
4865
|
-
perfectionist
|
|
4866
|
-
},
|
|
4867
|
-
rules: {
|
|
4868
|
-
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
4869
|
-
"jsdoc/require-jsdoc": "off",
|
|
4870
|
-
"no-restricted-imports": ["error", eslintPluginRestrictedImports]
|
|
4871
|
-
}
|
|
4872
|
-
},
|
|
4873
|
-
{
|
|
4874
|
-
files: ["src/rules/index.ts", "src/configs/**"],
|
|
4875
|
-
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
4876
|
-
},
|
|
4877
|
-
{
|
|
4878
|
-
files: ["src/utility/public/**"],
|
|
4879
|
-
rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions] }
|
|
4880
|
-
}
|
|
4881
|
-
];
|
|
4882
|
-
}
|
|
4883
|
-
|
|
4884
4828
|
//#endregion
|
|
4885
4829
|
//#region src/configs/helpers/restrictedImports/neurosongsBackEndRestrictedImports.ts
|
|
4886
4830
|
const neurosongsBackEndRestrictedImports = combineRestrictedImports(personalRestrictedImports, { paths: [
|
|
@@ -4965,7 +4909,7 @@ function internalTypeScript(plugin) {
|
|
|
4965
4909
|
name: "@alextheman/internal/typescript",
|
|
4966
4910
|
plugins: {
|
|
4967
4911
|
"@alextheman": plugin,
|
|
4968
|
-
"@typescript-eslint":
|
|
4912
|
+
"@typescript-eslint": tseslint.plugin
|
|
4969
4913
|
},
|
|
4970
4914
|
rules: {
|
|
4971
4915
|
"@alextheman/standardise-error-messages": "error",
|
|
@@ -4980,12 +4924,87 @@ function internalTypeScript(plugin) {
|
|
|
4980
4924
|
}
|
|
4981
4925
|
|
|
4982
4926
|
//#endregion
|
|
4983
|
-
//#region src/configs/
|
|
4984
|
-
|
|
4927
|
+
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
4928
|
+
const eslintPluginRestrictedImports = combineRestrictedImports(generalRestrictedImports, { paths: [
|
|
4929
|
+
{
|
|
4930
|
+
importNames: ["default"],
|
|
4931
|
+
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
4932
|
+
name: "src/alexPlugin"
|
|
4933
|
+
},
|
|
4934
|
+
...["src/index", "src"].map((name) => {
|
|
4935
|
+
return {
|
|
4936
|
+
message: "Do not import directly from the index file.",
|
|
4937
|
+
name
|
|
4938
|
+
};
|
|
4939
|
+
}),
|
|
4940
|
+
{
|
|
4941
|
+
importNames: ["default"],
|
|
4942
|
+
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
|
|
4943
|
+
name: "eslint-plugin-react-hooks"
|
|
4944
|
+
},
|
|
4945
|
+
{
|
|
4946
|
+
importNames: ["createRuleTester"],
|
|
4947
|
+
message: "Please import createRuleTester from \"tests/rule-testers/createRuleTester\" instead.",
|
|
4948
|
+
name: "eslint-vitest-rule-tester"
|
|
4949
|
+
}
|
|
4950
|
+
] });
|
|
4951
|
+
|
|
4952
|
+
//#endregion
|
|
4953
|
+
//#region src/configs/internal/eslintPlugin/base.ts
|
|
4954
|
+
function internalEslintPluginBase(plugin) {
|
|
4955
|
+
return [...combinedTypeScriptPackage(plugin), {
|
|
4956
|
+
name: "@alextheman/internal/eslint-plugin-base",
|
|
4957
|
+
plugins: {
|
|
4958
|
+
"@alextheman": plugin,
|
|
4959
|
+
jsdoc
|
|
4960
|
+
},
|
|
4961
|
+
rules: {
|
|
4962
|
+
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
4963
|
+
"jsdoc/require-jsdoc": "off",
|
|
4964
|
+
"no-restricted-imports": ["error", eslintPluginRestrictedImports]
|
|
4965
|
+
}
|
|
4966
|
+
}];
|
|
4967
|
+
}
|
|
4968
|
+
|
|
4969
|
+
//#endregion
|
|
4970
|
+
//#region src/configs/internal/eslintPlugin/configs.ts
|
|
4971
|
+
function internalEslintPluginConfigs(plugin) {
|
|
4972
|
+
return [...internalEslintPluginBase(plugin), {
|
|
4973
|
+
files: ["**/*.ts"],
|
|
4974
|
+
name: "@alextheman/internal/eslint-plugin-configs",
|
|
4975
|
+
plugins: { perfectionist },
|
|
4976
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
4977
|
+
}];
|
|
4978
|
+
}
|
|
4979
|
+
|
|
4980
|
+
//#endregion
|
|
4981
|
+
//#region src/configs/internal/eslintPlugin/rules.ts
|
|
4982
|
+
function internalEslintPluginRules(plugin) {
|
|
4983
|
+
return [...internalEslintPluginBase(plugin), {
|
|
4984
|
+
files: ["index.ts"],
|
|
4985
|
+
name: "@alextheman/internal/eslint-plugin-rules",
|
|
4986
|
+
plugins: { perfectionist },
|
|
4987
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects] }
|
|
4988
|
+
}];
|
|
4989
|
+
}
|
|
4990
|
+
|
|
4991
|
+
//#endregion
|
|
4992
|
+
//#region src/configs/internal/eslintPlugin/utility.ts
|
|
4993
|
+
function internalEslintPluginUtility(plugin) {
|
|
4994
|
+
return [...internalEslintPluginBase(plugin), {
|
|
4995
|
+
files: ["**/*.ts"],
|
|
4996
|
+
name: "@alextheman/internal/eslint-plugin-utility",
|
|
4997
|
+
rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions] }
|
|
4998
|
+
}];
|
|
4999
|
+
}
|
|
5000
|
+
|
|
5001
|
+
//#endregion
|
|
5002
|
+
//#region src/configs/internal/utility/base.ts
|
|
5003
|
+
function internalUtilityBase(plugin) {
|
|
4985
5004
|
return [...combinedTypeScriptPackage(plugin), {
|
|
4986
5005
|
name: "@alextheman/internal/utility",
|
|
4987
5006
|
plugins: {
|
|
4988
|
-
"@typescript-eslint":
|
|
5007
|
+
"@typescript-eslint": tseslint.plugin,
|
|
4989
5008
|
jsdoc
|
|
4990
5009
|
},
|
|
4991
5010
|
rules: {
|
|
@@ -4995,6 +5014,21 @@ function internalUtility(plugin) {
|
|
|
4995
5014
|
}];
|
|
4996
5015
|
}
|
|
4997
5016
|
|
|
5017
|
+
//#endregion
|
|
5018
|
+
//#region src/configs/internal/utility/internal.ts
|
|
5019
|
+
function internalUtilityRoot$1(plugin) {
|
|
5020
|
+
return [...internalUtilityBase(plugin), { rules: { "jsdoc/require-jsdoc": "off" } }];
|
|
5021
|
+
}
|
|
5022
|
+
|
|
5023
|
+
//#endregion
|
|
5024
|
+
//#region src/configs/internal/utility/root.ts
|
|
5025
|
+
function internalUtilityRoot(plugin) {
|
|
5026
|
+
return [...internalUtilityBase(plugin), { rules: { "no-restricted-imports": ["error", combineRestrictedImports(personalRestrictedImports, { patterns: [{
|
|
5027
|
+
group: ["node:"],
|
|
5028
|
+
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."
|
|
5029
|
+
}] })] } }];
|
|
5030
|
+
}
|
|
5031
|
+
|
|
4998
5032
|
//#endregion
|
|
4999
5033
|
//#region src/configs/combined/typeScript.ts
|
|
5000
5034
|
function combinedTypeScript(plugin) {
|
|
@@ -5032,13 +5066,13 @@ function combinedTypeScriptReact(plugin) {
|
|
|
5032
5066
|
function createAlexPluginConfigs(plugin) {
|
|
5033
5067
|
return flattenConfigs({
|
|
5034
5068
|
combined: {
|
|
5035
|
-
javascript:
|
|
5036
|
-
javascriptReact:
|
|
5037
|
-
react:
|
|
5038
|
-
tests:
|
|
5039
|
-
typescript:
|
|
5040
|
-
typescriptPackage:
|
|
5041
|
-
typescriptReact:
|
|
5069
|
+
javascript: combinedJavaScript(plugin),
|
|
5070
|
+
javascriptReact: combinedJavaScriptReact(plugin),
|
|
5071
|
+
react: combinedReact,
|
|
5072
|
+
tests: combinedTests(plugin),
|
|
5073
|
+
typescript: combinedTypeScript(plugin),
|
|
5074
|
+
typescriptPackage: combinedTypeScriptPackage(plugin),
|
|
5075
|
+
typescriptReact: combinedTypeScriptReact(plugin)
|
|
5042
5076
|
},
|
|
5043
5077
|
general: {
|
|
5044
5078
|
javascript: generalJavaScript,
|
|
@@ -5049,7 +5083,10 @@ function createAlexPluginConfigs(plugin) {
|
|
|
5049
5083
|
internal: {
|
|
5050
5084
|
alexCLine: internalAlexCLine(plugin),
|
|
5051
5085
|
components: internalComponents,
|
|
5052
|
-
|
|
5086
|
+
eslintPluginBase: internalEslintPluginBase(plugin),
|
|
5087
|
+
eslintPluginConfigs: internalEslintPluginConfigs(plugin),
|
|
5088
|
+
eslintPluginRules: internalEslintPluginRules(plugin),
|
|
5089
|
+
eslintPluginUtility: internalEslintPluginUtility(plugin),
|
|
5053
5090
|
javascript: internalJavaScript(plugin),
|
|
5054
5091
|
jsdoc: internalJsdoc,
|
|
5055
5092
|
neurosongsBackEnd: internalNeurosongsBackEnd,
|
|
@@ -5057,7 +5094,9 @@ function createAlexPluginConfigs(plugin) {
|
|
|
5057
5094
|
react: internalReact,
|
|
5058
5095
|
tests: internalTests,
|
|
5059
5096
|
typescript: internalTypeScript(plugin),
|
|
5060
|
-
|
|
5097
|
+
utilityBase: internalUtilityBase(plugin),
|
|
5098
|
+
utilityInternal: internalUtilityRoot$1(plugin),
|
|
5099
|
+
utilityRoot: internalUtilityRoot(plugin)
|
|
5061
5100
|
},
|
|
5062
5101
|
plugin: {
|
|
5063
5102
|
base: pluginBase(plugin),
|
|
@@ -5461,7 +5500,7 @@ var rules_default = {
|
|
|
5461
5500
|
//#endregion
|
|
5462
5501
|
//#region package.json
|
|
5463
5502
|
var name = "@alextheman/eslint-plugin";
|
|
5464
|
-
var version = "5.
|
|
5503
|
+
var version = "5.7.1";
|
|
5465
5504
|
|
|
5466
5505
|
//#endregion
|
|
5467
5506
|
//#region src/alexPlugin.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.1",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@alextheman/utility": "^4.
|
|
32
|
+
"@alextheman/utility": "^4.15.0",
|
|
33
33
|
"@eslint/compat": "^2.0.2",
|
|
34
|
-
"@typescript-eslint/types": "^8.
|
|
35
|
-
"@typescript-eslint/utils": "^8.
|
|
34
|
+
"@typescript-eslint/types": "^8.55.0",
|
|
35
|
+
"@typescript-eslint/utils": "^8.55.0",
|
|
36
36
|
"common-tags": "^1.8.2",
|
|
37
37
|
"prettier": "^3.8.1",
|
|
38
38
|
"zod": "^4.3.6"
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"@types/common-tags": "^1.8.4",
|
|
43
43
|
"@types/eslint": "^9.6.1",
|
|
44
44
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
45
|
-
"@types/node": "^25.2.
|
|
46
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
47
|
-
"alex-c-line": "^1.
|
|
45
|
+
"@types/node": "^25.2.3",
|
|
46
|
+
"@typescript-eslint/rule-tester": "^8.55.0",
|
|
47
|
+
"alex-c-line": "^1.26.2",
|
|
48
48
|
"dotenv-cli": "^11.0.0",
|
|
49
49
|
"eslint": "^10.0.0",
|
|
50
50
|
"eslint-config-prettier": "^10.1.8",
|
|
51
51
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
52
52
|
"eslint-plugin-import": "^2.32.0",
|
|
53
|
-
"eslint-plugin-jsdoc": "^62.5.
|
|
53
|
+
"eslint-plugin-jsdoc": "^62.5.4",
|
|
54
54
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
55
55
|
"eslint-plugin-n": "^17.23.2",
|
|
56
56
|
"eslint-plugin-package-json": "^0.88.2",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"jsdom": "^28.0.0",
|
|
66
66
|
"tsdown": "^0.20.3",
|
|
67
67
|
"tsx": "^4.21.0",
|
|
68
|
-
"typedoc": "^0.28.
|
|
68
|
+
"typedoc": "^0.28.17",
|
|
69
69
|
"typedoc-plugin-markdown": "^4.10.0",
|
|
70
70
|
"typedoc-rhineai-theme": "^1.2.0",
|
|
71
71
|
"typescript": "^5.9.3",
|
|
72
|
-
"typescript-eslint": "^8.
|
|
73
|
-
"vite-tsconfig-paths": "^6.
|
|
72
|
+
"typescript-eslint": "^8.56.0",
|
|
73
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
74
74
|
"vitest": "^4.0.18"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|