@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 CHANGED
@@ -46,6 +46,16 @@ export default vdustr(
46
46
  );
47
47
  ```
48
48
 
49
+ ## Release
50
+
51
+ ```bash
52
+ pnpm -w v:patch # or
53
+ pnpm -w v:minor # or
54
+ pnpm -w v:major
55
+
56
+ pnpm -r publish
57
+ ```
58
+
49
59
  ## License
50
60
 
51
61
  MIT © ViPro <vdustr@gmail.com> (<http://vdustr.dev>)
@@ -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 Config = NonNullable<Parameters<typeof antfu>[1]>;
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, };
@@ -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 Config = NonNullable<Parameters<typeof antfu>[1]>;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vp-tw/eslint-config",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "ViPro's ESLint configuration",
5
5
  "homepage": "https://github.com/vdustr/eslint-config",
6
6
  "author": {