@alextheman/eslint-plugin 4.2.2 → 4.2.4
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 +36 -43
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +36 -43
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -6,9 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var
|
|
10
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
-
};
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
12
10
|
var __copyProps = (to, from, except, desc) => {
|
|
13
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
12
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -29,6 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
27
|
}) : target, mod));
|
|
30
28
|
|
|
31
29
|
//#endregion
|
|
30
|
+
let __alextheman_utility = require("@alextheman/utility");
|
|
32
31
|
let eslint_config_prettier = require("eslint-config-prettier");
|
|
33
32
|
eslint_config_prettier = __toESM(eslint_config_prettier);
|
|
34
33
|
let eslint_plugin_import = require("eslint-plugin-import");
|
|
@@ -48,7 +47,6 @@ let eslint_plugin_react = require("eslint-plugin-react");
|
|
|
48
47
|
eslint_plugin_react = __toESM(eslint_plugin_react);
|
|
49
48
|
let eslint_plugin_react_refresh = require("eslint-plugin-react-refresh");
|
|
50
49
|
eslint_plugin_react_refresh = __toESM(eslint_plugin_react_refresh);
|
|
51
|
-
let __alextheman_utility = require("@alextheman/utility");
|
|
52
50
|
let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
|
|
53
51
|
eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks);
|
|
54
52
|
let eslint_plugin_package_json = require("eslint-plugin-package-json");
|
|
@@ -59,11 +57,11 @@ zod = __toESM(zod);
|
|
|
59
57
|
|
|
60
58
|
//#region package.json
|
|
61
59
|
var name = "@alextheman/eslint-plugin";
|
|
62
|
-
var version = "4.2.
|
|
60
|
+
var version = "4.2.4";
|
|
63
61
|
|
|
64
62
|
//#endregion
|
|
65
63
|
//#region node_modules/globals/globals.json
|
|
66
|
-
var require_globals$1 = /* @__PURE__ */
|
|
64
|
+
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
67
65
|
module.exports = {
|
|
68
66
|
"amd": {
|
|
69
67
|
"define": false,
|
|
@@ -3407,13 +3405,13 @@ var require_globals$1 = /* @__PURE__ */ __commonJS({ "node_modules/globals/globa
|
|
|
3407
3405
|
"YUI_config": false
|
|
3408
3406
|
}
|
|
3409
3407
|
};
|
|
3410
|
-
})
|
|
3408
|
+
}));
|
|
3411
3409
|
|
|
3412
3410
|
//#endregion
|
|
3413
3411
|
//#region node_modules/globals/index.js
|
|
3414
|
-
var require_globals = /* @__PURE__ */
|
|
3412
|
+
var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3415
3413
|
module.exports = require_globals$1();
|
|
3416
|
-
})
|
|
3414
|
+
}));
|
|
3417
3415
|
|
|
3418
3416
|
//#endregion
|
|
3419
3417
|
//#region src/configs/personal/testsBase.ts
|
|
@@ -3494,7 +3492,7 @@ var testsBase_default = createCombinedTestsBaseConfig;
|
|
|
3494
3492
|
|
|
3495
3493
|
//#endregion
|
|
3496
3494
|
//#region node_modules/@eslint/js/package.json
|
|
3497
|
-
var require_package = /* @__PURE__ */
|
|
3495
|
+
var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3498
3496
|
module.exports = {
|
|
3499
3497
|
"name": "@eslint/js",
|
|
3500
3498
|
"version": "9.39.1",
|
|
@@ -3525,11 +3523,11 @@ var require_package = /* @__PURE__ */ __commonJS({ "node_modules/@eslint/js/pack
|
|
|
3525
3523
|
"license": "MIT",
|
|
3526
3524
|
"engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }
|
|
3527
3525
|
};
|
|
3528
|
-
})
|
|
3526
|
+
}));
|
|
3529
3527
|
|
|
3530
3528
|
//#endregion
|
|
3531
3529
|
//#region node_modules/@eslint/js/src/configs/eslint-all.js
|
|
3532
|
-
var require_eslint_all = /* @__PURE__ */
|
|
3530
|
+
var require_eslint_all = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3533
3531
|
module.exports = Object.freeze({ rules: Object.freeze({
|
|
3534
3532
|
"accessor-pairs": "error",
|
|
3535
3533
|
"array-callback-return": "error",
|
|
@@ -3731,11 +3729,11 @@ var require_eslint_all = /* @__PURE__ */ __commonJS({ "node_modules/@eslint/js/s
|
|
|
3731
3729
|
"vars-on-top": "error",
|
|
3732
3730
|
"yoda": "error"
|
|
3733
3731
|
}) });
|
|
3734
|
-
})
|
|
3732
|
+
}));
|
|
3735
3733
|
|
|
3736
3734
|
//#endregion
|
|
3737
3735
|
//#region node_modules/@eslint/js/src/configs/eslint-recommended.js
|
|
3738
|
-
var require_eslint_recommended = /* @__PURE__ */
|
|
3736
|
+
var require_eslint_recommended = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3739
3737
|
module.exports = Object.freeze({ rules: Object.freeze({
|
|
3740
3738
|
"constructor-super": "error",
|
|
3741
3739
|
"for-direction": "error",
|
|
@@ -3799,7 +3797,7 @@ var require_eslint_recommended = /* @__PURE__ */ __commonJS({ "node_modules/@esl
|
|
|
3799
3797
|
"use-isnan": "error",
|
|
3800
3798
|
"valid-typeof": "error"
|
|
3801
3799
|
}) });
|
|
3802
|
-
})
|
|
3800
|
+
}));
|
|
3803
3801
|
|
|
3804
3802
|
//#endregion
|
|
3805
3803
|
//#region node_modules/@eslint/js/src/index.js
|
|
@@ -3807,7 +3805,7 @@ var require_eslint_recommended = /* @__PURE__ */ __commonJS({ "node_modules/@esl
|
|
|
3807
3805
|
* @fileoverview Main package entrypoint.
|
|
3808
3806
|
* @author Nicholas C. Zakas
|
|
3809
3807
|
*/
|
|
3810
|
-
var require_src = /* @__PURE__ */
|
|
3808
|
+
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3811
3809
|
const { name: name$1, version: version$1 } = require_package();
|
|
3812
3810
|
module.exports = {
|
|
3813
3811
|
meta: {
|
|
@@ -3819,7 +3817,7 @@ var require_src = /* @__PURE__ */ __commonJS({ "node_modules/@eslint/js/src/inde
|
|
|
3819
3817
|
recommended: require_eslint_recommended()
|
|
3820
3818
|
}
|
|
3821
3819
|
};
|
|
3822
|
-
})
|
|
3820
|
+
}));
|
|
3823
3821
|
|
|
3824
3822
|
//#endregion
|
|
3825
3823
|
//#region src/configs/helpers/javaScriptLanguageOptions.ts
|
|
@@ -4161,18 +4159,15 @@ var typeScriptBase_default$1 = typeScriptBase;
|
|
|
4161
4159
|
//#endregion
|
|
4162
4160
|
//#region src/configs/personal/eslintPlugin.ts
|
|
4163
4161
|
function createPersonalEslintPluginConfig(plugin) {
|
|
4164
|
-
return [
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
perfectionist: eslint_plugin_perfectionist.default
|
|
4170
|
-
},
|
|
4171
|
-
rules: { "@alextheman/no-plugin-configs-access-from-src-configs": "error" }
|
|
4162
|
+
return [{
|
|
4163
|
+
name: "@alextheman/personal/eslint-plugin",
|
|
4164
|
+
plugins: {
|
|
4165
|
+
"@alextheman": plugin,
|
|
4166
|
+
perfectionist: eslint_plugin_perfectionist.default
|
|
4172
4167
|
},
|
|
4173
|
-
{
|
|
4174
|
-
|
|
4175
|
-
|
|
4168
|
+
rules: {
|
|
4169
|
+
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
4170
|
+
"no-restricted-imports": ["error", { paths: [...[
|
|
4176
4171
|
"src/alexPlugin",
|
|
4177
4172
|
"src/index",
|
|
4178
4173
|
"src"
|
|
@@ -4186,13 +4181,12 @@ function createPersonalEslintPluginConfig(plugin) {
|
|
|
4186
4181
|
importNames: ["default"],
|
|
4187
4182
|
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead so you don't have to deal with eslint-plugin-react-hooks' ridiculous plugin typing.",
|
|
4188
4183
|
name: "eslint-plugin-react-hooks"
|
|
4189
|
-
}] }]
|
|
4190
|
-
},
|
|
4191
|
-
{
|
|
4192
|
-
files: ["src/rules/index.ts", "src/configs/**"],
|
|
4193
|
-
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
4184
|
+
}] }]
|
|
4194
4185
|
}
|
|
4195
|
-
|
|
4186
|
+
}, {
|
|
4187
|
+
files: ["src/rules/index.ts", "src/configs/**"],
|
|
4188
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
4189
|
+
}];
|
|
4196
4190
|
}
|
|
4197
4191
|
var eslintPlugin_default = createPersonalEslintPluginConfig;
|
|
4198
4192
|
|
|
@@ -4447,10 +4441,6 @@ const consistentTestFunctionOptionsSchema = zod.default.object({
|
|
|
4447
4441
|
function parseConsistentTestFunctionOptions(data) {
|
|
4448
4442
|
return consistentTestFunctionOptionsSchema.parse(data);
|
|
4449
4443
|
}
|
|
4450
|
-
const defaultOptions = {
|
|
4451
|
-
preference: "test",
|
|
4452
|
-
fixable: true
|
|
4453
|
-
};
|
|
4454
4444
|
const consistentTestFunction = createRule_default({
|
|
4455
4445
|
name: "consistent-test-function",
|
|
4456
4446
|
meta: {
|
|
@@ -4460,9 +4450,12 @@ const consistentTestFunction = createRule_default({
|
|
|
4460
4450
|
fixable: "code",
|
|
4461
4451
|
schema: createRuleSchemaFromZodSchema_default(consistentTestFunctionOptionsSchema)
|
|
4462
4452
|
},
|
|
4463
|
-
defaultOptions: [
|
|
4453
|
+
defaultOptions: [{
|
|
4454
|
+
preference: "test",
|
|
4455
|
+
fixable: true
|
|
4456
|
+
}],
|
|
4464
4457
|
create(context) {
|
|
4465
|
-
const { preference =
|
|
4458
|
+
const { preference = "test", fixable = true } = parseConsistentTestFunctionOptions(context.options[0] ?? {});
|
|
4466
4459
|
return {
|
|
4467
4460
|
CallExpression(node) {
|
|
4468
4461
|
if (node.callee.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.name === "it" && preference === "test") return context.report({
|
|
@@ -4639,9 +4632,9 @@ const noRelativeImports = createRule_default({
|
|
|
4639
4632
|
type: "suggestion",
|
|
4640
4633
|
schema: createRuleSchemaFromZodSchema_default(noRelativeImportsOptionsSchema)
|
|
4641
4634
|
},
|
|
4642
|
-
defaultOptions: [{ depth:
|
|
4635
|
+
defaultOptions: [{ depth: 0 }],
|
|
4643
4636
|
create(context) {
|
|
4644
|
-
const { depth } = parseNoRelativeImportsOptions(context.options[0] ?? {
|
|
4637
|
+
const { depth = void 0 } = parseNoRelativeImportsOptions(context.options[0] ?? {});
|
|
4645
4638
|
return { ImportDeclaration(node) {
|
|
4646
4639
|
if (node.source.value.includes("./") || node.source.value.includes("../")) {
|
|
4647
4640
|
if (depth === void 0) return context.report({
|
|
@@ -4851,7 +4844,7 @@ const alexPlugin = {
|
|
|
4851
4844
|
configs: {},
|
|
4852
4845
|
rules: rules_default
|
|
4853
4846
|
};
|
|
4854
|
-
alexPlugin.configs = configs_default(alexPlugin);
|
|
4847
|
+
alexPlugin.configs = configs_default((0, __alextheman_utility.deepFreeze)({ ...alexPlugin }));
|
|
4855
4848
|
var alexPlugin_default = alexPlugin;
|
|
4856
4849
|
|
|
4857
4850
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -30,7 +30,7 @@ type ConfigGroupName = keyof AlexPluginConfigGroup;
|
|
|
30
30
|
type ConfigKey = { [Group in ConfigGroupName & string]: `${CamelToKebab<Group>}/${CamelToKebab<keyof AlexPluginConfigGroup[Group] & string>}` }[ConfigGroupName & string];
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/configs/index.d.ts
|
|
33
|
-
declare function createAlexPluginConfigs(plugin: AlexPlugin): Record<ConfigKey, Linter.Config[]>;
|
|
33
|
+
declare function createAlexPluginConfigs(plugin: Readonly<AlexPlugin>): Record<ConfigKey, Linter.Config[]>;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/alexPlugin.d.ts
|
|
36
36
|
interface AlexPlugin {
|
|
@@ -171,8 +171,6 @@ declare function checkCallExpression(node: TSESTree.CallExpression, objectName:
|
|
|
171
171
|
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/utility/getImportSpecifiersAfterRemoving.d.ts
|
|
174
|
-
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [
|
|
175
|
-
preference: string;
|
|
176
|
-
}]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
174
|
+
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
177
175
|
//#endregion
|
|
178
176
|
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
|
@@ -30,7 +30,7 @@ type ConfigGroupName = keyof AlexPluginConfigGroup;
|
|
|
30
30
|
type ConfigKey = { [Group in ConfigGroupName & string]: `${CamelToKebab<Group>}/${CamelToKebab<keyof AlexPluginConfigGroup[Group] & string>}` }[ConfigGroupName & string];
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/configs/index.d.ts
|
|
33
|
-
declare function createAlexPluginConfigs(plugin: AlexPlugin): Record<ConfigKey, Linter.Config[]>;
|
|
33
|
+
declare function createAlexPluginConfigs(plugin: Readonly<AlexPlugin>): Record<ConfigKey, Linter.Config[]>;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/alexPlugin.d.ts
|
|
36
36
|
interface AlexPlugin {
|
|
@@ -171,8 +171,6 @@ declare function checkCallExpression(node: TSESTree.CallExpression, objectName:
|
|
|
171
171
|
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/utility/getImportSpecifiersAfterRemoving.d.ts
|
|
174
|
-
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [
|
|
175
|
-
preference: string;
|
|
176
|
-
}]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
174
|
+
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
177
175
|
//#endregion
|
|
178
176
|
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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { camelToKebab, deepFreeze, normalizeImportPath, omitProperties } from "@alextheman/utility";
|
|
1
2
|
import prettierConfig from "eslint-config-prettier";
|
|
2
3
|
import importPlugin from "eslint-plugin-import";
|
|
3
4
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
@@ -8,7 +9,6 @@ import { defineConfig } from "vitest/config";
|
|
|
8
9
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
9
10
|
import reactPlugin from "eslint-plugin-react";
|
|
10
11
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
11
|
-
import { camelToKebab, normalizeImportPath, omitProperties } from "@alextheman/utility";
|
|
12
12
|
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
13
13
|
import packageJson from "eslint-plugin-package-json";
|
|
14
14
|
import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
@@ -21,9 +21,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
21
21
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
22
22
|
var __getProtoOf = Object.getPrototypeOf;
|
|
23
23
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
24
|
-
var
|
|
25
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
26
|
-
};
|
|
24
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
27
25
|
var __copyProps = (to, from, except, desc) => {
|
|
28
26
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
27
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -46,11 +44,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
46
44
|
//#endregion
|
|
47
45
|
//#region package.json
|
|
48
46
|
var name = "@alextheman/eslint-plugin";
|
|
49
|
-
var version = "4.2.
|
|
47
|
+
var version = "4.2.4";
|
|
50
48
|
|
|
51
49
|
//#endregion
|
|
52
50
|
//#region node_modules/globals/globals.json
|
|
53
|
-
var require_globals$1 = /* @__PURE__ */
|
|
51
|
+
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
54
52
|
module.exports = {
|
|
55
53
|
"amd": {
|
|
56
54
|
"define": false,
|
|
@@ -3394,13 +3392,13 @@ var require_globals$1 = /* @__PURE__ */ __commonJS({ "node_modules/globals/globa
|
|
|
3394
3392
|
"YUI_config": false
|
|
3395
3393
|
}
|
|
3396
3394
|
};
|
|
3397
|
-
})
|
|
3395
|
+
}));
|
|
3398
3396
|
|
|
3399
3397
|
//#endregion
|
|
3400
3398
|
//#region node_modules/globals/index.js
|
|
3401
|
-
var require_globals = /* @__PURE__ */
|
|
3399
|
+
var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3402
3400
|
module.exports = require_globals$1();
|
|
3403
|
-
})
|
|
3401
|
+
}));
|
|
3404
3402
|
|
|
3405
3403
|
//#endregion
|
|
3406
3404
|
//#region src/configs/personal/testsBase.ts
|
|
@@ -3481,7 +3479,7 @@ var testsBase_default = createCombinedTestsBaseConfig;
|
|
|
3481
3479
|
|
|
3482
3480
|
//#endregion
|
|
3483
3481
|
//#region node_modules/@eslint/js/package.json
|
|
3484
|
-
var require_package = /* @__PURE__ */
|
|
3482
|
+
var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3485
3483
|
module.exports = {
|
|
3486
3484
|
"name": "@eslint/js",
|
|
3487
3485
|
"version": "9.39.1",
|
|
@@ -3512,11 +3510,11 @@ var require_package = /* @__PURE__ */ __commonJS({ "node_modules/@eslint/js/pack
|
|
|
3512
3510
|
"license": "MIT",
|
|
3513
3511
|
"engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }
|
|
3514
3512
|
};
|
|
3515
|
-
})
|
|
3513
|
+
}));
|
|
3516
3514
|
|
|
3517
3515
|
//#endregion
|
|
3518
3516
|
//#region node_modules/@eslint/js/src/configs/eslint-all.js
|
|
3519
|
-
var require_eslint_all = /* @__PURE__ */
|
|
3517
|
+
var require_eslint_all = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3520
3518
|
module.exports = Object.freeze({ rules: Object.freeze({
|
|
3521
3519
|
"accessor-pairs": "error",
|
|
3522
3520
|
"array-callback-return": "error",
|
|
@@ -3718,11 +3716,11 @@ var require_eslint_all = /* @__PURE__ */ __commonJS({ "node_modules/@eslint/js/s
|
|
|
3718
3716
|
"vars-on-top": "error",
|
|
3719
3717
|
"yoda": "error"
|
|
3720
3718
|
}) });
|
|
3721
|
-
})
|
|
3719
|
+
}));
|
|
3722
3720
|
|
|
3723
3721
|
//#endregion
|
|
3724
3722
|
//#region node_modules/@eslint/js/src/configs/eslint-recommended.js
|
|
3725
|
-
var require_eslint_recommended = /* @__PURE__ */
|
|
3723
|
+
var require_eslint_recommended = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3726
3724
|
module.exports = Object.freeze({ rules: Object.freeze({
|
|
3727
3725
|
"constructor-super": "error",
|
|
3728
3726
|
"for-direction": "error",
|
|
@@ -3786,7 +3784,7 @@ var require_eslint_recommended = /* @__PURE__ */ __commonJS({ "node_modules/@esl
|
|
|
3786
3784
|
"use-isnan": "error",
|
|
3787
3785
|
"valid-typeof": "error"
|
|
3788
3786
|
}) });
|
|
3789
|
-
})
|
|
3787
|
+
}));
|
|
3790
3788
|
|
|
3791
3789
|
//#endregion
|
|
3792
3790
|
//#region node_modules/@eslint/js/src/index.js
|
|
@@ -3794,7 +3792,7 @@ var require_eslint_recommended = /* @__PURE__ */ __commonJS({ "node_modules/@esl
|
|
|
3794
3792
|
* @fileoverview Main package entrypoint.
|
|
3795
3793
|
* @author Nicholas C. Zakas
|
|
3796
3794
|
*/
|
|
3797
|
-
var require_src = /* @__PURE__ */
|
|
3795
|
+
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3798
3796
|
const { name: name$1, version: version$1 } = require_package();
|
|
3799
3797
|
module.exports = {
|
|
3800
3798
|
meta: {
|
|
@@ -3806,7 +3804,7 @@ var require_src = /* @__PURE__ */ __commonJS({ "node_modules/@eslint/js/src/inde
|
|
|
3806
3804
|
recommended: require_eslint_recommended()
|
|
3807
3805
|
}
|
|
3808
3806
|
};
|
|
3809
|
-
})
|
|
3807
|
+
}));
|
|
3810
3808
|
|
|
3811
3809
|
//#endregion
|
|
3812
3810
|
//#region src/configs/helpers/javaScriptLanguageOptions.ts
|
|
@@ -4148,18 +4146,15 @@ var typeScriptBase_default$1 = typeScriptBase;
|
|
|
4148
4146
|
//#endregion
|
|
4149
4147
|
//#region src/configs/personal/eslintPlugin.ts
|
|
4150
4148
|
function createPersonalEslintPluginConfig(plugin) {
|
|
4151
|
-
return [
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
perfectionist
|
|
4157
|
-
},
|
|
4158
|
-
rules: { "@alextheman/no-plugin-configs-access-from-src-configs": "error" }
|
|
4149
|
+
return [{
|
|
4150
|
+
name: "@alextheman/personal/eslint-plugin",
|
|
4151
|
+
plugins: {
|
|
4152
|
+
"@alextheman": plugin,
|
|
4153
|
+
perfectionist
|
|
4159
4154
|
},
|
|
4160
|
-
{
|
|
4161
|
-
|
|
4162
|
-
|
|
4155
|
+
rules: {
|
|
4156
|
+
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
4157
|
+
"no-restricted-imports": ["error", { paths: [...[
|
|
4163
4158
|
"src/alexPlugin",
|
|
4164
4159
|
"src/index",
|
|
4165
4160
|
"src"
|
|
@@ -4173,13 +4168,12 @@ function createPersonalEslintPluginConfig(plugin) {
|
|
|
4173
4168
|
importNames: ["default"],
|
|
4174
4169
|
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead so you don't have to deal with eslint-plugin-react-hooks' ridiculous plugin typing.",
|
|
4175
4170
|
name: "eslint-plugin-react-hooks"
|
|
4176
|
-
}] }]
|
|
4177
|
-
},
|
|
4178
|
-
{
|
|
4179
|
-
files: ["src/rules/index.ts", "src/configs/**"],
|
|
4180
|
-
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
4171
|
+
}] }]
|
|
4181
4172
|
}
|
|
4182
|
-
|
|
4173
|
+
}, {
|
|
4174
|
+
files: ["src/rules/index.ts", "src/configs/**"],
|
|
4175
|
+
rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
|
|
4176
|
+
}];
|
|
4183
4177
|
}
|
|
4184
4178
|
var eslintPlugin_default = createPersonalEslintPluginConfig;
|
|
4185
4179
|
|
|
@@ -4434,10 +4428,6 @@ const consistentTestFunctionOptionsSchema = z.object({
|
|
|
4434
4428
|
function parseConsistentTestFunctionOptions(data) {
|
|
4435
4429
|
return consistentTestFunctionOptionsSchema.parse(data);
|
|
4436
4430
|
}
|
|
4437
|
-
const defaultOptions = {
|
|
4438
|
-
preference: "test",
|
|
4439
|
-
fixable: true
|
|
4440
|
-
};
|
|
4441
4431
|
const consistentTestFunction = createRule_default({
|
|
4442
4432
|
name: "consistent-test-function",
|
|
4443
4433
|
meta: {
|
|
@@ -4447,9 +4437,12 @@ const consistentTestFunction = createRule_default({
|
|
|
4447
4437
|
fixable: "code",
|
|
4448
4438
|
schema: createRuleSchemaFromZodSchema_default(consistentTestFunctionOptionsSchema)
|
|
4449
4439
|
},
|
|
4450
|
-
defaultOptions: [
|
|
4440
|
+
defaultOptions: [{
|
|
4441
|
+
preference: "test",
|
|
4442
|
+
fixable: true
|
|
4443
|
+
}],
|
|
4451
4444
|
create(context) {
|
|
4452
|
-
const { preference =
|
|
4445
|
+
const { preference = "test", fixable = true } = parseConsistentTestFunctionOptions(context.options[0] ?? {});
|
|
4453
4446
|
return {
|
|
4454
4447
|
CallExpression(node) {
|
|
4455
4448
|
if (node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === "it" && preference === "test") return context.report({
|
|
@@ -4626,9 +4619,9 @@ const noRelativeImports = createRule_default({
|
|
|
4626
4619
|
type: "suggestion",
|
|
4627
4620
|
schema: createRuleSchemaFromZodSchema_default(noRelativeImportsOptionsSchema)
|
|
4628
4621
|
},
|
|
4629
|
-
defaultOptions: [{ depth:
|
|
4622
|
+
defaultOptions: [{ depth: 0 }],
|
|
4630
4623
|
create(context) {
|
|
4631
|
-
const { depth } = parseNoRelativeImportsOptions(context.options[0] ?? {
|
|
4624
|
+
const { depth = void 0 } = parseNoRelativeImportsOptions(context.options[0] ?? {});
|
|
4632
4625
|
return { ImportDeclaration(node) {
|
|
4633
4626
|
if (node.source.value.includes("./") || node.source.value.includes("../")) {
|
|
4634
4627
|
if (depth === void 0) return context.report({
|
|
@@ -4838,7 +4831,7 @@ const alexPlugin = {
|
|
|
4838
4831
|
configs: {},
|
|
4839
4832
|
rules: rules_default
|
|
4840
4833
|
};
|
|
4841
|
-
alexPlugin.configs = configs_default(alexPlugin);
|
|
4834
|
+
alexPlugin.configs = configs_default(deepFreeze({ ...alexPlugin }));
|
|
4842
4835
|
var alexPlugin_default = alexPlugin;
|
|
4843
4836
|
|
|
4844
4837
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,17 +42,17 @@
|
|
|
42
42
|
"use-local-utility": "dotenv -e .env -- sh -c 'UTILITY_PATH=${LOCAL_UTILITY_PATH:-../utility}; npm --prefix \"$UTILITY_PATH\" run create-local-package && npm uninstall @alextheman/eslint-plugin && npm install \"$UTILITY_PATH\"/alextheman-utility-*.tgz'"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@alextheman/utility": "^
|
|
46
|
-
"@typescript-eslint/utils": "^8.
|
|
45
|
+
"@alextheman/utility": "^3.3.2",
|
|
46
|
+
"@typescript-eslint/utils": "^8.48.0",
|
|
47
47
|
"common-tags": "^1.8.2",
|
|
48
|
-
"zod": "^4.1.
|
|
48
|
+
"zod": "^4.1.13"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/common-tags": "^1.8.4",
|
|
52
52
|
"@types/eslint": "^9.6.1",
|
|
53
53
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
54
54
|
"@types/node": "^24.10.1",
|
|
55
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
55
|
+
"@typescript-eslint/rule-tester": "^8.48.0",
|
|
56
56
|
"dotenv-cli": "^11.0.0",
|
|
57
57
|
"eslint": "^9.39.1",
|
|
58
58
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"globals": "^16.5.0",
|
|
70
70
|
"husky": "^9.1.7",
|
|
71
71
|
"jsdom": "^27.2.0",
|
|
72
|
-
"prettier": "^3.
|
|
73
|
-
"tsdown": "^0.16.
|
|
72
|
+
"prettier": "^3.7.2",
|
|
73
|
+
"tsdown": "^0.16.8",
|
|
74
74
|
"tsx": "^4.20.6",
|
|
75
75
|
"typescript": "^5.9.3",
|
|
76
|
-
"typescript-eslint": "^8.
|
|
76
|
+
"typescript-eslint": "^8.48.0",
|
|
77
77
|
"vite-tsconfig-paths": "^5.1.4",
|
|
78
|
-
"vitest": "^4.0.
|
|
78
|
+
"vitest": "^4.0.14"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"eslint": ">=9.0.0",
|