@alextheman/eslint-plugin 4.2.3 → 4.2.5

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
@@ -57,7 +57,7 @@ zod = __toESM(zod);
57
57
 
58
58
  //#region package.json
59
59
  var name = "@alextheman/eslint-plugin";
60
- var version = "4.2.3";
60
+ var version = "4.2.5";
61
61
 
62
62
  //#endregion
63
63
  //#region node_modules/globals/globals.json
@@ -4159,18 +4159,15 @@ var typeScriptBase_default$1 = typeScriptBase;
4159
4159
  //#endregion
4160
4160
  //#region src/configs/personal/eslintPlugin.ts
4161
4161
  function createPersonalEslintPluginConfig(plugin) {
4162
- return [
4163
- {
4164
- name: "@alextheman/personal/eslint-plugin",
4165
- plugins: {
4166
- "@alextheman": plugin,
4167
- perfectionist: eslint_plugin_perfectionist.default
4168
- },
4169
- 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
4170
4167
  },
4171
- {
4172
- files: ["src/configs/**"],
4173
- rules: { "no-restricted-imports": ["error", { paths: [...[
4168
+ rules: {
4169
+ "@alextheman/no-plugin-configs-access-from-src-configs": "error",
4170
+ "no-restricted-imports": ["error", { paths: [...[
4174
4171
  "src/alexPlugin",
4175
4172
  "src/index",
4176
4173
  "src"
@@ -4184,13 +4181,12 @@ function createPersonalEslintPluginConfig(plugin) {
4184
4181
  importNames: ["default"],
4185
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.",
4186
4183
  name: "eslint-plugin-react-hooks"
4187
- }] }] }
4188
- },
4189
- {
4190
- files: ["src/rules/index.ts", "src/configs/**"],
4191
- rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
4184
+ }] }]
4192
4185
  }
4193
- ];
4186
+ }, {
4187
+ files: ["src/rules/index.ts", "src/configs/**"],
4188
+ rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
4189
+ }];
4194
4190
  }
4195
4191
  var eslintPlugin_default = createPersonalEslintPluginConfig;
4196
4192
 
@@ -4445,10 +4441,6 @@ const consistentTestFunctionOptionsSchema = zod.default.object({
4445
4441
  function parseConsistentTestFunctionOptions(data) {
4446
4442
  return consistentTestFunctionOptionsSchema.parse(data);
4447
4443
  }
4448
- const defaultOptions = {
4449
- preference: "test",
4450
- fixable: true
4451
- };
4452
4444
  const consistentTestFunction = createRule_default({
4453
4445
  name: "consistent-test-function",
4454
4446
  meta: {
@@ -4458,9 +4450,12 @@ const consistentTestFunction = createRule_default({
4458
4450
  fixable: "code",
4459
4451
  schema: createRuleSchemaFromZodSchema_default(consistentTestFunctionOptionsSchema)
4460
4452
  },
4461
- defaultOptions: [defaultOptions],
4453
+ defaultOptions: [{
4454
+ preference: "test",
4455
+ fixable: true
4456
+ }],
4462
4457
  create(context) {
4463
- const { preference = defaultOptions.preference, fixable = defaultOptions.fixable } = parseConsistentTestFunctionOptions(context.options[0] ?? defaultOptions);
4458
+ const { preference = "test", fixable = true } = parseConsistentTestFunctionOptions(context.options[0] ?? {});
4464
4459
  return {
4465
4460
  CallExpression(node) {
4466
4461
  if (node.callee.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.name === "it" && preference === "test") return context.report({
@@ -4637,9 +4632,9 @@ const noRelativeImports = createRule_default({
4637
4632
  type: "suggestion",
4638
4633
  schema: createRuleSchemaFromZodSchema_default(noRelativeImportsOptionsSchema)
4639
4634
  },
4640
- defaultOptions: [{ depth: void 0 }],
4635
+ defaultOptions: [{ depth: 0 }],
4641
4636
  create(context) {
4642
- const { depth } = parseNoRelativeImportsOptions(context.options[0] ?? { depth: void 0 });
4637
+ const { depth = void 0 } = parseNoRelativeImportsOptions(context.options[0] ?? {});
4643
4638
  return { ImportDeclaration(node) {
4644
4639
  if (node.source.value.includes("./") || node.source.value.includes("../")) {
4645
4640
  if (depth === void 0) return context.report({
@@ -4849,7 +4844,7 @@ const alexPlugin = {
4849
4844
  configs: {},
4850
4845
  rules: rules_default
4851
4846
  };
4852
- alexPlugin.configs = configs_default((0, __alextheman_utility.deepFreeze)({ ...alexPlugin }));
4847
+ alexPlugin.configs = configs_default((0, __alextheman_utility.deepFreeze)((0, __alextheman_utility.deepCopy)(alexPlugin)));
4853
4848
  var alexPlugin_default = alexPlugin;
4854
4849
 
4855
4850
  //#endregion
package/dist/index.d.cts CHANGED
@@ -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
@@ -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,4 +1,4 @@
1
- import { camelToKebab, deepFreeze, normalizeImportPath, omitProperties } from "@alextheman/utility";
1
+ import { camelToKebab, deepCopy, deepFreeze, normalizeImportPath, omitProperties } from "@alextheman/utility";
2
2
  import prettierConfig from "eslint-config-prettier";
3
3
  import importPlugin from "eslint-plugin-import";
4
4
  import perfectionist from "eslint-plugin-perfectionist";
@@ -44,7 +44,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
44
44
  //#endregion
45
45
  //#region package.json
46
46
  var name = "@alextheman/eslint-plugin";
47
- var version = "4.2.3";
47
+ var version = "4.2.5";
48
48
 
49
49
  //#endregion
50
50
  //#region node_modules/globals/globals.json
@@ -4146,18 +4146,15 @@ var typeScriptBase_default$1 = typeScriptBase;
4146
4146
  //#endregion
4147
4147
  //#region src/configs/personal/eslintPlugin.ts
4148
4148
  function createPersonalEslintPluginConfig(plugin) {
4149
- return [
4150
- {
4151
- name: "@alextheman/personal/eslint-plugin",
4152
- plugins: {
4153
- "@alextheman": plugin,
4154
- perfectionist
4155
- },
4156
- 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
4157
4154
  },
4158
- {
4159
- files: ["src/configs/**"],
4160
- rules: { "no-restricted-imports": ["error", { paths: [...[
4155
+ rules: {
4156
+ "@alextheman/no-plugin-configs-access-from-src-configs": "error",
4157
+ "no-restricted-imports": ["error", { paths: [...[
4161
4158
  "src/alexPlugin",
4162
4159
  "src/index",
4163
4160
  "src"
@@ -4171,13 +4168,12 @@ function createPersonalEslintPluginConfig(plugin) {
4171
4168
  importNames: ["default"],
4172
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.",
4173
4170
  name: "eslint-plugin-react-hooks"
4174
- }] }] }
4175
- },
4176
- {
4177
- files: ["src/rules/index.ts", "src/configs/**"],
4178
- rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
4171
+ }] }]
4179
4172
  }
4180
- ];
4173
+ }, {
4174
+ files: ["src/rules/index.ts", "src/configs/**"],
4175
+ rules: { "perfectionist/sort-objects": ["error", sortObjects_default] }
4176
+ }];
4181
4177
  }
4182
4178
  var eslintPlugin_default = createPersonalEslintPluginConfig;
4183
4179
 
@@ -4432,10 +4428,6 @@ const consistentTestFunctionOptionsSchema = z.object({
4432
4428
  function parseConsistentTestFunctionOptions(data) {
4433
4429
  return consistentTestFunctionOptionsSchema.parse(data);
4434
4430
  }
4435
- const defaultOptions = {
4436
- preference: "test",
4437
- fixable: true
4438
- };
4439
4431
  const consistentTestFunction = createRule_default({
4440
4432
  name: "consistent-test-function",
4441
4433
  meta: {
@@ -4445,9 +4437,12 @@ const consistentTestFunction = createRule_default({
4445
4437
  fixable: "code",
4446
4438
  schema: createRuleSchemaFromZodSchema_default(consistentTestFunctionOptionsSchema)
4447
4439
  },
4448
- defaultOptions: [defaultOptions],
4440
+ defaultOptions: [{
4441
+ preference: "test",
4442
+ fixable: true
4443
+ }],
4449
4444
  create(context) {
4450
- const { preference = defaultOptions.preference, fixable = defaultOptions.fixable } = parseConsistentTestFunctionOptions(context.options[0] ?? defaultOptions);
4445
+ const { preference = "test", fixable = true } = parseConsistentTestFunctionOptions(context.options[0] ?? {});
4451
4446
  return {
4452
4447
  CallExpression(node) {
4453
4448
  if (node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === "it" && preference === "test") return context.report({
@@ -4624,9 +4619,9 @@ const noRelativeImports = createRule_default({
4624
4619
  type: "suggestion",
4625
4620
  schema: createRuleSchemaFromZodSchema_default(noRelativeImportsOptionsSchema)
4626
4621
  },
4627
- defaultOptions: [{ depth: void 0 }],
4622
+ defaultOptions: [{ depth: 0 }],
4628
4623
  create(context) {
4629
- const { depth } = parseNoRelativeImportsOptions(context.options[0] ?? { depth: void 0 });
4624
+ const { depth = void 0 } = parseNoRelativeImportsOptions(context.options[0] ?? {});
4630
4625
  return { ImportDeclaration(node) {
4631
4626
  if (node.source.value.includes("./") || node.source.value.includes("../")) {
4632
4627
  if (depth === void 0) return context.report({
@@ -4836,7 +4831,7 @@ const alexPlugin = {
4836
4831
  configs: {},
4837
4832
  rules: rules_default
4838
4833
  };
4839
- alexPlugin.configs = configs_default(deepFreeze({ ...alexPlugin }));
4834
+ alexPlugin.configs = configs_default(deepFreeze(deepCopy(alexPlugin)));
4840
4835
  var alexPlugin_default = alexPlugin;
4841
4836
 
4842
4837
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "4.2.3",
3
+ "version": "4.2.5",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,7 +42,7 @@
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": "^3.3.2",
45
+ "@alextheman/utility": "^3.4.0",
46
46
  "@typescript-eslint/utils": "^8.48.0",
47
47
  "common-tags": "^1.8.2",
48
48
  "zod": "^4.1.13"
@@ -69,7 +69,7 @@
69
69
  "globals": "^16.5.0",
70
70
  "husky": "^9.1.7",
71
71
  "jsdom": "^27.2.0",
72
- "prettier": "^3.7.1",
72
+ "prettier": "^3.7.2",
73
73
  "tsdown": "^0.16.8",
74
74
  "tsx": "^4.20.6",
75
75
  "typescript": "^5.9.3",