@alextheman/eslint-plugin 4.2.0 → 4.2.2
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 +105 -93
- package/dist/index.d.cts +31 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +102 -92
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,11 @@ let eslint_plugin_perfectionist = require("eslint-plugin-perfectionist");
|
|
|
37
37
|
eslint_plugin_perfectionist = __toESM(eslint_plugin_perfectionist);
|
|
38
38
|
let eslint_plugin_prettier = require("eslint-plugin-prettier");
|
|
39
39
|
eslint_plugin_prettier = __toESM(eslint_plugin_prettier);
|
|
40
|
+
let typescript_eslint = require("typescript-eslint");
|
|
41
|
+
typescript_eslint = __toESM(typescript_eslint);
|
|
42
|
+
let vite_tsconfig_paths = require("vite-tsconfig-paths");
|
|
43
|
+
vite_tsconfig_paths = __toESM(vite_tsconfig_paths);
|
|
44
|
+
let vitest_config = require("vitest/config");
|
|
40
45
|
let eslint_plugin_jsx_a11y = require("eslint-plugin-jsx-a11y");
|
|
41
46
|
eslint_plugin_jsx_a11y = __toESM(eslint_plugin_jsx_a11y);
|
|
42
47
|
let eslint_plugin_react = require("eslint-plugin-react");
|
|
@@ -46,20 +51,15 @@ eslint_plugin_react_refresh = __toESM(eslint_plugin_react_refresh);
|
|
|
46
51
|
let __alextheman_utility = require("@alextheman/utility");
|
|
47
52
|
let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
|
|
48
53
|
eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks);
|
|
49
|
-
let typescript_eslint = require("typescript-eslint");
|
|
50
|
-
typescript_eslint = __toESM(typescript_eslint);
|
|
51
54
|
let eslint_plugin_package_json = require("eslint-plugin-package-json");
|
|
52
55
|
eslint_plugin_package_json = __toESM(eslint_plugin_package_json);
|
|
53
56
|
let __typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
54
57
|
let zod = require("zod");
|
|
55
58
|
zod = __toESM(zod);
|
|
56
|
-
let vite_tsconfig_paths = require("vite-tsconfig-paths");
|
|
57
|
-
vite_tsconfig_paths = __toESM(vite_tsconfig_paths);
|
|
58
|
-
let vitest_config = require("vitest/config");
|
|
59
59
|
|
|
60
60
|
//#region package.json
|
|
61
61
|
var name = "@alextheman/eslint-plugin";
|
|
62
|
-
var version = "4.2.
|
|
62
|
+
var version = "4.2.2";
|
|
63
63
|
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region node_modules/globals/globals.json
|
|
@@ -3890,6 +3890,101 @@ var javaScriptBase_default$1 = javaScriptBase;
|
|
|
3890
3890
|
const prettierRules = { printWidth: 100 };
|
|
3891
3891
|
var prettierRules_default = prettierRules;
|
|
3892
3892
|
|
|
3893
|
+
//#endregion
|
|
3894
|
+
//#region src/configs/helpers/reactLanguageOptions.ts
|
|
3895
|
+
var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
|
|
3896
|
+
const reactLanguageOptions = {
|
|
3897
|
+
ecmaVersion: 2020,
|
|
3898
|
+
globals: import_globals.default.browser,
|
|
3899
|
+
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
3900
|
+
};
|
|
3901
|
+
var reactLanguageOptions_default = reactLanguageOptions;
|
|
3902
|
+
|
|
3903
|
+
//#endregion
|
|
3904
|
+
//#region src/configs/helpers/sorting/sortExports.ts
|
|
3905
|
+
const sortExports = {
|
|
3906
|
+
customGroups: [],
|
|
3907
|
+
fallbackSort: { type: "natural" },
|
|
3908
|
+
groups: ["value-export", "type-export"],
|
|
3909
|
+
ignoreCase: true,
|
|
3910
|
+
newlinesBetween: 1,
|
|
3911
|
+
order: "asc",
|
|
3912
|
+
partitionByComment: false,
|
|
3913
|
+
partitionByNewLine: false,
|
|
3914
|
+
specialCharacters: "keep",
|
|
3915
|
+
type: "alphabetical"
|
|
3916
|
+
};
|
|
3917
|
+
var sortExports_default = sortExports;
|
|
3918
|
+
|
|
3919
|
+
//#endregion
|
|
3920
|
+
//#region src/configs/helpers/sorting/sortImports.ts
|
|
3921
|
+
const sortImports = {
|
|
3922
|
+
groups: [
|
|
3923
|
+
"type",
|
|
3924
|
+
"builtin",
|
|
3925
|
+
"external",
|
|
3926
|
+
"internal",
|
|
3927
|
+
"object"
|
|
3928
|
+
],
|
|
3929
|
+
ignoreCase: true,
|
|
3930
|
+
internalPattern: ["^src/.*"],
|
|
3931
|
+
newlinesBetween: 1,
|
|
3932
|
+
order: "asc",
|
|
3933
|
+
partitionByComment: false,
|
|
3934
|
+
partitionByNewLine: false,
|
|
3935
|
+
specialCharacters: "keep",
|
|
3936
|
+
type: "alphabetical"
|
|
3937
|
+
};
|
|
3938
|
+
var sortImports_default = sortImports;
|
|
3939
|
+
|
|
3940
|
+
//#endregion
|
|
3941
|
+
//#region src/configs/helpers/sorting/sortObjects.ts
|
|
3942
|
+
const sortObjects = {
|
|
3943
|
+
customGroups: [],
|
|
3944
|
+
destructuredObjects: true,
|
|
3945
|
+
fallbackSort: { type: "unsorted" },
|
|
3946
|
+
groups: [],
|
|
3947
|
+
ignoreCase: true,
|
|
3948
|
+
ignorePattern: [],
|
|
3949
|
+
newlinesBetween: "ignore",
|
|
3950
|
+
objectDeclarations: true,
|
|
3951
|
+
order: "asc",
|
|
3952
|
+
partitionByComment: false,
|
|
3953
|
+
partitionByNewLine: false,
|
|
3954
|
+
specialCharacters: "keep",
|
|
3955
|
+
styledComponents: true,
|
|
3956
|
+
type: "alphabetical",
|
|
3957
|
+
useConfigurationIf: {}
|
|
3958
|
+
};
|
|
3959
|
+
var sortObjects_default = sortObjects;
|
|
3960
|
+
|
|
3961
|
+
//#endregion
|
|
3962
|
+
//#region src/configs/helpers/typeScriptLanguageOptions.ts
|
|
3963
|
+
const typeScriptLanguageOptions = {
|
|
3964
|
+
parser: typescript_eslint.default.parser,
|
|
3965
|
+
parserOptions: {
|
|
3966
|
+
ecmaVersion: "latest",
|
|
3967
|
+
projectService: true,
|
|
3968
|
+
sourceType: "module",
|
|
3969
|
+
tsconfigRootDir: process.cwd()
|
|
3970
|
+
}
|
|
3971
|
+
};
|
|
3972
|
+
var typeScriptLanguageOptions_default = typeScriptLanguageOptions;
|
|
3973
|
+
|
|
3974
|
+
//#endregion
|
|
3975
|
+
//#region src/configs/helpers/vitestConfig.ts
|
|
3976
|
+
function vitestConfig(environment = "jsdom") {
|
|
3977
|
+
return (0, vitest_config.defineConfig)({
|
|
3978
|
+
plugins: [(0, vite_tsconfig_paths.default)()],
|
|
3979
|
+
test: {
|
|
3980
|
+
environment,
|
|
3981
|
+
globals: true,
|
|
3982
|
+
include: ["**/tests/**/*.test.ts"]
|
|
3983
|
+
}
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3986
|
+
var vitestConfig_default = vitestConfig;
|
|
3987
|
+
|
|
3893
3988
|
//#endregion
|
|
3894
3989
|
//#region src/configs/personal/javaScriptBase.ts
|
|
3895
3990
|
function createPersonalJavaScriptBaseConfig(plugin) {
|
|
@@ -3919,35 +4014,8 @@ function createPersonalJavaScriptBaseConfig(plugin) {
|
|
|
3919
4014
|
"no-else-return": "error",
|
|
3920
4015
|
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
3921
4016
|
"operator-assignment": ["error", "always"],
|
|
3922
|
-
"perfectionist/sort-exports": ["error",
|
|
3923
|
-
|
|
3924
|
-
fallbackSort: { type: "natural" },
|
|
3925
|
-
groups: ["value-export", "type-export"],
|
|
3926
|
-
ignoreCase: true,
|
|
3927
|
-
newlinesBetween: 1,
|
|
3928
|
-
order: "asc",
|
|
3929
|
-
partitionByComment: false,
|
|
3930
|
-
partitionByNewLine: false,
|
|
3931
|
-
specialCharacters: "keep",
|
|
3932
|
-
type: "alphabetical"
|
|
3933
|
-
}],
|
|
3934
|
-
"perfectionist/sort-imports": ["error", {
|
|
3935
|
-
groups: [
|
|
3936
|
-
"type",
|
|
3937
|
-
"builtin",
|
|
3938
|
-
"external",
|
|
3939
|
-
"internal",
|
|
3940
|
-
"object"
|
|
3941
|
-
],
|
|
3942
|
-
ignoreCase: true,
|
|
3943
|
-
internalPattern: ["^src/.*"],
|
|
3944
|
-
newlinesBetween: 1,
|
|
3945
|
-
order: "asc",
|
|
3946
|
-
partitionByComment: false,
|
|
3947
|
-
partitionByNewLine: false,
|
|
3948
|
-
specialCharacters: "keep",
|
|
3949
|
-
type: "alphabetical"
|
|
3950
|
-
}],
|
|
4017
|
+
"perfectionist/sort-exports": ["error", sortExports_default],
|
|
4018
|
+
"perfectionist/sort-imports": ["error", sortImports_default],
|
|
3951
4019
|
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3952
4020
|
"prefer-destructuring": "error",
|
|
3953
4021
|
"prefer-template": "error",
|
|
@@ -3986,16 +4054,6 @@ const reactHooks = {
|
|
|
3986
4054
|
};
|
|
3987
4055
|
var eslint_plugin_react_hooks_default = reactHooks;
|
|
3988
4056
|
|
|
3989
|
-
//#endregion
|
|
3990
|
-
//#region src/configs/helpers/reactLanguageOptions.ts
|
|
3991
|
-
var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
|
|
3992
|
-
const reactLanguageOptions = {
|
|
3993
|
-
ecmaVersion: 2020,
|
|
3994
|
-
globals: import_globals.default.browser,
|
|
3995
|
-
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
3996
|
-
};
|
|
3997
|
-
var reactLanguageOptions_default = reactLanguageOptions;
|
|
3998
|
-
|
|
3999
4057
|
//#endregion
|
|
4000
4058
|
//#region src/configs/general/reactBase.ts
|
|
4001
4059
|
const reactBase = [
|
|
@@ -4075,19 +4133,6 @@ function createCombinedJavaScriptReactBaseConfig(plugin) {
|
|
|
4075
4133
|
}
|
|
4076
4134
|
var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
|
|
4077
4135
|
|
|
4078
|
-
//#endregion
|
|
4079
|
-
//#region src/configs/helpers/typeScriptLanguageOptions.ts
|
|
4080
|
-
const typeScriptLanguageOptions = {
|
|
4081
|
-
parser: typescript_eslint.default.parser,
|
|
4082
|
-
parserOptions: {
|
|
4083
|
-
ecmaVersion: "latest",
|
|
4084
|
-
projectService: true,
|
|
4085
|
-
sourceType: "module",
|
|
4086
|
-
tsconfigRootDir: process.cwd()
|
|
4087
|
-
}
|
|
4088
|
-
};
|
|
4089
|
-
var typeScriptLanguageOptions_default = typeScriptLanguageOptions;
|
|
4090
|
-
|
|
4091
4136
|
//#endregion
|
|
4092
4137
|
//#region src/configs/general/typeScriptBase.ts
|
|
4093
4138
|
const typeScriptBase = [
|
|
@@ -4113,27 +4158,6 @@ const typeScriptBase = [
|
|
|
4113
4158
|
];
|
|
4114
4159
|
var typeScriptBase_default$1 = typeScriptBase;
|
|
4115
4160
|
|
|
4116
|
-
//#endregion
|
|
4117
|
-
//#region src/configs/helpers/sortObjects.ts
|
|
4118
|
-
const sortObjects = {
|
|
4119
|
-
customGroups: [],
|
|
4120
|
-
destructuredObjects: true,
|
|
4121
|
-
fallbackSort: { type: "unsorted" },
|
|
4122
|
-
groups: [],
|
|
4123
|
-
ignoreCase: true,
|
|
4124
|
-
ignorePattern: [],
|
|
4125
|
-
newlinesBetween: "ignore",
|
|
4126
|
-
objectDeclarations: true,
|
|
4127
|
-
order: "asc",
|
|
4128
|
-
partitionByComment: false,
|
|
4129
|
-
partitionByNewLine: false,
|
|
4130
|
-
specialCharacters: "keep",
|
|
4131
|
-
styledComponents: true,
|
|
4132
|
-
type: "alphabetical",
|
|
4133
|
-
useConfigurationIf: {}
|
|
4134
|
-
};
|
|
4135
|
-
var sortObjects_default = sortObjects;
|
|
4136
|
-
|
|
4137
4161
|
//#endregion
|
|
4138
4162
|
//#region src/configs/personal/eslintPlugin.ts
|
|
4139
4163
|
function createPersonalEslintPluginConfig(plugin) {
|
|
@@ -4830,20 +4854,6 @@ const alexPlugin = {
|
|
|
4830
4854
|
alexPlugin.configs = configs_default(alexPlugin);
|
|
4831
4855
|
var alexPlugin_default = alexPlugin;
|
|
4832
4856
|
|
|
4833
|
-
//#endregion
|
|
4834
|
-
//#region src/configs/helpers/vitestConfig.ts
|
|
4835
|
-
function vitestConfig(environment = "jsdom") {
|
|
4836
|
-
return (0, vitest_config.defineConfig)({
|
|
4837
|
-
plugins: [(0, vite_tsconfig_paths.default)()],
|
|
4838
|
-
test: {
|
|
4839
|
-
environment,
|
|
4840
|
-
globals: true,
|
|
4841
|
-
include: ["**/tests/**/*.test.ts"]
|
|
4842
|
-
}
|
|
4843
|
-
});
|
|
4844
|
-
}
|
|
4845
|
-
var vitestConfig_default = vitestConfig;
|
|
4846
|
-
|
|
4847
4857
|
//#endregion
|
|
4848
4858
|
//#region src/index.ts
|
|
4849
4859
|
var src_default = alexPlugin_default;
|
|
@@ -4862,6 +4872,8 @@ exports.parseTestFunction = parseTestFunction;
|
|
|
4862
4872
|
exports.parseUseNormalizedImportsOptions = parseUseNormalizedImportsOptions;
|
|
4863
4873
|
exports.prettierRules = prettierRules_default;
|
|
4864
4874
|
exports.reactLanguageOptions = reactLanguageOptions_default;
|
|
4875
|
+
exports.sortExports = sortExports_default;
|
|
4876
|
+
exports.sortImports = sortImports_default;
|
|
4865
4877
|
exports.sortObjects = sortObjects_default;
|
|
4866
4878
|
exports.typeScriptLanguageOptions = typeScriptLanguageOptions_default;
|
|
4867
4879
|
exports.unusedVarsIgnorePatterns = unusedVarsIgnorePatterns_default;
|
package/dist/index.d.cts
CHANGED
|
@@ -50,7 +50,36 @@ declare const prettierRules: Config;
|
|
|
50
50
|
//#region src/configs/helpers/reactLanguageOptions.d.ts
|
|
51
51
|
declare const reactLanguageOptions: Linter.LanguageOptions;
|
|
52
52
|
//#endregion
|
|
53
|
-
//#region src/configs/helpers/
|
|
53
|
+
//#region src/configs/helpers/sorting/sortExports.d.ts
|
|
54
|
+
declare const sortExports: {
|
|
55
|
+
customGroups: never[];
|
|
56
|
+
fallbackSort: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
groups: string[];
|
|
60
|
+
ignoreCase: boolean;
|
|
61
|
+
newlinesBetween: number;
|
|
62
|
+
order: string;
|
|
63
|
+
partitionByComment: boolean;
|
|
64
|
+
partitionByNewLine: boolean;
|
|
65
|
+
specialCharacters: string;
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/configs/helpers/sorting/sortImports.d.ts
|
|
70
|
+
declare const sortImports: {
|
|
71
|
+
groups: string[];
|
|
72
|
+
ignoreCase: boolean;
|
|
73
|
+
internalPattern: string[];
|
|
74
|
+
newlinesBetween: number;
|
|
75
|
+
order: string;
|
|
76
|
+
partitionByComment: boolean;
|
|
77
|
+
partitionByNewLine: boolean;
|
|
78
|
+
specialCharacters: string;
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/configs/helpers/sorting/sortObjects.d.ts
|
|
54
83
|
declare const sortObjects: {
|
|
55
84
|
customGroups: never[];
|
|
56
85
|
destructuredObjects: boolean;
|
|
@@ -146,4 +175,4 @@ declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<
|
|
|
146
175
|
preference: string;
|
|
147
176
|
}]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
148
177
|
//#endregion
|
|
149
|
-
export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, ConsistentTestFunctionOptions, GeneralConfig, NoNamespaceImportsOptions, NoRelativeImportsOptions, PersonalConfig, PluginConfig, RuleFixerFunction, StandardiseErrorMessagesOptions, TestFunction, UseNormalizedImportsOptions, checkCallExpression, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns, vitestConfig };
|
|
178
|
+
export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, ConsistentTestFunctionOptions, GeneralConfig, NoNamespaceImportsOptions, NoRelativeImportsOptions, PersonalConfig, PluginConfig, RuleFixerFunction, StandardiseErrorMessagesOptions, TestFunction, UseNormalizedImportsOptions, checkCallExpression, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortExports, sortImports, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns, vitestConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,36 @@ declare const prettierRules: Config;
|
|
|
50
50
|
//#region src/configs/helpers/reactLanguageOptions.d.ts
|
|
51
51
|
declare const reactLanguageOptions: Linter.LanguageOptions;
|
|
52
52
|
//#endregion
|
|
53
|
-
//#region src/configs/helpers/
|
|
53
|
+
//#region src/configs/helpers/sorting/sortExports.d.ts
|
|
54
|
+
declare const sortExports: {
|
|
55
|
+
customGroups: never[];
|
|
56
|
+
fallbackSort: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
groups: string[];
|
|
60
|
+
ignoreCase: boolean;
|
|
61
|
+
newlinesBetween: number;
|
|
62
|
+
order: string;
|
|
63
|
+
partitionByComment: boolean;
|
|
64
|
+
partitionByNewLine: boolean;
|
|
65
|
+
specialCharacters: string;
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/configs/helpers/sorting/sortImports.d.ts
|
|
70
|
+
declare const sortImports: {
|
|
71
|
+
groups: string[];
|
|
72
|
+
ignoreCase: boolean;
|
|
73
|
+
internalPattern: string[];
|
|
74
|
+
newlinesBetween: number;
|
|
75
|
+
order: string;
|
|
76
|
+
partitionByComment: boolean;
|
|
77
|
+
partitionByNewLine: boolean;
|
|
78
|
+
specialCharacters: string;
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/configs/helpers/sorting/sortObjects.d.ts
|
|
54
83
|
declare const sortObjects: {
|
|
55
84
|
customGroups: never[];
|
|
56
85
|
destructuredObjects: boolean;
|
|
@@ -146,4 +175,4 @@ declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<
|
|
|
146
175
|
preference: string;
|
|
147
176
|
}]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
148
177
|
//#endregion
|
|
149
|
-
export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, type ConsistentTestFunctionOptions, GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, PersonalConfig, PluginConfig, type RuleFixerFunction, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, checkCallExpression, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns, vitestConfig };
|
|
178
|
+
export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, type ConsistentTestFunctionOptions, GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, PersonalConfig, PluginConfig, type RuleFixerFunction, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, checkCallExpression, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortExports, sortImports, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns, vitestConfig };
|
package/dist/index.js
CHANGED
|
@@ -2,17 +2,17 @@ import prettierConfig from "eslint-config-prettier";
|
|
|
2
2
|
import importPlugin from "eslint-plugin-import";
|
|
3
3
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
4
4
|
import prettierPlugin from "eslint-plugin-prettier";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
7
|
+
import { defineConfig } from "vitest/config";
|
|
5
8
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
6
9
|
import reactPlugin from "eslint-plugin-react";
|
|
7
10
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
8
11
|
import { camelToKebab, normalizeImportPath, omitProperties } from "@alextheman/utility";
|
|
9
12
|
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
10
|
-
import tseslint from "typescript-eslint";
|
|
11
13
|
import packageJson from "eslint-plugin-package-json";
|
|
12
14
|
import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
13
15
|
import z from "zod";
|
|
14
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
15
|
-
import { defineConfig } from "vitest/config";
|
|
16
16
|
|
|
17
17
|
//#region rolldown:runtime
|
|
18
18
|
var __create = Object.create;
|
|
@@ -46,7 +46,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region package.json
|
|
48
48
|
var name = "@alextheman/eslint-plugin";
|
|
49
|
-
var version = "4.2.
|
|
49
|
+
var version = "4.2.2";
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region node_modules/globals/globals.json
|
|
@@ -3877,6 +3877,101 @@ var javaScriptBase_default$1 = javaScriptBase;
|
|
|
3877
3877
|
const prettierRules = { printWidth: 100 };
|
|
3878
3878
|
var prettierRules_default = prettierRules;
|
|
3879
3879
|
|
|
3880
|
+
//#endregion
|
|
3881
|
+
//#region src/configs/helpers/reactLanguageOptions.ts
|
|
3882
|
+
var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
|
|
3883
|
+
const reactLanguageOptions = {
|
|
3884
|
+
ecmaVersion: 2020,
|
|
3885
|
+
globals: import_globals.default.browser,
|
|
3886
|
+
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
3887
|
+
};
|
|
3888
|
+
var reactLanguageOptions_default = reactLanguageOptions;
|
|
3889
|
+
|
|
3890
|
+
//#endregion
|
|
3891
|
+
//#region src/configs/helpers/sorting/sortExports.ts
|
|
3892
|
+
const sortExports = {
|
|
3893
|
+
customGroups: [],
|
|
3894
|
+
fallbackSort: { type: "natural" },
|
|
3895
|
+
groups: ["value-export", "type-export"],
|
|
3896
|
+
ignoreCase: true,
|
|
3897
|
+
newlinesBetween: 1,
|
|
3898
|
+
order: "asc",
|
|
3899
|
+
partitionByComment: false,
|
|
3900
|
+
partitionByNewLine: false,
|
|
3901
|
+
specialCharacters: "keep",
|
|
3902
|
+
type: "alphabetical"
|
|
3903
|
+
};
|
|
3904
|
+
var sortExports_default = sortExports;
|
|
3905
|
+
|
|
3906
|
+
//#endregion
|
|
3907
|
+
//#region src/configs/helpers/sorting/sortImports.ts
|
|
3908
|
+
const sortImports = {
|
|
3909
|
+
groups: [
|
|
3910
|
+
"type",
|
|
3911
|
+
"builtin",
|
|
3912
|
+
"external",
|
|
3913
|
+
"internal",
|
|
3914
|
+
"object"
|
|
3915
|
+
],
|
|
3916
|
+
ignoreCase: true,
|
|
3917
|
+
internalPattern: ["^src/.*"],
|
|
3918
|
+
newlinesBetween: 1,
|
|
3919
|
+
order: "asc",
|
|
3920
|
+
partitionByComment: false,
|
|
3921
|
+
partitionByNewLine: false,
|
|
3922
|
+
specialCharacters: "keep",
|
|
3923
|
+
type: "alphabetical"
|
|
3924
|
+
};
|
|
3925
|
+
var sortImports_default = sortImports;
|
|
3926
|
+
|
|
3927
|
+
//#endregion
|
|
3928
|
+
//#region src/configs/helpers/sorting/sortObjects.ts
|
|
3929
|
+
const sortObjects = {
|
|
3930
|
+
customGroups: [],
|
|
3931
|
+
destructuredObjects: true,
|
|
3932
|
+
fallbackSort: { type: "unsorted" },
|
|
3933
|
+
groups: [],
|
|
3934
|
+
ignoreCase: true,
|
|
3935
|
+
ignorePattern: [],
|
|
3936
|
+
newlinesBetween: "ignore",
|
|
3937
|
+
objectDeclarations: true,
|
|
3938
|
+
order: "asc",
|
|
3939
|
+
partitionByComment: false,
|
|
3940
|
+
partitionByNewLine: false,
|
|
3941
|
+
specialCharacters: "keep",
|
|
3942
|
+
styledComponents: true,
|
|
3943
|
+
type: "alphabetical",
|
|
3944
|
+
useConfigurationIf: {}
|
|
3945
|
+
};
|
|
3946
|
+
var sortObjects_default = sortObjects;
|
|
3947
|
+
|
|
3948
|
+
//#endregion
|
|
3949
|
+
//#region src/configs/helpers/typeScriptLanguageOptions.ts
|
|
3950
|
+
const typeScriptLanguageOptions = {
|
|
3951
|
+
parser: tseslint.parser,
|
|
3952
|
+
parserOptions: {
|
|
3953
|
+
ecmaVersion: "latest",
|
|
3954
|
+
projectService: true,
|
|
3955
|
+
sourceType: "module",
|
|
3956
|
+
tsconfigRootDir: process.cwd()
|
|
3957
|
+
}
|
|
3958
|
+
};
|
|
3959
|
+
var typeScriptLanguageOptions_default = typeScriptLanguageOptions;
|
|
3960
|
+
|
|
3961
|
+
//#endregion
|
|
3962
|
+
//#region src/configs/helpers/vitestConfig.ts
|
|
3963
|
+
function vitestConfig(environment = "jsdom") {
|
|
3964
|
+
return defineConfig({
|
|
3965
|
+
plugins: [tsconfigPaths()],
|
|
3966
|
+
test: {
|
|
3967
|
+
environment,
|
|
3968
|
+
globals: true,
|
|
3969
|
+
include: ["**/tests/**/*.test.ts"]
|
|
3970
|
+
}
|
|
3971
|
+
});
|
|
3972
|
+
}
|
|
3973
|
+
var vitestConfig_default = vitestConfig;
|
|
3974
|
+
|
|
3880
3975
|
//#endregion
|
|
3881
3976
|
//#region src/configs/personal/javaScriptBase.ts
|
|
3882
3977
|
function createPersonalJavaScriptBaseConfig(plugin) {
|
|
@@ -3906,35 +4001,8 @@ function createPersonalJavaScriptBaseConfig(plugin) {
|
|
|
3906
4001
|
"no-else-return": "error",
|
|
3907
4002
|
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
3908
4003
|
"operator-assignment": ["error", "always"],
|
|
3909
|
-
"perfectionist/sort-exports": ["error",
|
|
3910
|
-
|
|
3911
|
-
fallbackSort: { type: "natural" },
|
|
3912
|
-
groups: ["value-export", "type-export"],
|
|
3913
|
-
ignoreCase: true,
|
|
3914
|
-
newlinesBetween: 1,
|
|
3915
|
-
order: "asc",
|
|
3916
|
-
partitionByComment: false,
|
|
3917
|
-
partitionByNewLine: false,
|
|
3918
|
-
specialCharacters: "keep",
|
|
3919
|
-
type: "alphabetical"
|
|
3920
|
-
}],
|
|
3921
|
-
"perfectionist/sort-imports": ["error", {
|
|
3922
|
-
groups: [
|
|
3923
|
-
"type",
|
|
3924
|
-
"builtin",
|
|
3925
|
-
"external",
|
|
3926
|
-
"internal",
|
|
3927
|
-
"object"
|
|
3928
|
-
],
|
|
3929
|
-
ignoreCase: true,
|
|
3930
|
-
internalPattern: ["^src/.*"],
|
|
3931
|
-
newlinesBetween: 1,
|
|
3932
|
-
order: "asc",
|
|
3933
|
-
partitionByComment: false,
|
|
3934
|
-
partitionByNewLine: false,
|
|
3935
|
-
specialCharacters: "keep",
|
|
3936
|
-
type: "alphabetical"
|
|
3937
|
-
}],
|
|
4004
|
+
"perfectionist/sort-exports": ["error", sortExports_default],
|
|
4005
|
+
"perfectionist/sort-imports": ["error", sortImports_default],
|
|
3938
4006
|
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3939
4007
|
"prefer-destructuring": "error",
|
|
3940
4008
|
"prefer-template": "error",
|
|
@@ -3973,16 +4041,6 @@ const reactHooks = {
|
|
|
3973
4041
|
};
|
|
3974
4042
|
var eslint_plugin_react_hooks_default = reactHooks;
|
|
3975
4043
|
|
|
3976
|
-
//#endregion
|
|
3977
|
-
//#region src/configs/helpers/reactLanguageOptions.ts
|
|
3978
|
-
var import_globals = /* @__PURE__ */ __toESM(require_globals(), 1);
|
|
3979
|
-
const reactLanguageOptions = {
|
|
3980
|
-
ecmaVersion: 2020,
|
|
3981
|
-
globals: import_globals.default.browser,
|
|
3982
|
-
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
3983
|
-
};
|
|
3984
|
-
var reactLanguageOptions_default = reactLanguageOptions;
|
|
3985
|
-
|
|
3986
4044
|
//#endregion
|
|
3987
4045
|
//#region src/configs/general/reactBase.ts
|
|
3988
4046
|
const reactBase = [
|
|
@@ -4062,19 +4120,6 @@ function createCombinedJavaScriptReactBaseConfig(plugin) {
|
|
|
4062
4120
|
}
|
|
4063
4121
|
var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
|
|
4064
4122
|
|
|
4065
|
-
//#endregion
|
|
4066
|
-
//#region src/configs/helpers/typeScriptLanguageOptions.ts
|
|
4067
|
-
const typeScriptLanguageOptions = {
|
|
4068
|
-
parser: tseslint.parser,
|
|
4069
|
-
parserOptions: {
|
|
4070
|
-
ecmaVersion: "latest",
|
|
4071
|
-
projectService: true,
|
|
4072
|
-
sourceType: "module",
|
|
4073
|
-
tsconfigRootDir: process.cwd()
|
|
4074
|
-
}
|
|
4075
|
-
};
|
|
4076
|
-
var typeScriptLanguageOptions_default = typeScriptLanguageOptions;
|
|
4077
|
-
|
|
4078
4123
|
//#endregion
|
|
4079
4124
|
//#region src/configs/general/typeScriptBase.ts
|
|
4080
4125
|
const typeScriptBase = [
|
|
@@ -4100,27 +4145,6 @@ const typeScriptBase = [
|
|
|
4100
4145
|
];
|
|
4101
4146
|
var typeScriptBase_default$1 = typeScriptBase;
|
|
4102
4147
|
|
|
4103
|
-
//#endregion
|
|
4104
|
-
//#region src/configs/helpers/sortObjects.ts
|
|
4105
|
-
const sortObjects = {
|
|
4106
|
-
customGroups: [],
|
|
4107
|
-
destructuredObjects: true,
|
|
4108
|
-
fallbackSort: { type: "unsorted" },
|
|
4109
|
-
groups: [],
|
|
4110
|
-
ignoreCase: true,
|
|
4111
|
-
ignorePattern: [],
|
|
4112
|
-
newlinesBetween: "ignore",
|
|
4113
|
-
objectDeclarations: true,
|
|
4114
|
-
order: "asc",
|
|
4115
|
-
partitionByComment: false,
|
|
4116
|
-
partitionByNewLine: false,
|
|
4117
|
-
specialCharacters: "keep",
|
|
4118
|
-
styledComponents: true,
|
|
4119
|
-
type: "alphabetical",
|
|
4120
|
-
useConfigurationIf: {}
|
|
4121
|
-
};
|
|
4122
|
-
var sortObjects_default = sortObjects;
|
|
4123
|
-
|
|
4124
4148
|
//#endregion
|
|
4125
4149
|
//#region src/configs/personal/eslintPlugin.ts
|
|
4126
4150
|
function createPersonalEslintPluginConfig(plugin) {
|
|
@@ -4817,23 +4841,9 @@ const alexPlugin = {
|
|
|
4817
4841
|
alexPlugin.configs = configs_default(alexPlugin);
|
|
4818
4842
|
var alexPlugin_default = alexPlugin;
|
|
4819
4843
|
|
|
4820
|
-
//#endregion
|
|
4821
|
-
//#region src/configs/helpers/vitestConfig.ts
|
|
4822
|
-
function vitestConfig(environment = "jsdom") {
|
|
4823
|
-
return defineConfig({
|
|
4824
|
-
plugins: [tsconfigPaths()],
|
|
4825
|
-
test: {
|
|
4826
|
-
environment,
|
|
4827
|
-
globals: true,
|
|
4828
|
-
include: ["**/tests/**/*.test.ts"]
|
|
4829
|
-
}
|
|
4830
|
-
});
|
|
4831
|
-
}
|
|
4832
|
-
var vitestConfig_default = vitestConfig;
|
|
4833
|
-
|
|
4834
4844
|
//#endregion
|
|
4835
4845
|
//#region src/index.ts
|
|
4836
4846
|
var src_default = alexPlugin_default;
|
|
4837
4847
|
|
|
4838
4848
|
//#endregion
|
|
4839
|
-
export { checkCallExpression_default as checkCallExpression, createRuleSchemaFromZodSchema_default as createRuleSchemaFromZodSchema, src_default as default, fixOnCondition_default as fixOnCondition, getImportSpecifiersAfterRemoving_default as getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules_default as prettierRules, reactLanguageOptions_default as reactLanguageOptions, sortObjects_default as sortObjects, typeScriptLanguageOptions_default as typeScriptLanguageOptions, unusedVarsIgnorePatterns_default as unusedVarsIgnorePatterns, vitestConfig_default as vitestConfig };
|
|
4849
|
+
export { checkCallExpression_default as checkCallExpression, createRuleSchemaFromZodSchema_default as createRuleSchemaFromZodSchema, src_default as default, fixOnCondition_default as fixOnCondition, getImportSpecifiersAfterRemoving_default as getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules_default as prettierRules, reactLanguageOptions_default as reactLanguageOptions, sortExports_default as sortExports, sortImports_default as sortImports, sortObjects_default as sortObjects, typeScriptLanguageOptions_default as typeScriptLanguageOptions, unusedVarsIgnorePatterns_default as unusedVarsIgnorePatterns, vitestConfig_default as vitestConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"eslint-plugin-react": "^7.37.5",
|
|
66
66
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
67
67
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
68
|
+
"eslint-vitest-rule-tester": "^3.0.0",
|
|
68
69
|
"globals": "^16.5.0",
|
|
69
70
|
"husky": "^9.1.7",
|
|
70
71
|
"jsdom": "^27.2.0",
|