@vp-tw/eslint-config 0.0.21 → 0.0.22
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/README.md +10 -0
- package/dist/esm/types.d.ts +7 -2
- package/dist/esm/vdustr.d.ts +2 -2
- package/dist/types.d.ts +7 -2
- package/dist/vdustr.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/esm/types.d.ts
CHANGED
|
@@ -4,7 +4,12 @@ import type { DistributiveOmit } from "@mui/types";
|
|
|
4
4
|
import type { Linter } from "eslint";
|
|
5
5
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
6
6
|
import type { RuleOptions, ConfigNames as VpEslintConfigNames } from "./eslint-typegen";
|
|
7
|
-
type
|
|
7
|
+
type AnyObject = Record<PropertyKey, any>;
|
|
8
|
+
type ObjectReplaceAntfuEslintRulesWithRulesDeeply<T extends AnyObject> = (Extract<T, AntfuEslintRules> extends never ? never : Rules) | {
|
|
9
|
+
[K in keyof T]: ReplaceAntfuEslintRulesWithVpRulesDeeply<T[K]>;
|
|
10
|
+
};
|
|
11
|
+
type ReplaceAntfuEslintRulesWithVpRulesDeeply<T> = (Extract<T, AntfuEslintRules> extends never ? never : Rules) | (ObjectReplaceAntfuEslintRulesWithRulesDeeply<Extract<T, AnyObject>> | Exclude<T, AnyObject>);
|
|
12
|
+
type Config = ReplaceAntfuEslintRulesWithVpRulesDeeply<NonNullable<Parameters<typeof antfu>[1]>>;
|
|
8
13
|
type Rules = RuleOptions & AntfuEslintRules;
|
|
9
14
|
type ConfigNames = VpEslintConfigNames | AntfuEslintConfigNames;
|
|
10
15
|
/**
|
|
@@ -19,4 +24,4 @@ interface ConfigOverrides extends DistributiveOmit<TypedFlatConfigItem, "process
|
|
|
19
24
|
* Typed composer.
|
|
20
25
|
*/
|
|
21
26
|
type VpComposer = FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
22
|
-
export type { Config, ConfigNames, ConfigOverrides, TypedFlatConfigItem, VpComposer, };
|
|
27
|
+
export type { AnyObject, Config, ConfigNames, ConfigOverrides, ReplaceAntfuEslintRulesWithVpRulesDeeply, TypedFlatConfigItem, VpComposer, };
|
package/dist/esm/vdustr.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config, VpComposer } from "./types";
|
|
1
|
+
import type { Config, ReplaceAntfuEslintRulesWithVpRulesDeeply, VpComposer } from "./types";
|
|
2
2
|
import antfu from "@antfu/eslint-config";
|
|
3
3
|
import { mdx } from "./configs/mdx";
|
|
4
4
|
import { prettier } from "./configs/prettier";
|
|
@@ -9,7 +9,7 @@ import { jsonc } from "./extends/jsonc";
|
|
|
9
9
|
import { react } from "./extends/react";
|
|
10
10
|
import { typescript } from "./extends/typescript";
|
|
11
11
|
import { yaml } from "./extends/yaml";
|
|
12
|
-
type Options = NonNullable<Parameters<typeof antfu>[0]
|
|
12
|
+
type Options = ReplaceAntfuEslintRulesWithVpRulesDeeply<NonNullable<Parameters<typeof antfu>[0]>> & {
|
|
13
13
|
javascriptExtends?: javascript.Options;
|
|
14
14
|
importsExtends?: imports.Options;
|
|
15
15
|
typescriptExtends?: typescript.Options;
|
package/dist/types.d.ts
CHANGED
|
@@ -4,7 +4,12 @@ import type { DistributiveOmit } from "@mui/types";
|
|
|
4
4
|
import type { Linter } from "eslint";
|
|
5
5
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
6
6
|
import type { RuleOptions, ConfigNames as VpEslintConfigNames } from "./eslint-typegen";
|
|
7
|
-
type
|
|
7
|
+
type AnyObject = Record<PropertyKey, any>;
|
|
8
|
+
type ObjectReplaceAntfuEslintRulesWithRulesDeeply<T extends AnyObject> = (Extract<T, AntfuEslintRules> extends never ? never : Rules) | {
|
|
9
|
+
[K in keyof T]: ReplaceAntfuEslintRulesWithVpRulesDeeply<T[K]>;
|
|
10
|
+
};
|
|
11
|
+
type ReplaceAntfuEslintRulesWithVpRulesDeeply<T> = (Extract<T, AntfuEslintRules> extends never ? never : Rules) | (ObjectReplaceAntfuEslintRulesWithRulesDeeply<Extract<T, AnyObject>> | Exclude<T, AnyObject>);
|
|
12
|
+
type Config = ReplaceAntfuEslintRulesWithVpRulesDeeply<NonNullable<Parameters<typeof antfu>[1]>>;
|
|
8
13
|
type Rules = RuleOptions & AntfuEslintRules;
|
|
9
14
|
type ConfigNames = VpEslintConfigNames | AntfuEslintConfigNames;
|
|
10
15
|
/**
|
|
@@ -19,4 +24,4 @@ interface ConfigOverrides extends DistributiveOmit<TypedFlatConfigItem, "process
|
|
|
19
24
|
* Typed composer.
|
|
20
25
|
*/
|
|
21
26
|
type VpComposer = FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
22
|
-
export type { Config, ConfigNames, ConfigOverrides, TypedFlatConfigItem, VpComposer, };
|
|
27
|
+
export type { AnyObject, Config, ConfigNames, ConfigOverrides, ReplaceAntfuEslintRulesWithVpRulesDeeply, TypedFlatConfigItem, VpComposer, };
|
package/dist/vdustr.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config, VpComposer } from "./types";
|
|
1
|
+
import type { Config, ReplaceAntfuEslintRulesWithVpRulesDeeply, VpComposer } from "./types";
|
|
2
2
|
import antfu from "@antfu/eslint-config";
|
|
3
3
|
import { mdx } from "./configs/mdx";
|
|
4
4
|
import { prettier } from "./configs/prettier";
|
|
@@ -9,7 +9,7 @@ import { jsonc } from "./extends/jsonc";
|
|
|
9
9
|
import { react } from "./extends/react";
|
|
10
10
|
import { typescript } from "./extends/typescript";
|
|
11
11
|
import { yaml } from "./extends/yaml";
|
|
12
|
-
type Options = NonNullable<Parameters<typeof antfu>[0]
|
|
12
|
+
type Options = ReplaceAntfuEslintRulesWithVpRulesDeeply<NonNullable<Parameters<typeof antfu>[0]>> & {
|
|
13
13
|
javascriptExtends?: javascript.Options;
|
|
14
14
|
importsExtends?: imports.Options;
|
|
15
15
|
typescriptExtends?: typescript.Options;
|