@alextheman/eslint-plugin 3.1.4 → 3.2.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
@@ -3751,7 +3751,10 @@ var require_src = __commonJS({
3751
3751
  // src/index.ts
3752
3752
  var index_exports = {};
3753
3753
  __export(index_exports, {
3754
+ checkCallExpression: () => checkCallExpression_default,
3754
3755
  default: () => index_default,
3756
+ fixOnCondition: () => fixOnCondition_default,
3757
+ getImportSpecifiersAfterRemoving: () => getImportSpecifiersAfterRemoving_default,
3755
3758
  parseConsistentTestFunctionOptions: () => parseConsistentTestFunctionOptions,
3756
3759
  parseNoNamespaceImportsOptions: () => parseNoNamespaceImportsOptions,
3757
3760
  parseNoRelativeImportsOptions: () => parseNoRelativeImportsOptions,
@@ -3759,13 +3762,16 @@ __export(index_exports, {
3759
3762
  parseTestFunction: () => parseTestFunction,
3760
3763
  parseUseNormalizedImportsOptions: () => parseUseNormalizedImportsOptions,
3761
3764
  prettierRules: () => prettierRules_default,
3762
- sortObjects: () => sortObjects_default
3765
+ reactLanguageOptions: () => reactLanguageOptions_default,
3766
+ sortObjects: () => sortObjects_default,
3767
+ typeScriptLanguageOptions: () => typeScriptLanguageOptions_default,
3768
+ unusedVarsIgnorePatterns: () => unusedVarsIgnorePatterns_default
3763
3769
  });
3764
3770
  module.exports = __toCommonJS(index_exports);
3765
3771
 
3766
3772
  // package.json
3767
3773
  var name = "@alextheman/eslint-plugin";
3768
- var version = "3.1.4";
3774
+ var version = "3.2.0";
3769
3775
 
3770
3776
  // src/configs/index.ts
3771
3777
  var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-json"), 1);
@@ -5111,6 +5117,9 @@ var alexPlugin_default = alexPlugin;
5111
5117
  var index_default = alexPlugin_default;
5112
5118
  // Annotate the CommonJS export names for ESM import in node:
5113
5119
  0 && (module.exports = {
5120
+ checkCallExpression,
5121
+ fixOnCondition,
5122
+ getImportSpecifiersAfterRemoving,
5114
5123
  parseConsistentTestFunctionOptions,
5115
5124
  parseNoNamespaceImportsOptions,
5116
5125
  parseNoRelativeImportsOptions,
@@ -5118,5 +5127,8 @@ var index_default = alexPlugin_default;
5118
5127
  parseTestFunction,
5119
5128
  parseUseNormalizedImportsOptions,
5120
5129
  prettierRules,
5121
- sortObjects
5130
+ reactLanguageOptions,
5131
+ sortObjects,
5132
+ typeScriptLanguageOptions,
5133
+ unusedVarsIgnorePatterns
5122
5134
  });
package/dist/index.d.cts CHANGED
@@ -2,9 +2,11 @@ import { Linter } from 'eslint';
2
2
  import { IgnoreCase } from '@alextheman/utility';
3
3
  import { Config } from 'prettier';
4
4
  import z from 'zod';
5
+ import { RuleFixer, RuleFix, RuleContext } from '@typescript-eslint/utils/ts-eslint';
6
+ import { TSESTree } from '@typescript-eslint/utils';
5
7
 
6
8
  var name = "@alextheman/eslint-plugin";
7
- var version = "3.1.4";
9
+ var version = "3.2.0";
8
10
 
9
11
  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
12
 
@@ -38,6 +40,8 @@ declare const alexPlugin: AlexPlugin;
38
40
 
39
41
  declare const prettierRules: Config;
40
42
 
43
+ declare const reactLanguageOptions: Linter.LanguageOptions;
44
+
41
45
  declare const sortObjects: {
42
46
  customGroups: never[];
43
47
  destructuredObjects: boolean;
@@ -58,6 +62,14 @@ declare const sortObjects: {
58
62
  useConfigurationIf: {};
59
63
  };
60
64
 
65
+ declare const typeScriptLanguageOptions: Linter.LanguageOptions;
66
+
67
+ declare const unusedVarsIgnorePatterns: {
68
+ argsIgnorePattern: string;
69
+ caughtErrorsIgnorePattern: string;
70
+ varsIgnorePattern: string;
71
+ };
72
+
61
73
  declare const validTestFunctionsSchema: z.ZodEnum<{
62
74
  test: "test";
63
75
  it: "it";
@@ -74,6 +86,9 @@ declare const consistentTestFunctionOptionsSchema: z.ZodObject<{
74
86
  type ConsistentTestFunctionOptions = z.infer<typeof consistentTestFunctionOptionsSchema>;
75
87
  declare function parseConsistentTestFunctionOptions(data: unknown): ConsistentTestFunctionOptions;
76
88
 
89
+ type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
90
+ declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleFixerFunction;
91
+
77
92
  declare const noNamespaceImportsOptionsSchema: z.ZodObject<{
78
93
  allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
94
  }, z.core.$strip>;
@@ -100,4 +115,12 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
100
115
  fixable?: boolean | undefined;
101
116
  };
102
117
 
103
- 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, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, sortObjects };
118
+ declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
119
+
120
+ declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [
121
+ {
122
+ preference: string;
123
+ }
124
+ ]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
125
+
126
+ export { type AlexPlugin, type AlexPluginConfigGroup, type CombinedConfig, type ConfigGroupName, type ConfigKey, type ConsistentTestFunctionOptions, type GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, type PersonalConfig, type PluginConfig, type RuleFixerFunction, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, checkCallExpression, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
package/dist/index.d.ts CHANGED
@@ -2,9 +2,11 @@ import { Linter } from 'eslint';
2
2
  import { IgnoreCase } from '@alextheman/utility';
3
3
  import { Config } from 'prettier';
4
4
  import z from 'zod';
5
+ import { RuleFixer, RuleFix, RuleContext } from '@typescript-eslint/utils/ts-eslint';
6
+ import { TSESTree } from '@typescript-eslint/utils';
5
7
 
6
8
  var name = "@alextheman/eslint-plugin";
7
- var version = "3.1.4";
9
+ var version = "3.2.0";
8
10
 
9
11
  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
12
 
@@ -38,6 +40,8 @@ declare const alexPlugin: AlexPlugin;
38
40
 
39
41
  declare const prettierRules: Config;
40
42
 
43
+ declare const reactLanguageOptions: Linter.LanguageOptions;
44
+
41
45
  declare const sortObjects: {
42
46
  customGroups: never[];
43
47
  destructuredObjects: boolean;
@@ -58,6 +62,14 @@ declare const sortObjects: {
58
62
  useConfigurationIf: {};
59
63
  };
60
64
 
65
+ declare const typeScriptLanguageOptions: Linter.LanguageOptions;
66
+
67
+ declare const unusedVarsIgnorePatterns: {
68
+ argsIgnorePattern: string;
69
+ caughtErrorsIgnorePattern: string;
70
+ varsIgnorePattern: string;
71
+ };
72
+
61
73
  declare const validTestFunctionsSchema: z.ZodEnum<{
62
74
  test: "test";
63
75
  it: "it";
@@ -74,6 +86,9 @@ declare const consistentTestFunctionOptionsSchema: z.ZodObject<{
74
86
  type ConsistentTestFunctionOptions = z.infer<typeof consistentTestFunctionOptionsSchema>;
75
87
  declare function parseConsistentTestFunctionOptions(data: unknown): ConsistentTestFunctionOptions;
76
88
 
89
+ type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
90
+ declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleFixerFunction;
91
+
77
92
  declare const noNamespaceImportsOptionsSchema: z.ZodObject<{
78
93
  allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
94
  }, z.core.$strip>;
@@ -100,4 +115,12 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
100
115
  fixable?: boolean | undefined;
101
116
  };
102
117
 
103
- 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, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, sortObjects };
118
+ declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
119
+
120
+ declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [
121
+ {
122
+ preference: string;
123
+ }
124
+ ]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
125
+
126
+ export { type AlexPlugin, type AlexPluginConfigGroup, type CombinedConfig, type ConfigGroupName, type ConfigKey, type ConsistentTestFunctionOptions, type GeneralConfig, type NoNamespaceImportsOptions, type NoRelativeImportsOptions, type PersonalConfig, type PluginConfig, type RuleFixerFunction, type StandardiseErrorMessagesOptions, type TestFunction, type UseNormalizedImportsOptions, checkCallExpression, alexPlugin as default, fixOnCondition, getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules, reactLanguageOptions, sortObjects, typeScriptLanguageOptions, unusedVarsIgnorePatterns };
package/dist/index.js CHANGED
@@ -3744,7 +3744,7 @@ var require_src = __commonJS({
3744
3744
 
3745
3745
  // package.json
3746
3746
  var name = "@alextheman/eslint-plugin";
3747
- var version = "3.1.4";
3747
+ var version = "3.2.0";
3748
3748
 
3749
3749
  // src/configs/index.ts
3750
3750
  import packageJson from "eslint-plugin-package-json";
@@ -5089,7 +5089,10 @@ var alexPlugin_default = alexPlugin;
5089
5089
  // src/index.ts
5090
5090
  var index_default = alexPlugin_default;
5091
5091
  export {
5092
+ checkCallExpression_default as checkCallExpression,
5092
5093
  index_default as default,
5094
+ fixOnCondition_default as fixOnCondition,
5095
+ getImportSpecifiersAfterRemoving_default as getImportSpecifiersAfterRemoving,
5093
5096
  parseConsistentTestFunctionOptions,
5094
5097
  parseNoNamespaceImportsOptions,
5095
5098
  parseNoRelativeImportsOptions,
@@ -5097,5 +5100,8 @@ export {
5097
5100
  parseTestFunction,
5098
5101
  parseUseNormalizedImportsOptions,
5099
5102
  prettierRules_default as prettierRules,
5100
- sortObjects_default as sortObjects
5103
+ reactLanguageOptions_default as reactLanguageOptions,
5104
+ sortObjects_default as sortObjects,
5105
+ typeScriptLanguageOptions_default as typeScriptLanguageOptions,
5106
+ unusedVarsIgnorePatterns_default as unusedVarsIgnorePatterns
5101
5107
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "3.1.4",
3
+ "version": "3.2.0",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "repository": {
6
6
  "type": "git",