@alextheman/eslint-plugin 2.7.8 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3759,7 +3759,7 @@ module.exports = __toCommonJS(index_exports);
3759
3759
 
3760
3760
  // package.json
3761
3761
  var name = "@alextheman/eslint-plugin";
3762
- var version = "2.7.8";
3762
+ var version = "2.8.1";
3763
3763
 
3764
3764
  // src/configs/index.ts
3765
3765
  var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-json"), 1);
@@ -3833,7 +3833,10 @@ function createPluginTestsBaseConfig(plugin) {
3833
3833
  "@alextheman": plugin
3834
3834
  },
3835
3835
  rules: {
3836
- "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3836
+ "@alextheman/consistent-test-function": [
3837
+ "error",
3838
+ { preference: "test" }
3839
+ ],
3837
3840
  "@alextheman/no-isolated-tests": "error",
3838
3841
  "@alextheman/no-skipped-tests": "warn"
3839
3842
  }
@@ -4511,7 +4514,8 @@ var consistentTestFunction = createRule_default({
4511
4514
  type: "object",
4512
4515
  properties: {
4513
4516
  preference: {
4514
- type: "string"
4517
+ type: "string",
4518
+ enum: ["it", "test"]
4515
4519
  }
4516
4520
  },
4517
4521
  additionalProperties: false
@@ -4522,7 +4526,7 @@ var consistentTestFunction = createRule_default({
4522
4526
  create(context) {
4523
4527
  var _a;
4524
4528
  const preference = (_a = context.options[0]) == null ? void 0 : _a.preference;
4525
- const validatedPreference = validTestFunctionsSchema.parse(preference != null ? preference : "test");
4529
+ const validatedPreference = parseTestFunction(preference != null ? preference : "test");
4526
4530
  return {
4527
4531
  CallExpression(node) {
4528
4532
  if (node.callee.type === import_utils2.AST_NODE_TYPES.Identifier && node.callee.name === "it" && validatedPreference === "test") {
@@ -4926,7 +4930,8 @@ var standardiseErrorMessages = createRule_default({
4926
4930
  regex: {
4927
4931
  type: "string"
4928
4932
  }
4929
- }
4933
+ },
4934
+ additionalProperties: false
4930
4935
  }
4931
4936
  ]
4932
4937
  },
@@ -4963,7 +4968,8 @@ var useNormalizedImports = createRule_default({
4963
4968
  fixable: {
4964
4969
  type: "boolean"
4965
4970
  }
4966
- }
4971
+ },
4972
+ additionalProperties: false
4967
4973
  }
4968
4974
  ],
4969
4975
  fixable: "code"
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { Config } from 'prettier';
4
4
  import z from 'zod';
5
5
 
6
6
  var name = "@alextheman/eslint-plugin";
7
- var version = "2.7.8";
7
+ var version = "2.8.1";
8
8
 
9
9
  type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
10
10
 
@@ -65,4 +65,49 @@ declare const validTestFunctionsSchema: z.ZodEnum<{
65
65
  type TestFunction = z.infer<typeof validTestFunctionsSchema>;
66
66
  declare function parseTestFunction(data: unknown): TestFunction;
67
67
 
68
- export { type AlexPlugin, type AlexPluginConfigGroup, type CombinedConfig, type ConfigGroupName, type ConfigKey, type GeneralConfig, type PersonalConfig, type PluginConfig, type TestFunction, alexPlugin as default, parseTestFunction, prettierRules, sortObjects };
68
+ /**
69
+ * This file was automatically generated by json-schema-to-typescript.
70
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
71
+ * and run json-schema-to-typescript to regenerate this file.
72
+ */
73
+ interface ConsistentTestFunctionOptions {
74
+ preference?: "it" | "test";
75
+ }
76
+
77
+ /**
78
+ * This file was automatically generated by json-schema-to-typescript.
79
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
80
+ * and run json-schema-to-typescript to regenerate this file.
81
+ */
82
+ interface NoNamespaceImportsOptions {
83
+ allow?: string[];
84
+ }
85
+
86
+ /**
87
+ * This file was automatically generated by json-schema-to-typescript.
88
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
89
+ * and run json-schema-to-typescript to regenerate this file.
90
+ */
91
+ interface NoRelativeImportsOptions {
92
+ depth?: number;
93
+ }
94
+
95
+ /**
96
+ * This file was automatically generated by json-schema-to-typescript.
97
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
98
+ * and run json-schema-to-typescript to regenerate this file.
99
+ */
100
+ interface StandardiseErrorMessagesOptions {
101
+ regex?: string;
102
+ }
103
+
104
+ /**
105
+ * This file was automatically generated by json-schema-to-typescript.
106
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
107
+ * and run json-schema-to-typescript to regenerate this file.
108
+ */
109
+ interface UseNormalizedImportsOptions {
110
+ fixable?: boolean;
111
+ }
112
+
113
+ export { type AlexPlugin, type AlexPluginConfigGroup, type CombinedConfig, type ConfigGroupName, type ConfigKey, type ConsistentTestFunctionOptions, type GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, type PersonalConfig, type PluginConfig, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, alexPlugin as default, parseTestFunction, prettierRules, sortObjects };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { Config } from 'prettier';
4
4
  import z from 'zod';
5
5
 
6
6
  var name = "@alextheman/eslint-plugin";
7
- var version = "2.7.8";
7
+ var version = "2.8.1";
8
8
 
9
9
  type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
10
10
 
@@ -65,4 +65,49 @@ declare const validTestFunctionsSchema: z.ZodEnum<{
65
65
  type TestFunction = z.infer<typeof validTestFunctionsSchema>;
66
66
  declare function parseTestFunction(data: unknown): TestFunction;
67
67
 
68
- export { type AlexPlugin, type AlexPluginConfigGroup, type CombinedConfig, type ConfigGroupName, type ConfigKey, type GeneralConfig, type PersonalConfig, type PluginConfig, type TestFunction, alexPlugin as default, parseTestFunction, prettierRules, sortObjects };
68
+ /**
69
+ * This file was automatically generated by json-schema-to-typescript.
70
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
71
+ * and run json-schema-to-typescript to regenerate this file.
72
+ */
73
+ interface ConsistentTestFunctionOptions {
74
+ preference?: "it" | "test";
75
+ }
76
+
77
+ /**
78
+ * This file was automatically generated by json-schema-to-typescript.
79
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
80
+ * and run json-schema-to-typescript to regenerate this file.
81
+ */
82
+ interface NoNamespaceImportsOptions {
83
+ allow?: string[];
84
+ }
85
+
86
+ /**
87
+ * This file was automatically generated by json-schema-to-typescript.
88
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
89
+ * and run json-schema-to-typescript to regenerate this file.
90
+ */
91
+ interface NoRelativeImportsOptions {
92
+ depth?: number;
93
+ }
94
+
95
+ /**
96
+ * This file was automatically generated by json-schema-to-typescript.
97
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
98
+ * and run json-schema-to-typescript to regenerate this file.
99
+ */
100
+ interface StandardiseErrorMessagesOptions {
101
+ regex?: string;
102
+ }
103
+
104
+ /**
105
+ * This file was automatically generated by json-schema-to-typescript.
106
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
107
+ * and run json-schema-to-typescript to regenerate this file.
108
+ */
109
+ interface UseNormalizedImportsOptions {
110
+ fixable?: boolean;
111
+ }
112
+
113
+ export { type AlexPlugin, type AlexPluginConfigGroup, type CombinedConfig, type ConfigGroupName, type ConfigKey, type ConsistentTestFunctionOptions, type GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, type PersonalConfig, type PluginConfig, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, alexPlugin as default, parseTestFunction, prettierRules, sortObjects };
package/dist/index.js CHANGED
@@ -3743,7 +3743,7 @@ var require_src = __commonJS({
3743
3743
 
3744
3744
  // package.json
3745
3745
  var name = "@alextheman/eslint-plugin";
3746
- var version = "2.7.8";
3746
+ var version = "2.8.1";
3747
3747
 
3748
3748
  // src/configs/index.ts
3749
3749
  import packageJson from "eslint-plugin-package-json";
@@ -3817,7 +3817,10 @@ function createPluginTestsBaseConfig(plugin) {
3817
3817
  "@alextheman": plugin
3818
3818
  },
3819
3819
  rules: {
3820
- "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3820
+ "@alextheman/consistent-test-function": [
3821
+ "error",
3822
+ { preference: "test" }
3823
+ ],
3821
3824
  "@alextheman/no-isolated-tests": "error",
3822
3825
  "@alextheman/no-skipped-tests": "warn"
3823
3826
  }
@@ -4495,7 +4498,8 @@ var consistentTestFunction = createRule_default({
4495
4498
  type: "object",
4496
4499
  properties: {
4497
4500
  preference: {
4498
- type: "string"
4501
+ type: "string",
4502
+ enum: ["it", "test"]
4499
4503
  }
4500
4504
  },
4501
4505
  additionalProperties: false
@@ -4506,7 +4510,7 @@ var consistentTestFunction = createRule_default({
4506
4510
  create(context) {
4507
4511
  var _a;
4508
4512
  const preference = (_a = context.options[0]) == null ? void 0 : _a.preference;
4509
- const validatedPreference = validTestFunctionsSchema.parse(preference != null ? preference : "test");
4513
+ const validatedPreference = parseTestFunction(preference != null ? preference : "test");
4510
4514
  return {
4511
4515
  CallExpression(node) {
4512
4516
  if (node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === "it" && validatedPreference === "test") {
@@ -4910,7 +4914,8 @@ var standardiseErrorMessages = createRule_default({
4910
4914
  regex: {
4911
4915
  type: "string"
4912
4916
  }
4913
- }
4917
+ },
4918
+ additionalProperties: false
4914
4919
  }
4915
4920
  ]
4916
4921
  },
@@ -4947,7 +4952,8 @@ var useNormalizedImports = createRule_default({
4947
4952
  fixable: {
4948
4953
  type: "boolean"
4949
4954
  }
4950
- }
4955
+ },
4956
+ additionalProperties: false
4951
4957
  }
4952
4958
  ],
4953
4959
  fixable: "code"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "2.7.8",
3
+ "version": "2.8.1",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,17 +15,18 @@
15
15
  "dist"
16
16
  ],
17
17
  "scripts": {
18
- "build": "tsup && npx tsx src/utility/hashConfigChanges.ts",
18
+ "build": "tsup && tsx src/utility/hashConfigChanges.ts",
19
19
  "change-major": "npm version major -m \"Change version number to v%s\"",
20
20
  "change-minor": "npm version minor -m \"Change version number to v%s\"",
21
21
  "change-patch": "npm version patch -m \"Change version number to v%s\"",
22
22
  "create-local-package": "npm run build && rm -f alextheman-eslint-plugin-*.tgz && npm pack",
23
- "format": "npx tsx src/utility/checkConfigChanges.ts || npm run build && npm run format-prettier && npm run format-eslint",
23
+ "format": "tsx src/utility/checkConfigChanges.ts || npm run build && npm run format-prettier && npm run format-eslint",
24
24
  "format-eslint": "eslint --fix --suppress-all \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\" && rm -f eslint-suppressions.json",
25
25
  "format-prettier": "npm run format-prettier-typescript && npm run format-prettier-javascript",
26
26
  "format-prettier-javascript": "prettier --write \"./**/*.js\"",
27
27
  "format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
28
- "lint": "npx tsx src/utility/checkConfigChanges.ts || npm run build && npm run lint-tsc && npm run lint-eslint && npm run lint-prettier",
28
+ "generate-rule-options-types": "tsx src/utility/generateRuleOptionsTypes.ts",
29
+ "lint": "tsx src/utility/checkConfigChanges.ts || npm run build && npm run lint-tsc && npm run lint-eslint && npm run lint-prettier",
29
30
  "lint-eslint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\"",
30
31
  "lint-prettier": "npm run lint-prettier-typescript && npm run lint-prettier-javascript",
31
32
  "lint-prettier-javascript": "prettier --check \"./**/*.js\"",
@@ -37,9 +38,10 @@
37
38
  "update-dependencies": "bash -c 'npx npm-check-updates -u \"$@\" && npm install' --"
38
39
  },
39
40
  "dependencies": {
40
- "@alextheman/utility": "^2.14.0",
41
+ "@alextheman/utility": "^2.15.1",
41
42
  "common-tags": "^1.8.2",
42
43
  "eslint-plugin-package-json": "^0.64.0",
44
+ "json-schema-to-typescript": "^15.0.4",
43
45
  "zod": "^4.1.12"
44
46
  },
45
47
  "devDependencies": {
@@ -55,6 +57,7 @@
55
57
  "jiti": "^2.6.1",
56
58
  "prettier": "^3.6.2",
57
59
  "tsup": "^8.5.0",
60
+ "tsx": "^4.20.6",
58
61
  "typescript": "^5.9.3",
59
62
  "vite-tsconfig-paths": "^5.1.4",
60
63
  "vitest": "^4.0.8"