@alextheman/eslint-plugin 5.9.1 → 5.10.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 +2 -2
- package/dist/index.d.cts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +2 -2
- package/dist/internal/index.d.cts +10 -10
- package/dist/internal/index.d.ts +10 -10
- package/dist/utility/index.d.cts +14 -14
- package/dist/utility/index.d.ts +14 -14
- package/package.json +16 -15
package/dist/index.cjs
CHANGED
|
@@ -4930,7 +4930,7 @@ function internalTypeScript(plugin) {
|
|
|
4930
4930
|
},
|
|
4931
4931
|
rules: {
|
|
4932
4932
|
"@alextheman/standardise-error-messages": "off",
|
|
4933
|
-
"@typescript-eslint/array-type": ["error", { default: "
|
|
4933
|
+
"@typescript-eslint/array-type": ["error", { default: "generic" }],
|
|
4934
4934
|
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
4935
4935
|
"@typescript-eslint/consistent-type-definitions": "error",
|
|
4936
4936
|
"@typescript-eslint/dot-notation": "error",
|
|
@@ -5558,7 +5558,7 @@ var rules_default = {
|
|
|
5558
5558
|
//#endregion
|
|
5559
5559
|
//#region package.json
|
|
5560
5560
|
var name = "@alextheman/eslint-plugin";
|
|
5561
|
-
var version = "5.
|
|
5561
|
+
var version = "5.10.0";
|
|
5562
5562
|
|
|
5563
5563
|
//#endregion
|
|
5564
5564
|
//#region src/alexPlugin.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -23,7 +23,7 @@ type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? H
|
|
|
23
23
|
* type ConfigNames = GetFlattenedConfigNames<{ general: { typescriptReact }}> // "general/typescript-react"
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
26
|
+
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }> = { [Group in keyof ConfigObject & string]: `${CamelToKebab<Group>}/${CamelToKebab<keyof ConfigObject[Group] & string>}` }[keyof ConfigObject & string];
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/configs/AlexPluginConfigGroup.d.ts
|
|
29
29
|
type GeneralConfig = "javascript" | "typescript" | "react" | "packageJson";
|
|
@@ -31,17 +31,17 @@ type PluginConfig = "base" | "tests";
|
|
|
31
31
|
type InternalConfig = "javascript" | "typescript" | "react" | "tests" | "eslintPluginBase" | "eslintPluginConfigs" | "eslintPluginRules" | "eslintPluginUtility" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utilityBase" | "utilityRoot" | "utilityInternal" | "alexCLine" | "jsdoc" | "components";
|
|
32
32
|
type CombinedConfig = "javascript" | "typescript" | "react" | "tests" | "typescriptReact" | "javascriptReact" | "typescriptPackage";
|
|
33
33
|
interface AlexPluginConfigObject {
|
|
34
|
-
general: Record<GeneralConfig, Linter.Config
|
|
35
|
-
plugin: Record<PluginConfig, Linter.Config
|
|
36
|
-
internal: Record<InternalConfig, Linter.Config
|
|
37
|
-
combined: Record<CombinedConfig, Linter.Config
|
|
34
|
+
general: Record<GeneralConfig, Array<Linter.Config>>;
|
|
35
|
+
plugin: Record<PluginConfig, Array<Linter.Config>>;
|
|
36
|
+
internal: Record<InternalConfig, Array<Linter.Config>>;
|
|
37
|
+
combined: Record<CombinedConfig, Array<Linter.Config>>;
|
|
38
38
|
}
|
|
39
39
|
type AlexConfigGroupName = keyof AlexPluginConfigObject;
|
|
40
40
|
type AlexFlattenedConfigName = GetFlattenedConfigNames<AlexPluginConfigObject>;
|
|
41
|
-
type AlexPluginConfigFlattened = Record<AlexFlattenedConfigName, Linter.Config
|
|
41
|
+
type AlexPluginConfigFlattened = Record<AlexFlattenedConfigName, Array<Linter.Config>>;
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/configs/index.d.ts
|
|
44
|
-
declare function createAlexPluginConfigs(plugin: Readonly<AlexPlugin>): Record<AlexFlattenedConfigName, Linter.Config
|
|
44
|
+
declare function createAlexPluginConfigs(plugin: Readonly<AlexPlugin>): Record<AlexFlattenedConfigName, Array<Linter.Config>>;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region package.json.d.ts
|
|
47
47
|
declare let name: string;
|
|
@@ -63,7 +63,7 @@ declare const alexPlugin: AlexPlugin;
|
|
|
63
63
|
declare const prettierConfig: Config;
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/configs/external/typeDocConfig.d.ts
|
|
66
|
-
declare function typeDocConfig(entryPoints?: string
|
|
66
|
+
declare function typeDocConfig(entryPoints?: Array<string>): TypeDocOptions & PluginOptions;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/configs/external/vitestConfig.d.ts
|
|
69
69
|
declare function vitestConfig(environment?: VitestEnvironment): vite.UserConfig;
|
|
@@ -89,11 +89,11 @@ interface RestrictedPathImportBase {
|
|
|
89
89
|
allowTypeImports?: boolean;
|
|
90
90
|
}
|
|
91
91
|
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
92
|
-
importNames: string
|
|
92
|
+
importNames: Array<string>;
|
|
93
93
|
allowImportNames?: never;
|
|
94
94
|
}
|
|
95
95
|
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
96
|
-
allowImportNames: string
|
|
96
|
+
allowImportNames: Array<string>;
|
|
97
97
|
importNames?: never;
|
|
98
98
|
}
|
|
99
99
|
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
@@ -103,7 +103,7 @@ interface RestrictedPatternImportBase {
|
|
|
103
103
|
allowTypeImports?: boolean;
|
|
104
104
|
}
|
|
105
105
|
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
106
|
-
group: string
|
|
106
|
+
group: Array<string>;
|
|
107
107
|
regex?: never;
|
|
108
108
|
}
|
|
109
109
|
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
@@ -111,14 +111,14 @@ interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
|
111
111
|
group?: never;
|
|
112
112
|
}
|
|
113
113
|
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
114
|
-
importNames: string
|
|
114
|
+
importNames: Array<string>;
|
|
115
115
|
allowImportNames?: never;
|
|
116
116
|
importNamePattern?: never;
|
|
117
117
|
allowImportNamePattern?: never;
|
|
118
118
|
}
|
|
119
119
|
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
120
120
|
importNames?: never;
|
|
121
|
-
allowImportNames: string
|
|
121
|
+
allowImportNames: Array<string>;
|
|
122
122
|
importNamePattern?: never;
|
|
123
123
|
allowImportNamePattern?: never;
|
|
124
124
|
}
|
|
@@ -136,16 +136,16 @@ interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatter
|
|
|
136
136
|
}
|
|
137
137
|
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
138
138
|
interface NoRestrictedImportsOptionsPathsOnly {
|
|
139
|
-
paths: RestrictedPathImport
|
|
139
|
+
paths: Array<RestrictedPathImport>;
|
|
140
140
|
patterns?: never;
|
|
141
141
|
}
|
|
142
142
|
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
143
143
|
paths?: never;
|
|
144
|
-
patterns: RestrictedPatternImport
|
|
144
|
+
patterns: Array<RestrictedPatternImport>;
|
|
145
145
|
}
|
|
146
146
|
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
147
|
-
paths: RestrictedPathImport
|
|
148
|
-
patterns: RestrictedPatternImport
|
|
147
|
+
paths: Array<RestrictedPathImport>;
|
|
148
|
+
patterns: Array<RestrictedPatternImport>;
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Options for the built-in ESLint `no-restricted-imports` rule.
|
|
@@ -164,7 +164,7 @@ type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestri
|
|
|
164
164
|
*
|
|
165
165
|
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
166
166
|
*/
|
|
167
|
-
declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions
|
|
167
|
+
declare function combineRestrictedImports(...groups: Array<NoRestrictedImportsOptions>): NoRestrictedImportsOptions;
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
|
|
170
170
|
/**
|
|
@@ -176,7 +176,7 @@ declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[
|
|
|
176
176
|
*
|
|
177
177
|
* @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
|
|
178
178
|
*/
|
|
179
|
-
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4
|
|
179
|
+
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): Array<JSONSchema4>;
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/utility/public/fixOnCondition.d.ts
|
|
182
182
|
type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
|
|
@@ -230,7 +230,7 @@ declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleF
|
|
|
230
230
|
* // ...
|
|
231
231
|
* }
|
|
232
232
|
*/
|
|
233
|
-
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
233
|
+
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }>(config: ConfigObject): Record<GetFlattenedConfigNames<ConfigObject>, Array<Linter.Config>>;
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
236
236
|
/**
|
|
@@ -248,6 +248,6 @@ declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]
|
|
|
248
248
|
*
|
|
249
249
|
* @returns A comma-separated string of import specifiers after removing the specified import.
|
|
250
250
|
*/
|
|
251
|
-
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: TSESTree.ImportClause
|
|
251
|
+
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: Array<TSESTree.ImportClause>, importToRemove: string): string;
|
|
252
252
|
//#endregion
|
|
253
253
|
export { AlexConfigGroupName, AlexFlattenedConfigName, type AlexPlugin, AlexPluginConfigFlattened, AlexPluginConfigObject, CombinedConfig, GeneralConfig, type GetFlattenedConfigNames, InternalConfig, type NoRestrictedImportsOptions, PluginConfig, checkCallExpression, combineRestrictedImports, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, flattenConfigs, getImportSpecifiersAfterRemoving, prettierConfig, typeDocConfig, vitestConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? H
|
|
|
23
23
|
* type ConfigNames = GetFlattenedConfigNames<{ general: { typescriptReact }}> // "general/typescript-react"
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
26
|
+
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }> = { [Group in keyof ConfigObject & string]: `${CamelToKebab<Group>}/${CamelToKebab<keyof ConfigObject[Group] & string>}` }[keyof ConfigObject & string];
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/configs/AlexPluginConfigGroup.d.ts
|
|
29
29
|
type GeneralConfig = "javascript" | "typescript" | "react" | "packageJson";
|
|
@@ -31,17 +31,17 @@ type PluginConfig = "base" | "tests";
|
|
|
31
31
|
type InternalConfig = "javascript" | "typescript" | "react" | "tests" | "eslintPluginBase" | "eslintPluginConfigs" | "eslintPluginRules" | "eslintPluginUtility" | "neurosongsBackEnd" | "neurosongsFrontEnd" | "utilityBase" | "utilityRoot" | "utilityInternal" | "alexCLine" | "jsdoc" | "components";
|
|
32
32
|
type CombinedConfig = "javascript" | "typescript" | "react" | "tests" | "typescriptReact" | "javascriptReact" | "typescriptPackage";
|
|
33
33
|
interface AlexPluginConfigObject {
|
|
34
|
-
general: Record<GeneralConfig, Linter.Config
|
|
35
|
-
plugin: Record<PluginConfig, Linter.Config
|
|
36
|
-
internal: Record<InternalConfig, Linter.Config
|
|
37
|
-
combined: Record<CombinedConfig, Linter.Config
|
|
34
|
+
general: Record<GeneralConfig, Array<Linter.Config>>;
|
|
35
|
+
plugin: Record<PluginConfig, Array<Linter.Config>>;
|
|
36
|
+
internal: Record<InternalConfig, Array<Linter.Config>>;
|
|
37
|
+
combined: Record<CombinedConfig, Array<Linter.Config>>;
|
|
38
38
|
}
|
|
39
39
|
type AlexConfigGroupName = keyof AlexPluginConfigObject;
|
|
40
40
|
type AlexFlattenedConfigName = GetFlattenedConfigNames<AlexPluginConfigObject>;
|
|
41
|
-
type AlexPluginConfigFlattened = Record<AlexFlattenedConfigName, Linter.Config
|
|
41
|
+
type AlexPluginConfigFlattened = Record<AlexFlattenedConfigName, Array<Linter.Config>>;
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/configs/index.d.ts
|
|
44
|
-
declare function createAlexPluginConfigs(plugin: Readonly<AlexPlugin>): Record<AlexFlattenedConfigName, Linter.Config
|
|
44
|
+
declare function createAlexPluginConfigs(plugin: Readonly<AlexPlugin>): Record<AlexFlattenedConfigName, Array<Linter.Config>>;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region package.json.d.ts
|
|
47
47
|
declare let name: string;
|
|
@@ -63,7 +63,7 @@ declare const alexPlugin: AlexPlugin;
|
|
|
63
63
|
declare const prettierConfig: Config;
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/configs/external/typeDocConfig.d.ts
|
|
66
|
-
declare function typeDocConfig(entryPoints?: string
|
|
66
|
+
declare function typeDocConfig(entryPoints?: Array<string>): TypeDocOptions & PluginOptions;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/configs/external/vitestConfig.d.ts
|
|
69
69
|
declare function vitestConfig(environment?: VitestEnvironment): vite.UserConfig;
|
|
@@ -89,11 +89,11 @@ interface RestrictedPathImportBase {
|
|
|
89
89
|
allowTypeImports?: boolean;
|
|
90
90
|
}
|
|
91
91
|
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
92
|
-
importNames: string
|
|
92
|
+
importNames: Array<string>;
|
|
93
93
|
allowImportNames?: never;
|
|
94
94
|
}
|
|
95
95
|
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
96
|
-
allowImportNames: string
|
|
96
|
+
allowImportNames: Array<string>;
|
|
97
97
|
importNames?: never;
|
|
98
98
|
}
|
|
99
99
|
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
@@ -103,7 +103,7 @@ interface RestrictedPatternImportBase {
|
|
|
103
103
|
allowTypeImports?: boolean;
|
|
104
104
|
}
|
|
105
105
|
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
106
|
-
group: string
|
|
106
|
+
group: Array<string>;
|
|
107
107
|
regex?: never;
|
|
108
108
|
}
|
|
109
109
|
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
@@ -111,14 +111,14 @@ interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
|
111
111
|
group?: never;
|
|
112
112
|
}
|
|
113
113
|
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
114
|
-
importNames: string
|
|
114
|
+
importNames: Array<string>;
|
|
115
115
|
allowImportNames?: never;
|
|
116
116
|
importNamePattern?: never;
|
|
117
117
|
allowImportNamePattern?: never;
|
|
118
118
|
}
|
|
119
119
|
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
120
120
|
importNames?: never;
|
|
121
|
-
allowImportNames: string
|
|
121
|
+
allowImportNames: Array<string>;
|
|
122
122
|
importNamePattern?: never;
|
|
123
123
|
allowImportNamePattern?: never;
|
|
124
124
|
}
|
|
@@ -136,16 +136,16 @@ interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatter
|
|
|
136
136
|
}
|
|
137
137
|
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
138
138
|
interface NoRestrictedImportsOptionsPathsOnly {
|
|
139
|
-
paths: RestrictedPathImport
|
|
139
|
+
paths: Array<RestrictedPathImport>;
|
|
140
140
|
patterns?: never;
|
|
141
141
|
}
|
|
142
142
|
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
143
143
|
paths?: never;
|
|
144
|
-
patterns: RestrictedPatternImport
|
|
144
|
+
patterns: Array<RestrictedPatternImport>;
|
|
145
145
|
}
|
|
146
146
|
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
147
|
-
paths: RestrictedPathImport
|
|
148
|
-
patterns: RestrictedPatternImport
|
|
147
|
+
paths: Array<RestrictedPathImport>;
|
|
148
|
+
patterns: Array<RestrictedPatternImport>;
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Options for the built-in ESLint `no-restricted-imports` rule.
|
|
@@ -164,7 +164,7 @@ type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestri
|
|
|
164
164
|
*
|
|
165
165
|
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
166
166
|
*/
|
|
167
|
-
declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions
|
|
167
|
+
declare function combineRestrictedImports(...groups: Array<NoRestrictedImportsOptions>): NoRestrictedImportsOptions;
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
|
|
170
170
|
/**
|
|
@@ -176,7 +176,7 @@ declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[
|
|
|
176
176
|
*
|
|
177
177
|
* @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
|
|
178
178
|
*/
|
|
179
|
-
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4
|
|
179
|
+
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): Array<JSONSchema4>;
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/utility/public/fixOnCondition.d.ts
|
|
182
182
|
type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
|
|
@@ -230,7 +230,7 @@ declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleF
|
|
|
230
230
|
* // ...
|
|
231
231
|
* }
|
|
232
232
|
*/
|
|
233
|
-
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
233
|
+
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }>(config: ConfigObject): Record<GetFlattenedConfigNames<ConfigObject>, Array<Linter.Config>>;
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
236
236
|
/**
|
|
@@ -248,6 +248,6 @@ declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]
|
|
|
248
248
|
*
|
|
249
249
|
* @returns A comma-separated string of import specifiers after removing the specified import.
|
|
250
250
|
*/
|
|
251
|
-
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: TSESTree.ImportClause
|
|
251
|
+
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: Array<TSESTree.ImportClause>, importToRemove: string): string;
|
|
252
252
|
//#endregion
|
|
253
253
|
export { AlexConfigGroupName, AlexFlattenedConfigName, type AlexPlugin, AlexPluginConfigFlattened, AlexPluginConfigObject, CombinedConfig, GeneralConfig, type GetFlattenedConfigNames, InternalConfig, type NoRestrictedImportsOptions, PluginConfig, checkCallExpression, combineRestrictedImports, createRuleSchemaFromZodSchema, alexPlugin as default, fixOnCondition, flattenConfigs, getImportSpecifiersAfterRemoving, prettierConfig, typeDocConfig, vitestConfig };
|
package/dist/index.js
CHANGED
|
@@ -4914,7 +4914,7 @@ function internalTypeScript(plugin) {
|
|
|
4914
4914
|
},
|
|
4915
4915
|
rules: {
|
|
4916
4916
|
"@alextheman/standardise-error-messages": "off",
|
|
4917
|
-
"@typescript-eslint/array-type": ["error", { default: "
|
|
4917
|
+
"@typescript-eslint/array-type": ["error", { default: "generic" }],
|
|
4918
4918
|
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
4919
4919
|
"@typescript-eslint/consistent-type-definitions": "error",
|
|
4920
4920
|
"@typescript-eslint/dot-notation": "error",
|
|
@@ -5542,7 +5542,7 @@ var rules_default = {
|
|
|
5542
5542
|
//#endregion
|
|
5543
5543
|
//#region package.json
|
|
5544
5544
|
var name = "@alextheman/eslint-plugin";
|
|
5545
|
-
var version = "5.
|
|
5545
|
+
var version = "5.10.0";
|
|
5546
5546
|
|
|
5547
5547
|
//#endregion
|
|
5548
5548
|
//#region src/alexPlugin.ts
|
|
@@ -9,7 +9,7 @@ import { Linter } from "eslint";
|
|
|
9
9
|
declare const prettierConfig: Config;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/configs/external/typeDocConfig.d.ts
|
|
12
|
-
declare function typeDocConfig(entryPoints?: string
|
|
12
|
+
declare function typeDocConfig(entryPoints?: Array<string>): TypeDocOptions & PluginOptions;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/configs/external/vitestConfig.d.ts
|
|
15
15
|
declare function vitestConfig(environment?: VitestEnvironment): vite.UserConfig;
|
|
@@ -106,11 +106,11 @@ interface RestrictedPathImportBase {
|
|
|
106
106
|
allowTypeImports?: boolean;
|
|
107
107
|
}
|
|
108
108
|
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
109
|
-
importNames: string
|
|
109
|
+
importNames: Array<string>;
|
|
110
110
|
allowImportNames?: never;
|
|
111
111
|
}
|
|
112
112
|
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
113
|
-
allowImportNames: string
|
|
113
|
+
allowImportNames: Array<string>;
|
|
114
114
|
importNames?: never;
|
|
115
115
|
}
|
|
116
116
|
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
@@ -120,7 +120,7 @@ interface RestrictedPatternImportBase {
|
|
|
120
120
|
allowTypeImports?: boolean;
|
|
121
121
|
}
|
|
122
122
|
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
123
|
-
group: string
|
|
123
|
+
group: Array<string>;
|
|
124
124
|
regex?: never;
|
|
125
125
|
}
|
|
126
126
|
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
@@ -128,14 +128,14 @@ interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
|
128
128
|
group?: never;
|
|
129
129
|
}
|
|
130
130
|
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
131
|
-
importNames: string
|
|
131
|
+
importNames: Array<string>;
|
|
132
132
|
allowImportNames?: never;
|
|
133
133
|
importNamePattern?: never;
|
|
134
134
|
allowImportNamePattern?: never;
|
|
135
135
|
}
|
|
136
136
|
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
137
137
|
importNames?: never;
|
|
138
|
-
allowImportNames: string
|
|
138
|
+
allowImportNames: Array<string>;
|
|
139
139
|
importNamePattern?: never;
|
|
140
140
|
allowImportNamePattern?: never;
|
|
141
141
|
}
|
|
@@ -153,16 +153,16 @@ interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatter
|
|
|
153
153
|
}
|
|
154
154
|
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
155
155
|
interface NoRestrictedImportsOptionsPathsOnly {
|
|
156
|
-
paths: RestrictedPathImport
|
|
156
|
+
paths: Array<RestrictedPathImport>;
|
|
157
157
|
patterns?: never;
|
|
158
158
|
}
|
|
159
159
|
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
160
160
|
paths?: never;
|
|
161
|
-
patterns: RestrictedPatternImport
|
|
161
|
+
patterns: Array<RestrictedPatternImport>;
|
|
162
162
|
}
|
|
163
163
|
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
164
|
-
paths: RestrictedPathImport
|
|
165
|
-
patterns: RestrictedPatternImport
|
|
164
|
+
paths: Array<RestrictedPathImport>;
|
|
165
|
+
patterns: Array<RestrictedPatternImport>;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
168
|
* Options for the built-in ESLint `no-restricted-imports` rule.
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Linter } from "eslint";
|
|
|
9
9
|
declare const prettierConfig: Config;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/configs/external/typeDocConfig.d.ts
|
|
12
|
-
declare function typeDocConfig(entryPoints?: string
|
|
12
|
+
declare function typeDocConfig(entryPoints?: Array<string>): TypeDocOptions & PluginOptions;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/configs/external/vitestConfig.d.ts
|
|
15
15
|
declare function vitestConfig(environment?: VitestEnvironment): vite.UserConfig;
|
|
@@ -106,11 +106,11 @@ interface RestrictedPathImportBase {
|
|
|
106
106
|
allowTypeImports?: boolean;
|
|
107
107
|
}
|
|
108
108
|
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
109
|
-
importNames: string
|
|
109
|
+
importNames: Array<string>;
|
|
110
110
|
allowImportNames?: never;
|
|
111
111
|
}
|
|
112
112
|
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
113
|
-
allowImportNames: string
|
|
113
|
+
allowImportNames: Array<string>;
|
|
114
114
|
importNames?: never;
|
|
115
115
|
}
|
|
116
116
|
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
@@ -120,7 +120,7 @@ interface RestrictedPatternImportBase {
|
|
|
120
120
|
allowTypeImports?: boolean;
|
|
121
121
|
}
|
|
122
122
|
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
123
|
-
group: string
|
|
123
|
+
group: Array<string>;
|
|
124
124
|
regex?: never;
|
|
125
125
|
}
|
|
126
126
|
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
@@ -128,14 +128,14 @@ interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
|
128
128
|
group?: never;
|
|
129
129
|
}
|
|
130
130
|
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
131
|
-
importNames: string
|
|
131
|
+
importNames: Array<string>;
|
|
132
132
|
allowImportNames?: never;
|
|
133
133
|
importNamePattern?: never;
|
|
134
134
|
allowImportNamePattern?: never;
|
|
135
135
|
}
|
|
136
136
|
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
137
137
|
importNames?: never;
|
|
138
|
-
allowImportNames: string
|
|
138
|
+
allowImportNames: Array<string>;
|
|
139
139
|
importNamePattern?: never;
|
|
140
140
|
allowImportNamePattern?: never;
|
|
141
141
|
}
|
|
@@ -153,16 +153,16 @@ interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatter
|
|
|
153
153
|
}
|
|
154
154
|
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
155
155
|
interface NoRestrictedImportsOptionsPathsOnly {
|
|
156
|
-
paths: RestrictedPathImport
|
|
156
|
+
paths: Array<RestrictedPathImport>;
|
|
157
157
|
patterns?: never;
|
|
158
158
|
}
|
|
159
159
|
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
160
160
|
paths?: never;
|
|
161
|
-
patterns: RestrictedPatternImport
|
|
161
|
+
patterns: Array<RestrictedPatternImport>;
|
|
162
162
|
}
|
|
163
163
|
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
164
|
-
paths: RestrictedPathImport
|
|
165
|
-
patterns: RestrictedPatternImport
|
|
164
|
+
paths: Array<RestrictedPathImport>;
|
|
165
|
+
patterns: Array<RestrictedPatternImport>;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
168
|
* Options for the built-in ESLint `no-restricted-imports` rule.
|
package/dist/utility/index.d.cts
CHANGED
|
@@ -27,11 +27,11 @@ interface RestrictedPathImportBase {
|
|
|
27
27
|
allowTypeImports?: boolean;
|
|
28
28
|
}
|
|
29
29
|
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
30
|
-
importNames: string
|
|
30
|
+
importNames: Array<string>;
|
|
31
31
|
allowImportNames?: never;
|
|
32
32
|
}
|
|
33
33
|
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
34
|
-
allowImportNames: string
|
|
34
|
+
allowImportNames: Array<string>;
|
|
35
35
|
importNames?: never;
|
|
36
36
|
}
|
|
37
37
|
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
@@ -41,7 +41,7 @@ interface RestrictedPatternImportBase {
|
|
|
41
41
|
allowTypeImports?: boolean;
|
|
42
42
|
}
|
|
43
43
|
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
44
|
-
group: string
|
|
44
|
+
group: Array<string>;
|
|
45
45
|
regex?: never;
|
|
46
46
|
}
|
|
47
47
|
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
@@ -49,14 +49,14 @@ interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
|
49
49
|
group?: never;
|
|
50
50
|
}
|
|
51
51
|
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
52
|
-
importNames: string
|
|
52
|
+
importNames: Array<string>;
|
|
53
53
|
allowImportNames?: never;
|
|
54
54
|
importNamePattern?: never;
|
|
55
55
|
allowImportNamePattern?: never;
|
|
56
56
|
}
|
|
57
57
|
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
58
58
|
importNames?: never;
|
|
59
|
-
allowImportNames: string
|
|
59
|
+
allowImportNames: Array<string>;
|
|
60
60
|
importNamePattern?: never;
|
|
61
61
|
allowImportNamePattern?: never;
|
|
62
62
|
}
|
|
@@ -74,16 +74,16 @@ interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatter
|
|
|
74
74
|
}
|
|
75
75
|
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
76
76
|
interface NoRestrictedImportsOptionsPathsOnly {
|
|
77
|
-
paths: RestrictedPathImport
|
|
77
|
+
paths: Array<RestrictedPathImport>;
|
|
78
78
|
patterns?: never;
|
|
79
79
|
}
|
|
80
80
|
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
81
81
|
paths?: never;
|
|
82
|
-
patterns: RestrictedPatternImport
|
|
82
|
+
patterns: Array<RestrictedPatternImport>;
|
|
83
83
|
}
|
|
84
84
|
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
85
|
-
paths: RestrictedPathImport
|
|
86
|
-
patterns: RestrictedPatternImport
|
|
85
|
+
paths: Array<RestrictedPathImport>;
|
|
86
|
+
patterns: Array<RestrictedPatternImport>;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Options for the built-in ESLint `no-restricted-imports` rule.
|
|
@@ -102,7 +102,7 @@ type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestri
|
|
|
102
102
|
*
|
|
103
103
|
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
104
104
|
*/
|
|
105
|
-
declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions
|
|
105
|
+
declare function combineRestrictedImports(...groups: Array<NoRestrictedImportsOptions>): NoRestrictedImportsOptions;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
|
|
108
108
|
/**
|
|
@@ -114,7 +114,7 @@ declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[
|
|
|
114
114
|
*
|
|
115
115
|
* @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
|
|
116
116
|
*/
|
|
117
|
-
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4
|
|
117
|
+
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): Array<JSONSchema4>;
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/utility/public/fixOnCondition.d.ts
|
|
120
120
|
type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
|
|
@@ -144,7 +144,7 @@ type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? H
|
|
|
144
144
|
* type ConfigNames = GetFlattenedConfigNames<{ general: { typescriptReact }}> // "general/typescript-react"
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
147
|
+
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }> = { [Group in keyof ConfigObject & string]: `${CamelToKebab<Group>}/${CamelToKebab<keyof ConfigObject[Group] & string>}` }[keyof ConfigObject & string];
|
|
148
148
|
//#endregion
|
|
149
149
|
//#region src/utility/public/flattenConfigs.d.ts
|
|
150
150
|
/**
|
|
@@ -184,7 +184,7 @@ type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: R
|
|
|
184
184
|
* // ...
|
|
185
185
|
* }
|
|
186
186
|
*/
|
|
187
|
-
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
187
|
+
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }>(config: ConfigObject): Record<GetFlattenedConfigNames<ConfigObject>, Array<Linter.Config>>;
|
|
188
188
|
//#endregion
|
|
189
189
|
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
190
190
|
/**
|
|
@@ -202,6 +202,6 @@ declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]
|
|
|
202
202
|
*
|
|
203
203
|
* @returns A comma-separated string of import specifiers after removing the specified import.
|
|
204
204
|
*/
|
|
205
|
-
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: TSESTree.ImportClause
|
|
205
|
+
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: Array<TSESTree.ImportClause>, importToRemove: string): string;
|
|
206
206
|
//#endregion
|
|
207
207
|
export { type GetFlattenedConfigNames, type NoRestrictedImportsOptions, checkCallExpression, combineRestrictedImports, createRuleSchemaFromZodSchema, fixOnCondition, flattenConfigs, getImportSpecifiersAfterRemoving };
|
package/dist/utility/index.d.ts
CHANGED
|
@@ -27,11 +27,11 @@ interface RestrictedPathImportBase {
|
|
|
27
27
|
allowTypeImports?: boolean;
|
|
28
28
|
}
|
|
29
29
|
interface RestrictedPathImportImportNames extends RestrictedPathImportBase {
|
|
30
|
-
importNames: string
|
|
30
|
+
importNames: Array<string>;
|
|
31
31
|
allowImportNames?: never;
|
|
32
32
|
}
|
|
33
33
|
interface RestrictedPathImportAllowImportNames extends RestrictedPathImportBase {
|
|
34
|
-
allowImportNames: string
|
|
34
|
+
allowImportNames: Array<string>;
|
|
35
35
|
importNames?: never;
|
|
36
36
|
}
|
|
37
37
|
type RestrictedPathImport = RestrictedPathImportBase | RestrictedPathImportImportNames | RestrictedPathImportAllowImportNames;
|
|
@@ -41,7 +41,7 @@ interface RestrictedPatternImportBase {
|
|
|
41
41
|
allowTypeImports?: boolean;
|
|
42
42
|
}
|
|
43
43
|
interface RestrictedPatternImportGroup extends RestrictedPatternImportBase {
|
|
44
|
-
group: string
|
|
44
|
+
group: Array<string>;
|
|
45
45
|
regex?: never;
|
|
46
46
|
}
|
|
47
47
|
interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
@@ -49,14 +49,14 @@ interface RestrictedPatternImportRegex extends RestrictedPatternImportBase {
|
|
|
49
49
|
group?: never;
|
|
50
50
|
}
|
|
51
51
|
interface RestrictedPatternImportImportNames extends RestrictedPatternImportBase {
|
|
52
|
-
importNames: string
|
|
52
|
+
importNames: Array<string>;
|
|
53
53
|
allowImportNames?: never;
|
|
54
54
|
importNamePattern?: never;
|
|
55
55
|
allowImportNamePattern?: never;
|
|
56
56
|
}
|
|
57
57
|
interface RestrictedPatternImportAllowImportNames extends RestrictedPatternImportBase {
|
|
58
58
|
importNames?: never;
|
|
59
|
-
allowImportNames: string
|
|
59
|
+
allowImportNames: Array<string>;
|
|
60
60
|
importNamePattern?: never;
|
|
61
61
|
allowImportNamePattern?: never;
|
|
62
62
|
}
|
|
@@ -74,16 +74,16 @@ interface RestrictedPatternImportAllowImportNamePattern extends RestrictedPatter
|
|
|
74
74
|
}
|
|
75
75
|
type RestrictedPatternImport = RestrictedPatternImportGroup | RestrictedPatternImportRegex | RestrictedPatternImportImportNames | RestrictedPatternImportAllowImportNames | RestrictedPatternImportImportNamePattern | RestrictedPatternImportAllowImportNamePattern;
|
|
76
76
|
interface NoRestrictedImportsOptionsPathsOnly {
|
|
77
|
-
paths: RestrictedPathImport
|
|
77
|
+
paths: Array<RestrictedPathImport>;
|
|
78
78
|
patterns?: never;
|
|
79
79
|
}
|
|
80
80
|
interface NoRestrictedImportsOptionsPatternsOnly {
|
|
81
81
|
paths?: never;
|
|
82
|
-
patterns: RestrictedPatternImport
|
|
82
|
+
patterns: Array<RestrictedPatternImport>;
|
|
83
83
|
}
|
|
84
84
|
interface NoRestrictedImportsOptionsPathsAndPatterns {
|
|
85
|
-
paths: RestrictedPathImport
|
|
86
|
-
patterns: RestrictedPatternImport
|
|
85
|
+
paths: Array<RestrictedPathImport>;
|
|
86
|
+
patterns: Array<RestrictedPatternImport>;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Options for the built-in ESLint `no-restricted-imports` rule.
|
|
@@ -102,7 +102,7 @@ type NoRestrictedImportsOptions = NoRestrictedImportsOptionsPathsOnly | NoRestri
|
|
|
102
102
|
*
|
|
103
103
|
* @returns A new object combining all paths and patterns from the given groups, suitable as an option to pass to `no-restricted-imports`.
|
|
104
104
|
*/
|
|
105
|
-
declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions
|
|
105
|
+
declare function combineRestrictedImports(...groups: Array<NoRestrictedImportsOptions>): NoRestrictedImportsOptions;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/utility/public/createRuleSchemaFromZodSchema.d.ts
|
|
108
108
|
/**
|
|
@@ -114,7 +114,7 @@ declare function combineRestrictedImports(...groups: NoRestrictedImportsOptions[
|
|
|
114
114
|
*
|
|
115
115
|
* @returns An array containing the resulting JSON Schema, formatted for ESLint rule schema compatibility.
|
|
116
116
|
*/
|
|
117
|
-
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): JSONSchema4
|
|
117
|
+
declare function createRuleSchemaFromZodSchema(schema: z.ZodType): Array<JSONSchema4>;
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/utility/public/fixOnCondition.d.ts
|
|
120
120
|
type RuleFixerFunction = (fixer: RuleFixer) => RuleFix | null;
|
|
@@ -144,7 +144,7 @@ type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? H
|
|
|
144
144
|
* type ConfigNames = GetFlattenedConfigNames<{ general: { typescriptReact }}> // "general/typescript-react"
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
147
|
+
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }> = { [Group in keyof ConfigObject & string]: `${CamelToKebab<Group>}/${CamelToKebab<keyof ConfigObject[Group] & string>}` }[keyof ConfigObject & string];
|
|
148
148
|
//#endregion
|
|
149
149
|
//#region src/utility/public/flattenConfigs.d.ts
|
|
150
150
|
/**
|
|
@@ -184,7 +184,7 @@ type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: R
|
|
|
184
184
|
* // ...
|
|
185
185
|
* }
|
|
186
186
|
*/
|
|
187
|
-
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Linter.Config
|
|
187
|
+
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>> }>(config: ConfigObject): Record<GetFlattenedConfigNames<ConfigObject>, Array<Linter.Config>>;
|
|
188
188
|
//#endregion
|
|
189
189
|
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
190
190
|
/**
|
|
@@ -202,6 +202,6 @@ declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]
|
|
|
202
202
|
*
|
|
203
203
|
* @returns A comma-separated string of import specifiers after removing the specified import.
|
|
204
204
|
*/
|
|
205
|
-
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: TSESTree.ImportClause
|
|
205
|
+
declare function getImportSpecifiersAfterRemoving<RuleOptions>(context: Readonly<RuleContext<"message", [RuleOptions]>>, specifiers: Array<TSESTree.ImportClause>, importToRemove: string): string;
|
|
206
206
|
//#endregion
|
|
207
207
|
export { type GetFlattenedConfigNames, type NoRestrictedImportsOptions, checkCallExpression, combineRestrictedImports, createRuleSchemaFromZodSchema, fixOnCondition, flattenConfigs, getImportSpecifiersAfterRemoving };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.0",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@alextheman/utility": "^5.
|
|
37
|
+
"@alextheman/utility": "^5.5.0",
|
|
38
38
|
"@eslint/compat": "^2.0.2",
|
|
39
|
-
"@typescript-eslint/types": "^8.56.
|
|
40
|
-
"@typescript-eslint/utils": "^8.56.
|
|
39
|
+
"@typescript-eslint/types": "^8.56.1",
|
|
40
|
+
"@typescript-eslint/utils": "^8.56.1",
|
|
41
41
|
"common-tags": "^1.8.2",
|
|
42
42
|
"prettier": "^3.8.1",
|
|
43
43
|
"zod": "^4.3.6"
|
|
@@ -47,23 +47,23 @@
|
|
|
47
47
|
"@types/common-tags": "^1.8.4",
|
|
48
48
|
"@types/eslint": "^9.6.1",
|
|
49
49
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
50
|
-
"@types/node": "^25.3.
|
|
51
|
-
"@typescript-eslint/rule-tester": "^8.56.
|
|
52
|
-
"alex-c-line": "^
|
|
50
|
+
"@types/node": "^25.3.3",
|
|
51
|
+
"@typescript-eslint/rule-tester": "^8.56.1",
|
|
52
|
+
"alex-c-line": "^2.0.0",
|
|
53
53
|
"dotenv-cli": "^11.0.0",
|
|
54
|
-
"eslint": "^10.0.
|
|
54
|
+
"eslint": "^10.0.2",
|
|
55
55
|
"eslint-config-prettier": "^10.1.8",
|
|
56
56
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
57
57
|
"eslint-plugin-import": "^2.32.0",
|
|
58
|
-
"eslint-plugin-jsdoc": "^62.7.
|
|
58
|
+
"eslint-plugin-jsdoc": "^62.7.1",
|
|
59
59
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
60
60
|
"eslint-plugin-n": "^17.24.0",
|
|
61
|
-
"eslint-plugin-package-json": "^0.89.
|
|
61
|
+
"eslint-plugin-package-json": "^0.89.2",
|
|
62
62
|
"eslint-plugin-perfectionist": "^5.6.0",
|
|
63
63
|
"eslint-plugin-prettier": "^5.5.5",
|
|
64
64
|
"eslint-plugin-react": "^7.37.5",
|
|
65
65
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
66
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
66
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
67
67
|
"eslint-vitest-rule-tester": "^3.1.0",
|
|
68
68
|
"execa": "^9.6.1",
|
|
69
69
|
"globals": "^17.3.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"typedoc-plugin-markdown": "^4.10.0",
|
|
77
77
|
"typedoc-rhineai-theme": "^1.2.0",
|
|
78
78
|
"typescript": "^5.9.3",
|
|
79
|
-
"typescript-eslint": "^8.56.
|
|
79
|
+
"typescript-eslint": "^8.56.1",
|
|
80
80
|
"vite-tsconfig-paths": "^6.1.1",
|
|
81
81
|
"vitest": "^4.0.18"
|
|
82
82
|
},
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"build": "tsdown",
|
|
107
107
|
"create-feature-docs": "typedoc",
|
|
108
108
|
"create-local-package": "pnpm run build && rm -f alextheman-eslint-plugin-*.tgz && pnpm pack",
|
|
109
|
-
"create-release-note": "bash -c 'git pull origin main && alex-c-line
|
|
109
|
+
"create-release-note": "bash -c 'git pull origin main && alex-c-line template release-note create $@' --",
|
|
110
110
|
"format": "pnpm run format-prettier && pnpm run format-eslint",
|
|
111
111
|
"format-and-build": "tsx src/utility/checkConfigChanges.ts || pnpm run build && pnpm run format",
|
|
112
112
|
"format-eslint": "eslint --fix --suppress-all \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\" && rm -f eslint-suppressions.json",
|
|
@@ -114,15 +114,16 @@
|
|
|
114
114
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
115
115
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
116
116
|
"format-prettier-yml": "prettier --write \"./**/*.yml\"",
|
|
117
|
-
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-prettier",
|
|
117
|
+
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-prettier && pnpm run lint-pre-release",
|
|
118
118
|
"lint-and-build": "tsx src/utility/checkConfigChanges.ts || pnpm run build && pnpm run lint",
|
|
119
119
|
"lint-eslint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\"",
|
|
120
|
+
"lint-pre-release": "alex-c-line package-json check --rules no-pre-release-dependencies",
|
|
120
121
|
"lint-prettier": "pnpm run lint-prettier-typescript && pnpm run lint-prettier-javascript && pnpm run lint-prettier-yml",
|
|
121
122
|
"lint-prettier-javascript": "prettier --check \"./**/*.js\"",
|
|
122
123
|
"lint-prettier-typescript": "prettier --check --parser typescript \"./**/*.ts\"",
|
|
123
124
|
"lint-prettier-yml": "prettier --check \"./**/*.{yml,yaml}\"",
|
|
124
125
|
"lint-tsc": "tsc --noEmit",
|
|
125
|
-
"pre-commit": "alex-c-line pre-commit
|
|
126
|
+
"pre-commit": "alex-c-line pre-commit",
|
|
126
127
|
"test": "vitest run",
|
|
127
128
|
"test-end-to-end": "RUN_END_TO_END=true vitest run tests/end-to-end --reporter verbose",
|
|
128
129
|
"test-watch": "vitest",
|