@alextheman/eslint-plugin 5.18.0 → 5.18.2
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 +249 -82
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +248 -81
- package/dist/internal/index.cjs +202 -35
- package/dist/internal/index.d.cts +4 -0
- package/dist/internal/index.d.ts +4 -0
- package/dist/internal/index.js +202 -35
- package/dist/utility/index.cjs +1 -1
- package/dist/utility/index.d.cts +2 -3
- package/dist/utility/index.d.ts +2 -3
- package/package.json +26 -25
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,6 @@ import { TSESTree } from "@typescript-eslint/utils";
|
|
|
4
4
|
import z from "zod";
|
|
5
5
|
import { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
|
|
6
6
|
import { RuleContext, RuleFix, RuleFixer } from "@typescript-eslint/utils/ts-eslint";
|
|
7
|
-
|
|
8
7
|
//#region src/utility/private/camelToKebab.d.ts
|
|
9
8
|
type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
|
|
10
9
|
//#endregion
|
|
@@ -19,7 +18,7 @@ type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? H
|
|
|
19
18
|
* type ConfigNames = GetFlattenedConfigNames<{ general: { typescriptReact }}> // "general/typescript-react"
|
|
20
19
|
* ```
|
|
21
20
|
*/
|
|
22
|
-
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config
|
|
21
|
+
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];
|
|
23
22
|
//#endregion
|
|
24
23
|
//#region src/configs/AlexPluginConfigGroup.d.ts
|
|
25
24
|
type GeneralConfig = "javascript" | "typescript" | "react" | "packageJson";
|
|
@@ -220,7 +219,7 @@ declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleF
|
|
|
220
219
|
* // ...
|
|
221
220
|
* }
|
|
222
221
|
*/
|
|
223
|
-
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config
|
|
222
|
+
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>>; }>(config: ConfigObject): Record<GetFlattenedConfigNames<ConfigObject>, Array<Linter.Config>>;
|
|
224
223
|
//#endregion
|
|
225
224
|
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
226
225
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Linter } from "eslint";
|
|
|
4
4
|
import { Config } from "prettier";
|
|
5
5
|
import { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
|
|
6
6
|
import { RuleContext, RuleFix, RuleFixer } from "@typescript-eslint/utils/ts-eslint";
|
|
7
|
-
|
|
8
7
|
//#region src/utility/private/camelToKebab.d.ts
|
|
9
8
|
type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
|
|
10
9
|
//#endregion
|
|
@@ -19,7 +18,7 @@ type CamelToKebab<S extends string> = S extends `${infer Head}${infer Tail}` ? H
|
|
|
19
18
|
* type ConfigNames = GetFlattenedConfigNames<{ general: { typescriptReact }}> // "general/typescript-react"
|
|
20
19
|
* ```
|
|
21
20
|
*/
|
|
22
|
-
type GetFlattenedConfigNames<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config
|
|
21
|
+
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];
|
|
23
22
|
//#endregion
|
|
24
23
|
//#region src/configs/AlexPluginConfigGroup.d.ts
|
|
25
24
|
type GeneralConfig = "javascript" | "typescript" | "react" | "packageJson";
|
|
@@ -220,7 +219,7 @@ declare function fixOnCondition(fixable: boolean, fix: RuleFixerFunction): RuleF
|
|
|
220
219
|
* // ...
|
|
221
220
|
* }
|
|
222
221
|
*/
|
|
223
|
-
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config
|
|
222
|
+
declare function flattenConfigs<ConfigObject extends { [K in keyof ConfigObject]: Record<string, Array<Linter.Config>>; }>(config: ConfigObject): Record<GetFlattenedConfigNames<ConfigObject>, Array<Linter.Config>>;
|
|
224
223
|
//#endregion
|
|
225
224
|
//#region src/utility/public/getImportSpecifiersAfterRemoving.d.ts
|
|
226
225
|
/**
|