@alextheman/eslint-plugin 4.2.5 → 4.4.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 +139 -429
- package/dist/index.d.cts +71 -1
- package/dist/index.d.ts +71 -1
- package/dist/index.js +137 -429
- package/package.json +37 -37
package/dist/index.d.cts
CHANGED
|
@@ -113,6 +113,73 @@ declare const unusedVarsIgnorePatterns: {
|
|
|
113
113
|
//#region src/configs/helpers/vitestConfig.d.ts
|
|
114
114
|
declare function vitestConfig(environment?: VitestEnvironment): vite0.UserConfig;
|
|
115
115
|
//#endregion
|
|
116
|
+
//#region src/configs/helpers/restrictedImports/NoRestrictedImportsOptions.d.ts
|
|
117
|
+
interface RestrictedPathImportBase {
|
|
118
|
+
message: string;
|
|
119
|
+
name: string;
|
|
120
|
+
allowTypeImports?: boolean;
|
|
121
|
+
}
|
|
122
|
+
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
123
|
+
importNames: string[];
|
|
124
|
+
allowImportNames?: never;
|
|
125
|
+
}
|
|
126
|
+
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
127
|
+
allowImportNames: string[];
|
|
128
|
+
importNames?: never;
|
|
129
|
+
}
|
|
130
|
+
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
131
|
+
interface RestrictedPatternImportBase {
|
|
132
|
+
caseSensitive?: boolean;
|
|
133
|
+
message: string;
|
|
134
|
+
allowTypeImports?: boolean;
|
|
135
|
+
}
|
|
136
|
+
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
137
|
+
group: string[];
|
|
138
|
+
regex?: never;
|
|
139
|
+
}
|
|
140
|
+
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
141
|
+
regex: string;
|
|
142
|
+
group?: never;
|
|
143
|
+
}
|
|
144
|
+
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
145
|
+
importNames: string[];
|
|
146
|
+
allowImportNames?: never;
|
|
147
|
+
importNamePattern?: never;
|
|
148
|
+
allowImportNamePattern?: never;
|
|
149
|
+
}
|
|
150
|
+
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
151
|
+
importNames?: never;
|
|
152
|
+
allowImportNames: string[];
|
|
153
|
+
importNamePattern?: never;
|
|
154
|
+
allowImportNamePattern?: never;
|
|
155
|
+
}
|
|
156
|
+
interface RestrictedPatternImportImportNamePattern extends RestrictedPatternImportBase {
|
|
157
|
+
importNames?: never;
|
|
158
|
+
allowImportNames?: never;
|
|
159
|
+
importNamePattern: string;
|
|
160
|
+
allowImportNamePattern?: never;
|
|
161
|
+
}
|
|
162
|
+
interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatternImportBase {
|
|
163
|
+
importNames?: never;
|
|
164
|
+
allowImportNames?: never;
|
|
165
|
+
importNamePattern?: never;
|
|
166
|
+
allowImportNamePattern: string;
|
|
167
|
+
}
|
|
168
|
+
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
169
|
+
interface NoRestrictedImportsOptionsPathsOnly {
|
|
170
|
+
paths: RestrictedPathImport[];
|
|
171
|
+
patterns?: never;
|
|
172
|
+
}
|
|
173
|
+
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
174
|
+
paths?: never;
|
|
175
|
+
patterns: RestrictedPatternImport[];
|
|
176
|
+
}
|
|
177
|
+
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
178
|
+
paths: RestrictedPathImport[];
|
|
179
|
+
patterns: RestrictedPatternImport[];
|
|
180
|
+
}
|
|
181
|
+
type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestrictedImportsOptionsPatternsOnly | NoRestrictedImportsOptionsPathsAndPatterns;
|
|
182
|
+
//#endregion
|
|
116
183
|
//#region src/rules/consistent-test-function.d.ts
|
|
117
184
|
declare const validTestFunctionsSchema: z.ZodEnum<{
|
|
118
185
|
test: "test";
|
|
@@ -167,10 +234,13 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
|
|
|
167
234
|
//#region src/utility/checkCallExpression.d.ts
|
|
168
235
|
declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
|
|
169
236
|
//#endregion
|
|
237
|
+
//#region src/utility/combineRestrictedImports.d.ts
|
|
238
|
+
declare function combineRestrictedImports(firstGroup: NoRestrictedImportsOptions, secondGroup: NoRestrictedImportsOptions): NoRestrictedImportsOptions;
|
|
239
|
+
//#endregion
|
|
170
240
|
//#region src/utility/createRuleSchemaFromZodSchema.d.ts
|
|
171
241
|
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
|
|
172
242
|
//#endregion
|
|
173
243
|
//#region src/utility/getImportSpecifiersAfterRemoving.d.ts
|
|
174
244
|
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
175
245
|
//#endregion
|
|
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 };
|
|
246
|
+
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
|
@@ -113,6 +113,73 @@ declare const unusedVarsIgnorePatterns: {
|
|
|
113
113
|
//#region src/configs/helpers/vitestConfig.d.ts
|
|
114
114
|
declare function vitestConfig(environment?: VitestEnvironment): vite0.UserConfig;
|
|
115
115
|
//#endregion
|
|
116
|
+
//#region src/configs/helpers/restrictedImports/NoRestrictedImportsOptions.d.ts
|
|
117
|
+
interface RestrictedPathImportBase {
|
|
118
|
+
message: string;
|
|
119
|
+
name: string;
|
|
120
|
+
allowTypeImports?: boolean;
|
|
121
|
+
}
|
|
122
|
+
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
123
|
+
importNames: string[];
|
|
124
|
+
allowImportNames?: never;
|
|
125
|
+
}
|
|
126
|
+
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
127
|
+
allowImportNames: string[];
|
|
128
|
+
importNames?: never;
|
|
129
|
+
}
|
|
130
|
+
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
131
|
+
interface RestrictedPatternImportBase {
|
|
132
|
+
caseSensitive?: boolean;
|
|
133
|
+
message: string;
|
|
134
|
+
allowTypeImports?: boolean;
|
|
135
|
+
}
|
|
136
|
+
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
137
|
+
group: string[];
|
|
138
|
+
regex?: never;
|
|
139
|
+
}
|
|
140
|
+
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
141
|
+
regex: string;
|
|
142
|
+
group?: never;
|
|
143
|
+
}
|
|
144
|
+
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
145
|
+
importNames: string[];
|
|
146
|
+
allowImportNames?: never;
|
|
147
|
+
importNamePattern?: never;
|
|
148
|
+
allowImportNamePattern?: never;
|
|
149
|
+
}
|
|
150
|
+
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
151
|
+
importNames?: never;
|
|
152
|
+
allowImportNames: string[];
|
|
153
|
+
importNamePattern?: never;
|
|
154
|
+
allowImportNamePattern?: never;
|
|
155
|
+
}
|
|
156
|
+
interface RestrictedPatternImportImportNamePattern extends RestrictedPatternImportBase {
|
|
157
|
+
importNames?: never;
|
|
158
|
+
allowImportNames?: never;
|
|
159
|
+
importNamePattern: string;
|
|
160
|
+
allowImportNamePattern?: never;
|
|
161
|
+
}
|
|
162
|
+
interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatternImportBase {
|
|
163
|
+
importNames?: never;
|
|
164
|
+
allowImportNames?: never;
|
|
165
|
+
importNamePattern?: never;
|
|
166
|
+
allowImportNamePattern: string;
|
|
167
|
+
}
|
|
168
|
+
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
169
|
+
interface NoRestrictedImportsOptionsPathsOnly {
|
|
170
|
+
paths: RestrictedPathImport[];
|
|
171
|
+
patterns?: never;
|
|
172
|
+
}
|
|
173
|
+
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
174
|
+
paths?: never;
|
|
175
|
+
patterns: RestrictedPatternImport[];
|
|
176
|
+
}
|
|
177
|
+
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
178
|
+
paths: RestrictedPathImport[];
|
|
179
|
+
patterns: RestrictedPatternImport[];
|
|
180
|
+
}
|
|
181
|
+
type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestrictedImportsOptionsPatternsOnly | NoRestrictedImportsOptionsPathsAndPatterns;
|
|
182
|
+
//#endregion
|
|
116
183
|
//#region src/rules/consistent-test-function.d.ts
|
|
117
184
|
declare const validTestFunctionsSchema: z.ZodEnum<{
|
|
118
185
|
test: "test";
|
|
@@ -167,10 +234,13 @@ declare function parseUseNormalizedImportsOptions(data: unknown): {
|
|
|
167
234
|
//#region src/utility/checkCallExpression.d.ts
|
|
168
235
|
declare function checkCallExpression(node: TSESTree.CallExpression, objectName: string, propertyName: string): boolean;
|
|
169
236
|
//#endregion
|
|
237
|
+
//#region src/utility/combineRestrictedImports.d.ts
|
|
238
|
+
declare function combineRestrictedImports(firstGroup: NoRestrictedImportsOptions, secondGroup: NoRestrictedImportsOptions): NoRestrictedImportsOptions;
|
|
239
|
+
//#endregion
|
|
170
240
|
//#region src/utility/createRuleSchemaFromZodSchema.d.ts
|
|
171
241
|
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4[];
|
|
172
242
|
//#endregion
|
|
173
243
|
//#region src/utility/getImportSpecifiersAfterRemoving.d.ts
|
|
174
244
|
declare function getImportSpecifiersAfterRemoving(context: Readonly<RuleContext<"message", [ConsistentTestFunctionOptions]>>, specifiers: TSESTree.ImportClause[], importToRemove: string): string;
|
|
175
245
|
//#endregion
|
|
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 };
|
|
246
|
+
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 };
|