@alextheman/eslint-plugin 5.2.2 → 5.3.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 +69 -65
- package/dist/index.d.cts +56 -153
- package/dist/index.d.ts +55 -152
- package/dist/index.js +68 -51
- package/dist/utility/index.cjs +209 -0
- package/dist/utility/index.d.cts +208 -0
- package/dist/utility/index.d.ts +208 -0
- package/dist/utility/index.js +176 -0
- package/package.json +16 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,23 @@ import { TypeDocOptions } from "typedoc";
|
|
|
6
6
|
import { PluginOptions } from "typedoc-plugin-markdown";
|
|
7
7
|
import * as vite0 from "vite";
|
|
8
8
|
import { VitestEnvironment } from "vitest/node";
|
|
9
|
-
import { RuleContext, RuleFix, RuleFixer } from "@typescript-eslint/utils/ts-eslint";
|
|
10
9
|
import { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
|
|
10
|
+
import { RuleContext, RuleFix, RuleFixer } from "@typescript-eslint/utils/ts-eslint";
|
|
11
11
|
|
|
12
12
|
//#region src/utility/private/camelToKebab.d.ts
|
|
13
13
|
type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/utility/public/GetFlattenedConfigNames.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* A helper type to turn the keys of a doubly-nested object into a flattened ESLint config key.
|
|
18
|
+
*
|
|
19
|
+
* @category Utility
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* type ConfigNames = GetFlattenedConfigNames<{ general: { typescriptReact }}> // "general/typescript-react"
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
16
26
|
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config[]> }> = { [Group in keyof ConfigObject & string]: `${CamelToKebab<Group>}/${CamelToKebab<keyof ConfigObject[Group] & string>}` }[keyof ConfigObject & string];
|
|
17
27
|
//#endregion
|
|
18
28
|
//#region src/configs/AlexPluginConfigGroup.d.ts
|
|
@@ -49,101 +59,30 @@ interface AlexPlugin {
|
|
|
49
59
|
}
|
|
50
60
|
declare const alexPlugin: AlexPlugin;
|
|
51
61
|
//#endregion
|
|
52
|
-
//#region src/configs/
|
|
53
|
-
declare const
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/configs/helpers/reactLanguageOptions.d.ts
|
|
56
|
-
declare const reactLanguageOptions: Linter.LanguageOptions;
|
|
62
|
+
//#region src/configs/external/prettierConfig.d.ts
|
|
63
|
+
declare const prettierConfig: Config;
|
|
57
64
|
//#endregion
|
|
58
|
-
//#region src/configs/
|
|
65
|
+
//#region src/configs/external/typeDocConfig.d.ts
|
|
59
66
|
declare const typeDocConfig: TypeDocOptions & PluginOptions;
|
|
60
67
|
//#endregion
|
|
61
|
-
//#region src/configs/
|
|
62
|
-
declare const typeScriptLanguageOptions: Linter.LanguageOptions;
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region src/configs/helpers/unusedVarsIgnorePatterns.d.ts
|
|
65
|
-
declare const unusedVarsIgnorePatterns: {
|
|
66
|
-
argsIgnorePattern: string;
|
|
67
|
-
caughtErrorsIgnorePattern: string;
|
|
68
|
-
varsIgnorePattern: string;
|
|
69
|
-
};
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/configs/helpers/vitestConfig.d.ts
|
|
68
|
+
//#region src/configs/external/vitestConfig.d.ts
|
|
72
69
|
declare function vitestConfig(environment?: VitestEnvironment): vite0.UserConfig;
|
|
73
70
|
//#endregion
|
|
74
|
-
//#region src/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
type: string;
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/configs/helpers/sorting/sortExports.d.ts
|
|
91
|
-
declare const sortExports: {
|
|
92
|
-
customGroups: never[];
|
|
93
|
-
fallbackSort: {
|
|
94
|
-
type: string;
|
|
95
|
-
};
|
|
96
|
-
groups: string[];
|
|
97
|
-
ignoreCase: boolean;
|
|
98
|
-
newlinesBetween: number;
|
|
99
|
-
order: string;
|
|
100
|
-
partitionByComment: boolean;
|
|
101
|
-
partitionByNewLine: boolean;
|
|
102
|
-
specialCharacters: string;
|
|
103
|
-
type: string;
|
|
104
|
-
};
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/configs/helpers/sorting/sortImports.d.ts
|
|
107
|
-
declare const sortImports: {
|
|
108
|
-
customGroups: ({
|
|
109
|
-
elementNamePattern: string[];
|
|
110
|
-
groupName: string;
|
|
111
|
-
selector?: undefined;
|
|
112
|
-
} | {
|
|
113
|
-
elementNamePattern: string[];
|
|
114
|
-
groupName: string;
|
|
115
|
-
selector: string;
|
|
116
|
-
})[];
|
|
117
|
-
groups: string[];
|
|
118
|
-
ignoreCase: boolean;
|
|
119
|
-
internalPattern: string[];
|
|
120
|
-
newlinesBetween: number;
|
|
121
|
-
order: string;
|
|
122
|
-
partitionByComment: boolean;
|
|
123
|
-
partitionByNewLine: boolean;
|
|
124
|
-
specialCharacters: string;
|
|
125
|
-
type: string;
|
|
126
|
-
};
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/configs/helpers/sorting/sortObjects.d.ts
|
|
129
|
-
declare const sortObjects: {
|
|
130
|
-
customGroups: never[];
|
|
131
|
-
fallbackSort: {
|
|
132
|
-
type: string;
|
|
133
|
-
};
|
|
134
|
-
groups: never[];
|
|
135
|
-
ignoreCase: boolean;
|
|
136
|
-
newlinesBetween: string;
|
|
137
|
-
order: string;
|
|
138
|
-
partitionByComment: boolean;
|
|
139
|
-
partitionByNewLine: boolean;
|
|
140
|
-
specialCharacters: string;
|
|
141
|
-
styledComponents: boolean;
|
|
142
|
-
type: string;
|
|
143
|
-
useConfigurationIf: {};
|
|
144
|
-
};
|
|
71
|
+
//#region src/utility/public/checkCallExpression.d.ts
|
|
72
|
+
/**
|
|
73
|
+
* Checks if a given node matches the expected object and property names.
|
|
74
|
+
*
|
|
75
|
+
* @category Utility
|
|
76
|
+
*
|
|
77
|
+
* @param node - The node to check.
|
|
78
|
+
* @param objectName - The object name to compare against the node.
|
|
79
|
+
* @param propertyName - The property name to compare against the node.
|
|
80
|
+
*
|
|
81
|
+
* @returns A value of `true` if the given `objectName` and `propertyName` matches those of the node, and `false` otherwise.
|
|
82
|
+
*/
|
|
83
|
+
declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
|
|
145
84
|
//#endregion
|
|
146
|
-
//#region src/
|
|
85
|
+
//#region src/utility/public/NoRestrictedImportsOptions.d.ts
|
|
147
86
|
interface RestrictedPathImportBase {
|
|
148
87
|
message: string;
|
|
149
88
|
name: string;
|
|
@@ -208,75 +147,19 @@ interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
|
208
147
|
paths: RestrictedPathImport[];
|
|
209
148
|
patterns: RestrictedPatternImport[];
|
|
210
149
|
}
|
|
211
|
-
type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestrictedImportsOptionsPatternsOnly | NoRestrictedImportsOptionsPathsAndPatterns;
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/rules/consistent-test-function.d.ts
|
|
214
|
-
declare const validTestFunctionsSchema: z.ZodEnum<{
|
|
215
|
-
test: "test";
|
|
216
|
-
it: "it";
|
|
217
|
-
}>;
|
|
218
|
-
type TestFunction = z.infer<typeof validTestFunctionsSchema>;
|
|
219
|
-
declare function parseTestFunction(data: unknown): TestFunction;
|
|
220
|
-
declare const consistentTestFunctionOptionsSchema: z.ZodObject<{
|
|
221
|
-
preference: z.ZodOptional<z.ZodEnum<{
|
|
222
|
-
test: "test";
|
|
223
|
-
it: "it";
|
|
224
|
-
}>>;
|
|
225
|
-
fixable: z.ZodOptional<z.ZodBoolean>;
|
|
226
|
-
}, z.core.$strip>;
|
|
227
|
-
type ConsistentTestFunctionOptions = z.infer<typeof consistentTestFunctionOptionsSchema>;
|
|
228
|
-
declare function parseConsistentTestFunctionOptions(data: unknown): ConsistentTestFunctionOptions;
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region src/rules/helpers/fixOnCondition.d.ts
|
|
231
|
-
type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
|
|
232
|
-
declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleFixerFunction;
|
|
233
|
-
//#endregion
|
|
234
|
-
//#region src/rules/no-namespace-imports.d.ts
|
|
235
|
-
declare const noNamespaceImportsOptionsSchema: z.ZodObject<{
|
|
236
|
-
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
237
|
-
}, z.core.$strip>;
|
|
238
|
-
type NoNamespaceImportsOptions = z.infer<typeof noNamespaceImportsOptionsSchema>;
|
|
239
|
-
declare function parseNoNamespaceImportsOptions(data: unknown): NoNamespaceImportsOptions;
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region src/rules/no-relative-imports.d.ts
|
|
242
|
-
declare const noRelativeImportsOptionsSchema: z.ZodObject<{
|
|
243
|
-
depth: z.ZodOptional<z.ZodInt>;
|
|
244
|
-
}, z.core.$strip>;
|
|
245
|
-
type NoRelativeImportsOptions = z.infer<typeof noRelativeImportsOptionsSchema>;
|
|
246
|
-
declare function parseNoRelativeImportsOptions(data: unknown): NoRelativeImportsOptions;
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/rules/standardise-error-messages.d.ts
|
|
249
|
-
declare const standardiseErrorMessagesOptionsSchema: z.ZodObject<{
|
|
250
|
-
regex: z.ZodOptional<z.ZodString>;
|
|
251
|
-
}, z.core.$strip>;
|
|
252
|
-
type StandardiseErrorMessagesOptions = z.infer<typeof standardiseErrorMessagesOptionsSchema>;
|
|
253
|
-
declare function parseStandardiseErrorMessagesOptions(data: unknown): StandardiseErrorMessagesOptions;
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/rules/use-normalized-imports.d.ts
|
|
256
|
-
declare const useNormalizedImportsOptionsSchema: z.ZodObject<{
|
|
257
|
-
fixable: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
-
}, z.core.$strip>;
|
|
259
|
-
type UseNormalizedImportsOptions = z.infer<typeof useNormalizedImportsOptionsSchema>;
|
|
260
|
-
declare function parseUseNormalizedImportsOptions(data: unknown): {
|
|
261
|
-
fixable?: boolean | undefined;
|
|
262
|
-
};
|
|
263
|
-
//#endregion
|
|
264
|
-
//#region src/utility/public/checkCallExpression.d.ts
|
|
265
150
|
/**
|
|
266
|
-
*
|
|
151
|
+
* Options for the built-in ESLint `no-restricted-imports` rule.
|
|
267
152
|
*
|
|
268
|
-
*
|
|
269
|
-
* @param objectName - The object name to compare against the node.
|
|
270
|
-
* @param propertyName - The property name to compare against the node.
|
|
271
|
-
*
|
|
272
|
-
* @returns A value of `true` if the given `objectName` and `propertyName` matches those of the node, and `false` otherwise.
|
|
153
|
+
* @category Rule Options
|
|
273
154
|
*/
|
|
274
|
-
|
|
155
|
+
type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestrictedImportsOptionsPatternsOnly | NoRestrictedImportsOptionsPathsAndPatterns;
|
|
275
156
|
//#endregion
|
|
276
157
|
//#region src/utility/public/combineRestrictedImports.d.ts
|
|
277
158
|
/**
|
|
278
159
|
* Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
|
|
279
160
|
*
|
|
161
|
+
* @category Utility
|
|
162
|
+
*
|
|
280
163
|
* @param groups - Option groups to combine, applied in the order provided.
|
|
281
164
|
*
|
|
282
165
|
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
@@ -287,16 +170,34 @@ declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[
|
|
|
287
170
|
/**
|
|
288
171
|
* Converts a Zod schema to a JSON schema for usage in an ESLint rule.
|
|
289
172
|
*
|
|
173
|
+
* @category Utility
|
|
174
|
+
*
|
|
290
175
|
* @param schema - The Zod schema to convert.
|
|
291
176
|
*
|
|
292
177
|
* @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
|
|
293
178
|
*/
|
|
294
179
|
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
|
|
295
180
|
//#endregion
|
|
181
|
+
//#region src/utility/public/fixOnCondition.d.ts
|
|
182
|
+
type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
|
|
183
|
+
/**
|
|
184
|
+
* Returns a rule fixer function to run based on a given condition
|
|
185
|
+
*
|
|
186
|
+
* @category Utility
|
|
187
|
+
*
|
|
188
|
+
* @param fixable - Whether the rule should be treated as fixable or not, and therefore whether the fixer should run.
|
|
189
|
+
* @param fix - The rule fixer function to run.
|
|
190
|
+
*
|
|
191
|
+
* @returns The rule fixer function invoked with the fixer, provided the fixable condition is met.
|
|
192
|
+
*/
|
|
193
|
+
declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleFixerFunction;
|
|
194
|
+
//#endregion
|
|
296
195
|
//#region src/utility/public/flattenConfigs.d.ts
|
|
297
196
|
/**
|
|
298
197
|
* Takes in a nested group of configs, and returns them flattened according to ESLint config naming conventions.
|
|
299
198
|
*
|
|
199
|
+
* @category Utility
|
|
200
|
+
*
|
|
300
201
|
* @template ConfigObject - The type of the input config object.
|
|
301
202
|
*
|
|
302
203
|
* @param config - A doubly-nested config object to pass in, where the key of the top-level object is the config group name, and the key of the nested object is the name of the config within the group (e.g. `groupName.configName`).
|
|
@@ -337,6 +238,8 @@ declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]
|
|
|
337
238
|
*
|
|
338
239
|
* Useful for auto-fixable rules that remove a specific import from an import statement.
|
|
339
240
|
*
|
|
241
|
+
* @category Utility
|
|
242
|
+
*
|
|
340
243
|
* @template RuleOptions - The type of the RuleOptions from the given context.
|
|
341
244
|
*
|
|
342
245
|
* @param context - The current ESLint rule context.
|
|
@@ -347,4 +250,4 @@ declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]
|
|
|
347
250
|
*/
|
|
348
251
|
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
349
252
|
//#endregion
|
|
350
|
-
export { AlexConfigGroupName, AlexFlattenedConfigName, type AlexPlugin, AlexPluginConfigFlattened, AlexPluginConfigObject, CombinedConfig,
|
|
253
|
+
export { AlexConfigGroupName, AlexFlattenedConfigName, type AlexPlugin, AlexPluginConfigFlattened, AlexPluginConfigObject, CombinedConfig, GeneralConfig, type GetFlattenedConfigNames, type NoRestrictedImportsOptions, PersonalConfig, PluginConfig, checkCallExpression, combineRestrictedImports, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, flattenConfigs, getImportSpecifiersAfterRemoving, prettierConfig, typeDocConfig, vitestConfig };
|
package/dist/index.js
CHANGED
|
@@ -7,9 +7,9 @@ import importPlugin from "eslint-plugin-import";
|
|
|
7
7
|
import nodePlugin from "eslint-plugin-n";
|
|
8
8
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
9
9
|
import prettierPlugin from "eslint-plugin-prettier";
|
|
10
|
-
import tseslint from "typescript-eslint";
|
|
11
10
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
12
11
|
import { defineConfig } from "vitest/config";
|
|
12
|
+
import tseslint from "typescript-eslint";
|
|
13
13
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
14
14
|
import reactPlugin from "eslint-plugin-react";
|
|
15
15
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
@@ -3412,6 +3412,8 @@ var generalRestrictedImports_default = generalRestrictedImports;
|
|
|
3412
3412
|
/**
|
|
3413
3413
|
* Checks if a given node matches the expected object and property names.
|
|
3414
3414
|
*
|
|
3415
|
+
* @category Utility
|
|
3416
|
+
*
|
|
3415
3417
|
* @param node - The node to check.
|
|
3416
3418
|
* @param objectName - The object name to compare against the node.
|
|
3417
3419
|
* @param propertyName - The property name to compare against the node.
|
|
@@ -3428,6 +3430,8 @@ var checkCallExpression_default = checkCallExpression;
|
|
|
3428
3430
|
/**
|
|
3429
3431
|
* Combines multiple option groups for the native ESLint `no-restricted-imports` rule, without overwriting previous configurations.
|
|
3430
3432
|
*
|
|
3433
|
+
* @category Utility
|
|
3434
|
+
*
|
|
3431
3435
|
* @param groups - Option groups to combine, applied in the order provided.
|
|
3432
3436
|
*
|
|
3433
3437
|
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
@@ -3454,6 +3458,8 @@ var combineRestrictedImports_default = combineRestrictedImports;
|
|
|
3454
3458
|
/**
|
|
3455
3459
|
* Converts a Zod schema to a JSON schema for usage in an ESLint rule.
|
|
3456
3460
|
*
|
|
3461
|
+
* @category Utility
|
|
3462
|
+
*
|
|
3457
3463
|
* @param schema - The Zod schema to convert.
|
|
3458
3464
|
*
|
|
3459
3465
|
* @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
|
|
@@ -3463,6 +3469,26 @@ function createRuleSchemaFromZodSchema(schema$1) {
|
|
|
3463
3469
|
}
|
|
3464
3470
|
var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
|
|
3465
3471
|
|
|
3472
|
+
//#endregion
|
|
3473
|
+
//#region src/utility/public/fixOnCondition.ts
|
|
3474
|
+
/**
|
|
3475
|
+
* Returns a rule fixer function to run based on a given condition
|
|
3476
|
+
*
|
|
3477
|
+
* @category Utility
|
|
3478
|
+
*
|
|
3479
|
+
* @param fixable - Whether the rule should be treated as fixable or not, and therefore whether the fixer should run.
|
|
3480
|
+
* @param fix - The rule fixer function to run.
|
|
3481
|
+
*
|
|
3482
|
+
* @returns The rule fixer function invoked with the fixer, provided the fixable condition is met.
|
|
3483
|
+
*/
|
|
3484
|
+
function fixOnCondition(fixable, fix) {
|
|
3485
|
+
return (fixer) => {
|
|
3486
|
+
if (!fixable) return null;
|
|
3487
|
+
return fix(fixer);
|
|
3488
|
+
};
|
|
3489
|
+
}
|
|
3490
|
+
var fixOnCondition_default = fixOnCondition;
|
|
3491
|
+
|
|
3466
3492
|
//#endregion
|
|
3467
3493
|
//#region src/utility/private/camelToKebab.ts
|
|
3468
3494
|
function camelToKebab$1(string) {
|
|
@@ -3485,6 +3511,8 @@ var createConfigGroup_default = createConfigGroup;
|
|
|
3485
3511
|
/**
|
|
3486
3512
|
* Takes in a nested group of configs, and returns them flattened according to ESLint config naming conventions.
|
|
3487
3513
|
*
|
|
3514
|
+
* @category Utility
|
|
3515
|
+
*
|
|
3488
3516
|
* @template ConfigObject - The type of the input config object.
|
|
3489
3517
|
*
|
|
3490
3518
|
* @param config - A doubly-nested config object to pass in, where the key of the top-level object is the config group name, and the key of the nested object is the name of the config within the group (e.g. `groupName.configName`).
|
|
@@ -3531,6 +3559,8 @@ var flattenConfigs_default = flattenConfigs;
|
|
|
3531
3559
|
*
|
|
3532
3560
|
* Useful for auto-fixable rules that remove a specific import from an import statement.
|
|
3533
3561
|
*
|
|
3562
|
+
* @category Utility
|
|
3563
|
+
*
|
|
3534
3564
|
* @template RuleOptions - The type of the RuleOptions from the given context.
|
|
3535
3565
|
*
|
|
3536
3566
|
* @param context - The current ESLint rule context.
|
|
@@ -3707,21 +3737,12 @@ const generalJavaScript = [
|
|
|
3707
3737
|
var javaScript_default$1 = generalJavaScript;
|
|
3708
3738
|
|
|
3709
3739
|
//#endregion
|
|
3710
|
-
//#region src/configs/
|
|
3711
|
-
const
|
|
3712
|
-
var
|
|
3713
|
-
|
|
3714
|
-
//#endregion
|
|
3715
|
-
//#region src/configs/helpers/reactLanguageOptions.ts
|
|
3716
|
-
const reactLanguageOptions = {
|
|
3717
|
-
ecmaVersion: 2020,
|
|
3718
|
-
globals: import_globals.default.browser,
|
|
3719
|
-
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
3720
|
-
};
|
|
3721
|
-
var reactLanguageOptions_default = reactLanguageOptions;
|
|
3740
|
+
//#region src/configs/external/prettierConfig.ts
|
|
3741
|
+
const prettierConfig$1 = { printWidth: 100 };
|
|
3742
|
+
var prettierConfig_default = prettierConfig$1;
|
|
3722
3743
|
|
|
3723
3744
|
//#endregion
|
|
3724
|
-
//#region src/configs/
|
|
3745
|
+
//#region src/configs/external/typeDocConfig.ts
|
|
3725
3746
|
const typeDocConfig = {
|
|
3726
3747
|
disableSources: true,
|
|
3727
3748
|
entryPoints: ["./src/index.ts"],
|
|
@@ -3745,20 +3766,7 @@ const typeDocConfig = {
|
|
|
3745
3766
|
var typeDocConfig_default = typeDocConfig;
|
|
3746
3767
|
|
|
3747
3768
|
//#endregion
|
|
3748
|
-
//#region src/configs/
|
|
3749
|
-
const typeScriptLanguageOptions = {
|
|
3750
|
-
parser: tseslint.parser,
|
|
3751
|
-
parserOptions: {
|
|
3752
|
-
ecmaVersion: "latest",
|
|
3753
|
-
projectService: true,
|
|
3754
|
-
sourceType: "module",
|
|
3755
|
-
tsconfigRootDir: process.cwd()
|
|
3756
|
-
}
|
|
3757
|
-
};
|
|
3758
|
-
var typeScriptLanguageOptions_default = typeScriptLanguageOptions;
|
|
3759
|
-
|
|
3760
|
-
//#endregion
|
|
3761
|
-
//#region src/configs/helpers/vitestConfig.ts
|
|
3769
|
+
//#region src/configs/external/vitestConfig.ts
|
|
3762
3770
|
function vitestConfig(environment = "jsdom") {
|
|
3763
3771
|
return defineConfig({
|
|
3764
3772
|
plugins: [tsconfigPaths()],
|
|
@@ -3771,6 +3779,28 @@ function vitestConfig(environment = "jsdom") {
|
|
|
3771
3779
|
}
|
|
3772
3780
|
var vitestConfig_default = vitestConfig;
|
|
3773
3781
|
|
|
3782
|
+
//#endregion
|
|
3783
|
+
//#region src/configs/helpers/reactLanguageOptions.ts
|
|
3784
|
+
const reactLanguageOptions = {
|
|
3785
|
+
ecmaVersion: 2020,
|
|
3786
|
+
globals: import_globals.default.browser,
|
|
3787
|
+
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
3788
|
+
};
|
|
3789
|
+
var reactLanguageOptions_default = reactLanguageOptions;
|
|
3790
|
+
|
|
3791
|
+
//#endregion
|
|
3792
|
+
//#region src/configs/helpers/typeScriptLanguageOptions.ts
|
|
3793
|
+
const typeScriptLanguageOptions = {
|
|
3794
|
+
parser: tseslint.parser,
|
|
3795
|
+
parserOptions: {
|
|
3796
|
+
ecmaVersion: "latest",
|
|
3797
|
+
projectService: true,
|
|
3798
|
+
sourceType: "module",
|
|
3799
|
+
tsconfigRootDir: process.cwd()
|
|
3800
|
+
}
|
|
3801
|
+
};
|
|
3802
|
+
var typeScriptLanguageOptions_default = typeScriptLanguageOptions;
|
|
3803
|
+
|
|
3774
3804
|
//#endregion
|
|
3775
3805
|
//#region src/configs/helpers/sorting/sortClasses.ts
|
|
3776
3806
|
const sortClasses = {
|
|
@@ -3913,7 +3943,7 @@ function personalJavaScript(plugin) {
|
|
|
3913
3943
|
"prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
|
|
3914
3944
|
"prefer-destructuring": "error",
|
|
3915
3945
|
"prefer-template": "error",
|
|
3916
|
-
"prettier/prettier": ["warn",
|
|
3946
|
+
"prettier/prettier": ["warn", prettierConfig_default],
|
|
3917
3947
|
"sort-vars": "error"
|
|
3918
3948
|
}
|
|
3919
3949
|
}, {
|
|
@@ -4131,14 +4161,14 @@ var components_default = personalComponents;
|
|
|
4131
4161
|
//#endregion
|
|
4132
4162
|
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
4133
4163
|
const eslintPluginRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [
|
|
4134
|
-
|
|
4135
|
-
"
|
|
4136
|
-
"
|
|
4137
|
-
"src"
|
|
4138
|
-
|
|
4164
|
+
{
|
|
4165
|
+
importNames: ["default"],
|
|
4166
|
+
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
4167
|
+
name: "src/alexPlugin"
|
|
4168
|
+
},
|
|
4169
|
+
...["src/index", "src"].map((name$1) => {
|
|
4139
4170
|
return {
|
|
4140
|
-
|
|
4141
|
-
message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
|
|
4171
|
+
message: "Do not import directly from the index file.",
|
|
4142
4172
|
name: name$1
|
|
4143
4173
|
};
|
|
4144
4174
|
}),
|
|
@@ -4375,22 +4405,9 @@ const createRule = ESLintUtils.RuleCreator((ruleName) => {
|
|
|
4375
4405
|
});
|
|
4376
4406
|
var createRule_default = createRule;
|
|
4377
4407
|
|
|
4378
|
-
//#endregion
|
|
4379
|
-
//#region src/rules/helpers/fixOnCondition.ts
|
|
4380
|
-
function fixOnCondition(fixable, fix) {
|
|
4381
|
-
return (fixer) => {
|
|
4382
|
-
if (!fixable) return null;
|
|
4383
|
-
return fix(fixer);
|
|
4384
|
-
};
|
|
4385
|
-
}
|
|
4386
|
-
var fixOnCondition_default = fixOnCondition;
|
|
4387
|
-
|
|
4388
4408
|
//#endregion
|
|
4389
4409
|
//#region src/rules/consistent-test-function.ts
|
|
4390
4410
|
const validTestFunctionsSchema = z.enum(["test", "it"]);
|
|
4391
|
-
function parseTestFunction(data) {
|
|
4392
|
-
return validTestFunctionsSchema.parse(data);
|
|
4393
|
-
}
|
|
4394
4411
|
const consistentTestFunctionOptionsSchema = z.object({
|
|
4395
4412
|
preference: validTestFunctionsSchema,
|
|
4396
4413
|
fixable: z.boolean()
|
|
@@ -4786,7 +4803,7 @@ var rules_default = {
|
|
|
4786
4803
|
//#endregion
|
|
4787
4804
|
//#region package.json
|
|
4788
4805
|
var name = "@alextheman/eslint-plugin";
|
|
4789
|
-
var version = "5.
|
|
4806
|
+
var version = "5.3.0";
|
|
4790
4807
|
|
|
4791
4808
|
//#endregion
|
|
4792
4809
|
//#region src/alexPlugin.ts
|
|
@@ -4807,4 +4824,4 @@ var alexPlugin_default = alexPlugin;
|
|
|
4807
4824
|
var src_default = alexPlugin_default;
|
|
4808
4825
|
|
|
4809
4826
|
//#endregion
|
|
4810
|
-
export { checkCallExpression_default as checkCallExpression, combineRestrictedImports_default as combineRestrictedImports, createRuleSchemaFromZodSchema_default as createRuleSchemaFromZodSchema, src_default as default, fixOnCondition_default as fixOnCondition, flattenConfigs_default as flattenConfigs, getImportSpecifiersAfterRemoving_default as getImportSpecifiersAfterRemoving,
|
|
4827
|
+
export { checkCallExpression_default as checkCallExpression, combineRestrictedImports_default as combineRestrictedImports, createRuleSchemaFromZodSchema_default as createRuleSchemaFromZodSchema, src_default as default, fixOnCondition_default as fixOnCondition, flattenConfigs_default as flattenConfigs, getImportSpecifiersAfterRemoving_default as getImportSpecifiersAfterRemoving, prettierConfig_default as prettierConfig, typeDocConfig_default as typeDocConfig, vitestConfig_default as vitestConfig };
|