@alextheman/eslint-plugin 4.6.0 → 4.7.0

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
@@ -61,7 +61,7 @@ eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc);
61
61
 
62
62
  //#region package.json
63
63
  var name = "@alextheman/eslint-plugin";
64
- var version = "4.6.0";
64
+ var version = "4.7.0";
65
65
 
66
66
  //#endregion
67
67
  //#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/globals.json
@@ -3428,6 +3428,13 @@ var generalRestrictedImports_default = generalRestrictedImports;
3428
3428
 
3429
3429
  //#endregion
3430
3430
  //#region src/utility/public/checkCallExpression.ts
3431
+ /**
3432
+ * Checks if a given node matches the expected object and property names.
3433
+ * @param node - The node to check.
3434
+ * @param objectName - The object name to compare against the node.
3435
+ * @param propertyName - The property name to compare against the node.
3436
+ * @returns A value of `true` if the given `objectName` and `propertyName` matches those of the node, and `false` otherwise.
3437
+ */
3431
3438
  function checkCallExpression(node, objectName, propertyName) {
3432
3439
  return node.callee.type === __typescript_eslint_utils.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
3433
3440
  }
@@ -3435,6 +3442,11 @@ var checkCallExpression_default = checkCallExpression;
3435
3442
 
3436
3443
  //#endregion
3437
3444
  //#region src/utility/public/combineRestrictedImports.ts
3445
+ /**
3446
+ * Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
3447
+ * @param groups - Option groups to combine, applied in the order provided.
3448
+ * @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
3449
+ */
3438
3450
  function combineRestrictedImports(...groups) {
3439
3451
  const paths = [];
3440
3452
  const patterns = [];
@@ -3454,6 +3466,11 @@ var combineRestrictedImports_default = combineRestrictedImports;
3454
3466
 
3455
3467
  //#endregion
3456
3468
  //#region src/utility/public/createRuleSchemaFromZodSchema.ts
3469
+ /**
3470
+ * Converts a Zod schema to a JSON schema for usage in an ESLint rule.
3471
+ * @param schema - The Zod schema to convert.
3472
+ * @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
3473
+ */
3457
3474
  function createRuleSchemaFromZodSchema(schema$1) {
3458
3475
  return [(0, __alextheman_utility.omitProperties)(zod.default.toJSONSchema(schema$1), "$schema")];
3459
3476
  }
@@ -3461,6 +3478,14 @@ var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
3461
3478
 
3462
3479
  //#endregion
3463
3480
  //#region src/utility/public/getImportSpecifiersAfterRemoving.ts
3481
+ /**
3482
+ * Returns a comma-separated string of import specifiers, excluding the specified import.
3483
+ * Useful for auto-fixable rules that remove a specific import from an import statement.
3484
+ * @param context - The current ESLint rule context.
3485
+ * @param specifiers - Array of import clause nodes.
3486
+ * @param importToRemove - The import name to remove from the list.
3487
+ * @returns A comma-separated string of import specifiers after removing the specified import.
3488
+ */
3464
3489
  function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
3465
3490
  return specifiers.filter((specifier) => {
3466
3491
  return !(specifier.imported.name === importToRemove);
@@ -3979,7 +4004,7 @@ function personalEslintPlugin(plugin) {
3979
4004
  },
3980
4005
  {
3981
4006
  files: ["src/utility/public/**"],
3982
- rules: { "jsdoc/require-jsdoc": ["warn", requireJsdocOptions_default] }
4007
+ rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions_default] }
3983
4008
  }
3984
4009
  ];
3985
4010
  }
package/dist/index.d.cts CHANGED
@@ -232,15 +232,40 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
232
232
  };
233
233
  //#endregion
234
234
  //#region src/utility/public/checkCallExpression.d.ts
235
+ /**
236
+ * Checks if a given node matches the expected object and property names.
237
+ * @param node - The node to check.
238
+ * @param objectName - The object name to compare against the node.
239
+ * @param propertyName - The property name to compare against the node.
240
+ * @returns A value of `true` if the given `objectName` and `propertyName` matches those of the node, and `false` otherwise.
241
+ */
235
242
  declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
236
243
  //#endregion
237
244
  //#region src/utility/public/combineRestrictedImports.d.ts
245
+ /**
246
+ * Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
247
+ * @param groups - Option groups to combine, applied in the order provided.
248
+ * @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
249
+ */
238
250
  declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[]): NoRestrictedImportsOptions;
239
251
  //#endregion
240
252
  //#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
253
+ /**
254
+ * Converts a Zod schema to a JSON schema for usage in an ESLint rule.
255
+ * @param schema - The Zod schema to convert.
256
+ * @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
257
+ */
241
258
  declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
242
259
  //#endregion
243
260
  //#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
244
- declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
261
+ /**
262
+ * Returns a comma-separated string of import specifiers, excluding the specified import.
263
+ * Useful for auto-fixable rules that remove a specific import from an import statement.
264
+ * @param context - The current ESLint rule context.
265
+ * @param specifiers - Array of import clause nodes.
266
+ * @param importToRemove - The import name to remove from the list.
267
+ * @returns A comma-separated string of import specifiers after removing the specified import.
268
+ */
269
+ declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
245
270
  //#endregion
246
271
  export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, ConsistentTestFunctionOptions, GeneralConfig, NoNamespaceImportsOptions, NoRelativeImportsOptions, type NoRestrictedImportsOptions, PersonalConfig, PluginConfig, type RestrictedPathImport, type RestrictedPatternImport, RuleFixerFunction, StandardiseErrorMessagesOptions, TestFunction, UseNormalizedImportsOptions, checkCallExpression, combineRestrictedImports, 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
@@ -232,15 +232,40 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
232
232
  };
233
233
  //#endregion
234
234
  //#region src/utility/public/checkCallExpression.d.ts
235
+ /**
236
+ * Checks if a given node matches the expected object and property names.
237
+ * @param node - The node to check.
238
+ * @param objectName - The object name to compare against the node.
239
+ * @param propertyName - The property name to compare against the node.
240
+ * @returns A value of `true` if the given `objectName` and `propertyName` matches those of the node, and `false` otherwise.
241
+ */
235
242
  declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
236
243
  //#endregion
237
244
  //#region src/utility/public/combineRestrictedImports.d.ts
245
+ /**
246
+ * Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
247
+ * @param groups - Option groups to combine, applied in the order provided.
248
+ * @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
249
+ */
238
250
  declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[]): NoRestrictedImportsOptions;
239
251
  //#endregion
240
252
  //#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
253
+ /**
254
+ * Converts a Zod schema to a JSON schema for usage in an ESLint rule.
255
+ * @param schema - The Zod schema to convert.
256
+ * @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
257
+ */
241
258
  declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
242
259
  //#endregion
243
260
  //#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
244
- declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
261
+ /**
262
+ * Returns a comma-separated string of import specifiers, excluding the specified import.
263
+ * Useful for auto-fixable rules that remove a specific import from an import statement.
264
+ * @param context - The current ESLint rule context.
265
+ * @param specifiers - Array of import clause nodes.
266
+ * @param importToRemove - The import name to remove from the list.
267
+ * @returns A comma-separated string of import specifiers after removing the specified import.
268
+ */
269
+ declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
245
270
  //#endregion
246
271
  export { type AlexPlugin, AlexPluginConfigGroup, CombinedConfig, ConfigGroupName, ConfigKey, type ConsistentTestFunctionOptions, GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, type NoRestrictedImportsOptions, PersonalConfig, PluginConfig, type RestrictedPathImport, type RestrictedPatternImport, type RuleFixerFunction, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, checkCallExpression, combineRestrictedImports, 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
@@ -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.6.0";
49
+ var version = "4.7.0";
50
50
 
51
51
  //#endregion
52
52
  //#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/globals.json
@@ -3413,6 +3413,13 @@ var generalRestrictedImports_default = generalRestrictedImports;
3413
3413
 
3414
3414
  //#endregion
3415
3415
  //#region src/utility/public/checkCallExpression.ts
3416
+ /**
3417
+ * Checks if a given node matches the expected object and property names.
3418
+ * @param node - The node to check.
3419
+ * @param objectName - The object name to compare against the node.
3420
+ * @param propertyName - The property name to compare against the node.
3421
+ * @returns A value of `true` if the given `objectName` and `propertyName` matches those of the node, and `false` otherwise.
3422
+ */
3416
3423
  function checkCallExpression(node, objectName, propertyName) {
3417
3424
  return node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.object.type === AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
3418
3425
  }
@@ -3420,6 +3427,11 @@ var checkCallExpression_default = checkCallExpression;
3420
3427
 
3421
3428
  //#endregion
3422
3429
  //#region src/utility/public/combineRestrictedImports.ts
3430
+ /**
3431
+ * Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
3432
+ * @param groups - Option groups to combine, applied in the order provided.
3433
+ * @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
3434
+ */
3423
3435
  function combineRestrictedImports(...groups) {
3424
3436
  const paths = [];
3425
3437
  const patterns = [];
@@ -3439,6 +3451,11 @@ var combineRestrictedImports_default = combineRestrictedImports;
3439
3451
 
3440
3452
  //#endregion
3441
3453
  //#region src/utility/public/createRuleSchemaFromZodSchema.ts
3454
+ /**
3455
+ * Converts a Zod schema to a JSON schema for usage in an ESLint rule.
3456
+ * @param schema - The Zod schema to convert.
3457
+ * @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
3458
+ */
3442
3459
  function createRuleSchemaFromZodSchema(schema$1) {
3443
3460
  return [omitProperties(z.toJSONSchema(schema$1), "$schema")];
3444
3461
  }
@@ -3446,6 +3463,14 @@ var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
3446
3463
 
3447
3464
  //#endregion
3448
3465
  //#region src/utility/public/getImportSpecifiersAfterRemoving.ts
3466
+ /**
3467
+ * Returns a comma-separated string of import specifiers, excluding the specified import.
3468
+ * Useful for auto-fixable rules that remove a specific import from an import statement.
3469
+ * @param context - The current ESLint rule context.
3470
+ * @param specifiers - Array of import clause nodes.
3471
+ * @param importToRemove - The import name to remove from the list.
3472
+ * @returns A comma-separated string of import specifiers after removing the specified import.
3473
+ */
3449
3474
  function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
3450
3475
  return specifiers.filter((specifier) => {
3451
3476
  return !(specifier.imported.name === importToRemove);
@@ -3964,7 +3989,7 @@ function personalEslintPlugin(plugin) {
3964
3989
  },
3965
3990
  {
3966
3991
  files: ["src/utility/public/**"],
3967
- rules: { "jsdoc/require-jsdoc": ["warn", requireJsdocOptions_default] }
3992
+ rules: { "jsdoc/require-jsdoc": ["error", requireJsdocOptions_default] }
3968
3993
  }
3969
3994
  ];
3970
3995
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "repository": {
6
6
  "type": "git",