@vp-tw/eslint-config 0.0.29 → 0.1.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.
@@ -0,0 +1,8 @@
1
+ import type { ConfigOverrides, TypedFlatConfigItem } from "../types";
2
+ declare namespace emotion {
3
+ interface Options {
4
+ emotion?: ConfigOverrides;
5
+ }
6
+ }
7
+ declare const emotion: (options?: emotion.Options) => Promise<TypedFlatConfigItem[]>;
8
+ export { emotion };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.emotion = void 0;
7
+ var _eslintConfig = require("@antfu/eslint-config");
8
+ var _mergeConfig = require("../utils/mergeConfig");
9
+ const emotion = async options => {
10
+ await (0, _eslintConfig.ensurePackages)(["@emotion/eslint-plugin"]);
11
+ const emotionPlugin = await (0, _eslintConfig.interopDefault)(Promise.resolve().then(() => require("@emotion/eslint-plugin")));
12
+ const emotionSetupConfig = {
13
+ plugins: {
14
+ "@emotion": emotionPlugin
15
+ },
16
+ name: "vdustr/emotion/setup"
17
+ };
18
+ const emotionRulesConfig = (0, _mergeConfig.mergeConfig)(options?.emotion, {
19
+ rules: {
20
+ "@emotion/syntax-preference": [2, "object"]
21
+ },
22
+ name: "vdustr/emotion/rules"
23
+ });
24
+ return [emotionSetupConfig, emotionRulesConfig];
25
+ };
26
+ exports.emotion = emotion;
@@ -10,14 +10,15 @@ var _mergeConfig = require("../utils/mergeConfig");
10
10
  var _renameRules = require("../utils/renameRules");
11
11
  const packageJson = async options => {
12
12
  await (0, _eslintConfig.ensurePackages)(["eslint-plugin-package-json"]);
13
- const packageJson2 = await (0, _eslintConfig.interopDefault)(Promise.resolve().then(() => require("eslint-plugin-package-json/configs/recommended")));
13
+ const packageJson2 = await (0, _eslintConfig.interopDefault)(Promise.resolve().then(() => require("eslint-plugin-package-json")));
14
+ const recommended = packageJson2.configs.recommended;
14
15
  const packageJsonSetupConfig = {
15
- plugins: packageJson2.plugins,
16
+ plugins: recommended.plugins,
16
17
  name: "vdustr/package-json/setup"
17
18
  };
18
19
  const packageJsonRulesConfig = (0, _mergeConfig.mergeConfig)(options?.packageJson, {
19
- ...(0, _esToolkit.omit)(packageJson2, ["name", "plugins"]),
20
- rules: (0, _renameRules.renameRules)(packageJson2.rules),
20
+ ...(0, _esToolkit.omit)(recommended, ["name", "plugins"]),
21
+ rules: (0, _renameRules.renameRules)(recommended.rules),
21
22
  name: "vdustr/package-json/rules"
22
23
  });
23
24
  return [packageJsonSetupConfig, packageJsonRulesConfig];
@@ -0,0 +1,8 @@
1
+ import type { ConfigOverrides, TypedFlatConfigItem } from "../types";
2
+ declare namespace tanstackQuery {
3
+ interface Options {
4
+ tanstackQuery?: ConfigOverrides;
5
+ }
6
+ }
7
+ declare const tanstackQuery: (options?: tanstackQuery.Options) => Promise<TypedFlatConfigItem[]>;
8
+ export { tanstackQuery };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tanstackQuery = void 0;
7
+ var _eslintConfig = require("@antfu/eslint-config");
8
+ var _esToolkit = require("es-toolkit");
9
+ var _mergeConfig = require("../utils/mergeConfig");
10
+ const tanstackQuery = async options => {
11
+ await (0, _eslintConfig.ensurePackages)(["@tanstack/eslint-plugin-query"]);
12
+ const tanstackQueryPlugin = await (0, _eslintConfig.interopDefault)(Promise.resolve().then(() => require("@tanstack/eslint-plugin-query")));
13
+ const recommended = tanstackQueryPlugin.configs["flat/recommended"];
14
+ const tanstackQuerySetupConfig = {
15
+ ...(0, _esToolkit.pick)(recommended[0], ["plugins"]),
16
+ name: "vdustr/tanstack-query/setup"
17
+ };
18
+ const tanstackQueryRulesConfig = (0, _mergeConfig.mergeConfig)(options?.tanstackQuery, {
19
+ ...recommended[0],
20
+ name: "vdustr/tanstack-query/rules"
21
+ });
22
+ return [tanstackQuerySetupConfig, tanstackQueryRulesConfig];
23
+ };
24
+ exports.tanstackQuery = tanstackQuery;
@@ -3,6 +3,66 @@
3
3
  import type { Linter } from 'eslint'
4
4
 
5
5
  export interface RuleOptions {
6
+ /**
7
+ * Ensure styled is imported from @emotion/styled
8
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
9
+ */
10
+ '@emotion/import-from-emotion'?: Linter.RuleEntry<[]>
11
+ /**
12
+ * Ensure jsx from @emotion/react is imported
13
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
14
+ */
15
+ '@emotion/jsx-import'?: Linter.RuleEntry<EmotionJsxImport>
16
+ /**
17
+ * Ensure vanilla emotion is not used
18
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
19
+ */
20
+ '@emotion/no-vanilla'?: Linter.RuleEntry<[]>
21
+ /**
22
+ * Internal rule
23
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
24
+ */
25
+ '@emotion/pkg-renaming'?: Linter.RuleEntry<[]>
26
+ /**
27
+ * Ensure styled is imported from @emotion/styled
28
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
29
+ */
30
+ '@emotion/styled-import'?: Linter.RuleEntry<[]>
31
+ /**
32
+ * Choose between styles written as strings or objects
33
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
34
+ */
35
+ '@emotion/syntax-preference'?: Linter.RuleEntry<EmotionSyntaxPreference>
36
+ /**
37
+ * Exhaustive deps rule for useQuery
38
+ * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
39
+ */
40
+ '@tanstack/query/exhaustive-deps'?: Linter.RuleEntry<[]>
41
+ /**
42
+ * Ensure correct order of inference sensitive properties for infinite queries
43
+ * @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
44
+ */
45
+ '@tanstack/query/infinite-query-property-order'?: Linter.RuleEntry<[]>
46
+ /**
47
+ * Disallows rest destructuring in queries
48
+ * @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
49
+ */
50
+ '@tanstack/query/no-rest-destructuring'?: Linter.RuleEntry<[]>
51
+ /**
52
+ * Disallow putting the result of query hooks directly in a React hook dependency array
53
+ * @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
54
+ */
55
+ '@tanstack/query/no-unstable-deps'?: Linter.RuleEntry<[]>
56
+ /**
57
+ * Ensures queryFn returns a non-undefined value
58
+ * @see https://tanstack.com/query/latest/docs/eslint/no-void-query-fn
59
+ */
60
+ '@tanstack/query/no-void-query-fn'?: Linter.RuleEntry<[]>
61
+ /**
62
+ * Makes sure that QueryClient is stable
63
+ * @see https://tanstack.com/query/latest/docs/eslint/stable-query-client
64
+ */
65
+ '@tanstack/query/stable-query-client'?: Linter.RuleEntry<[]>
6
66
  /**
7
67
  * Linter integration with remark plugins
8
68
  */
@@ -41,6 +101,11 @@ export interface RuleOptions {
41
101
  * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/meta-inline-properties.md
42
102
  */
43
103
  'storybook/meta-inline-properties'?: Linter.RuleEntry<StorybookMetaInlineProperties>
104
+ /**
105
+ * Meta should use `satisfies Meta`
106
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/meta-satisfies-type.md
107
+ */
108
+ 'storybook/meta-satisfies-type'?: Linter.RuleEntry<[]>
44
109
  /**
45
110
  * A story should not have a redundant name property
46
111
  * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-redundant-story-name.md
@@ -84,6 +149,13 @@ export interface RuleOptions {
84
149
  }
85
150
 
86
151
  /* ======= Declarations ======= */
152
+ // ----- @emotion/jsx-import -----
153
+ type EmotionJsxImport = (string | {
154
+ runtime: string
155
+ importSource?: string
156
+ })[]
157
+ // ----- @emotion/syntax-preference -----
158
+ type EmotionSyntaxPreference = []|[("string" | "object")]
87
159
  // ----- react-compiler/react-compiler -----
88
160
  type ReactCompilerReactCompiler = []|[{
89
161
  [k: string]: unknown | undefined
@@ -99,5 +171,5 @@ type StorybookNoUninstalledAddons = []|[{
99
171
  [k: string]: unknown | undefined
100
172
  }]
101
173
  // Names of all the configs
102
- export type ConfigNames = 'vdustr/mdx/setup' | 'vdustr/mdx/processor' | 'vdustr/mdx/rules' | 'vdustr/mdx/code-blocks' | 'vdustr/prettier/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/stroybook/setup' | 'vdustr/storybook/stories/rules' | 'vdustr/storybook/main/rules' | 'vdustr/imports/rules' | 'vdustr/imports/no-default-export/rules' | 'vdustr/javascript/rules' | 'vdustr/jsonc/rules' | 'vdustr/sort/json-keys' | 'vdustr/sort/json-array-values' | 'vdustr/react/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/react/md/rules' | 'vdustr/typescript/rules' | 'vdustr/yaml/rules' | 'vdustr/yaml/sort-keys/rules'
174
+ export type ConfigNames = 'vdustr/emotion/setup' | 'vdustr/emotion/rules' | 'vdustr/tanstack-query/setup' | 'vdustr/tanstack-query/rules' | 'vdustr/mdx/setup' | 'vdustr/mdx/processor' | 'vdustr/mdx/rules' | 'vdustr/mdx/code-blocks' | 'vdustr/prettier/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/stroybook/setup' | 'vdustr/storybook/stories/rules' | 'vdustr/storybook/main/rules' | 'vdustr/imports/rules' | 'vdustr/imports/no-default-export/rules' | 'vdustr/javascript/rules' | 'vdustr/jsonc/rules' | 'vdustr/sort/json-keys' | 'vdustr/sort/json-array-values' | 'vdustr/react/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/react/md/rules' | 'vdustr/typescript/rules' | 'vdustr/yaml/rules' | 'vdustr/yaml/sort-keys/rules'
103
175
 
@@ -0,0 +1,8 @@
1
+ import type { ConfigOverrides, TypedFlatConfigItem } from "../types";
2
+ declare namespace emotion {
3
+ interface Options {
4
+ emotion?: ConfigOverrides;
5
+ }
6
+ }
7
+ declare const emotion: (options?: emotion.Options) => Promise<TypedFlatConfigItem[]>;
8
+ export { emotion };
@@ -0,0 +1,20 @@
1
+ import { ensurePackages, interopDefault } from "@antfu/eslint-config";
2
+ import { mergeConfig } from "../utils/mergeConfig.mjs";
3
+ const emotion = async (options) => {
4
+ await ensurePackages(["@emotion/eslint-plugin"]);
5
+ const emotionPlugin = await interopDefault(import("@emotion/eslint-plugin"));
6
+ const emotionSetupConfig = {
7
+ plugins: {
8
+ "@emotion": emotionPlugin
9
+ },
10
+ name: "vdustr/emotion/setup"
11
+ };
12
+ const emotionRulesConfig = mergeConfig(options?.emotion, {
13
+ rules: {
14
+ "@emotion/syntax-preference": [2, "object"]
15
+ },
16
+ name: "vdustr/emotion/rules"
17
+ });
18
+ return [emotionSetupConfig, emotionRulesConfig];
19
+ };
20
+ export { emotion };
@@ -5,15 +5,16 @@ import { renameRules } from "../utils/renameRules.mjs";
5
5
  const packageJson = async (options) => {
6
6
  await ensurePackages(["eslint-plugin-package-json"]);
7
7
  const packageJson2 = await interopDefault(
8
- import("eslint-plugin-package-json/configs/recommended")
8
+ import("eslint-plugin-package-json")
9
9
  );
10
+ const recommended = packageJson2.configs.recommended;
10
11
  const packageJsonSetupConfig = {
11
- plugins: packageJson2.plugins,
12
+ plugins: recommended.plugins,
12
13
  name: "vdustr/package-json/setup"
13
14
  };
14
15
  const packageJsonRulesConfig = mergeConfig(options?.packageJson, {
15
- ...omit(packageJson2, ["name", "plugins"]),
16
- rules: renameRules(packageJson2.rules),
16
+ ...omit(recommended, ["name", "plugins"]),
17
+ rules: renameRules(recommended.rules),
17
18
  name: "vdustr/package-json/rules"
18
19
  });
19
20
  return [packageJsonSetupConfig, packageJsonRulesConfig];
@@ -0,0 +1,8 @@
1
+ import type { ConfigOverrides, TypedFlatConfigItem } from "../types";
2
+ declare namespace tanstackQuery {
3
+ interface Options {
4
+ tanstackQuery?: ConfigOverrides;
5
+ }
6
+ }
7
+ declare const tanstackQuery: (options?: tanstackQuery.Options) => Promise<TypedFlatConfigItem[]>;
8
+ export { tanstackQuery };
@@ -0,0 +1,20 @@
1
+ import { ensurePackages, interopDefault } from "@antfu/eslint-config";
2
+ import { pick } from "es-toolkit";
3
+ import { mergeConfig } from "../utils/mergeConfig.mjs";
4
+ const tanstackQuery = async (options) => {
5
+ await ensurePackages(["@tanstack/eslint-plugin-query"]);
6
+ const tanstackQueryPlugin = await interopDefault(
7
+ import("@tanstack/eslint-plugin-query")
8
+ );
9
+ const recommended = tanstackQueryPlugin.configs["flat/recommended"];
10
+ const tanstackQuerySetupConfig = {
11
+ ...pick(recommended[0], ["plugins"]),
12
+ name: "vdustr/tanstack-query/setup"
13
+ };
14
+ const tanstackQueryRulesConfig = mergeConfig(options?.tanstackQuery, {
15
+ ...recommended[0],
16
+ name: "vdustr/tanstack-query/rules"
17
+ });
18
+ return [tanstackQuerySetupConfig, tanstackQueryRulesConfig];
19
+ };
20
+ export { tanstackQuery };
@@ -3,6 +3,66 @@
3
3
  import type { Linter } from 'eslint'
4
4
 
5
5
  export interface RuleOptions {
6
+ /**
7
+ * Ensure styled is imported from @emotion/styled
8
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
9
+ */
10
+ '@emotion/import-from-emotion'?: Linter.RuleEntry<[]>
11
+ /**
12
+ * Ensure jsx from @emotion/react is imported
13
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
14
+ */
15
+ '@emotion/jsx-import'?: Linter.RuleEntry<EmotionJsxImport>
16
+ /**
17
+ * Ensure vanilla emotion is not used
18
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
19
+ */
20
+ '@emotion/no-vanilla'?: Linter.RuleEntry<[]>
21
+ /**
22
+ * Internal rule
23
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
24
+ */
25
+ '@emotion/pkg-renaming'?: Linter.RuleEntry<[]>
26
+ /**
27
+ * Ensure styled is imported from @emotion/styled
28
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
29
+ */
30
+ '@emotion/styled-import'?: Linter.RuleEntry<[]>
31
+ /**
32
+ * Choose between styles written as strings or objects
33
+ * @see https://github.com/emotion-js/emotion/blob/@emotion/eslint-plugin@11.12.0/packages/eslint-plugin/docs/rules/emotion-eslint-plugin.cjs.dev.md
34
+ */
35
+ '@emotion/syntax-preference'?: Linter.RuleEntry<EmotionSyntaxPreference>
36
+ /**
37
+ * Exhaustive deps rule for useQuery
38
+ * @see https://tanstack.com/query/latest/docs/eslint/exhaustive-deps
39
+ */
40
+ '@tanstack/query/exhaustive-deps'?: Linter.RuleEntry<[]>
41
+ /**
42
+ * Ensure correct order of inference sensitive properties for infinite queries
43
+ * @see https://tanstack.com/query/latest/docs/eslint/infinite-query-property-order
44
+ */
45
+ '@tanstack/query/infinite-query-property-order'?: Linter.RuleEntry<[]>
46
+ /**
47
+ * Disallows rest destructuring in queries
48
+ * @see https://tanstack.com/query/latest/docs/eslint/no-rest-destructuring
49
+ */
50
+ '@tanstack/query/no-rest-destructuring'?: Linter.RuleEntry<[]>
51
+ /**
52
+ * Disallow putting the result of query hooks directly in a React hook dependency array
53
+ * @see https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
54
+ */
55
+ '@tanstack/query/no-unstable-deps'?: Linter.RuleEntry<[]>
56
+ /**
57
+ * Ensures queryFn returns a non-undefined value
58
+ * @see https://tanstack.com/query/latest/docs/eslint/no-void-query-fn
59
+ */
60
+ '@tanstack/query/no-void-query-fn'?: Linter.RuleEntry<[]>
61
+ /**
62
+ * Makes sure that QueryClient is stable
63
+ * @see https://tanstack.com/query/latest/docs/eslint/stable-query-client
64
+ */
65
+ '@tanstack/query/stable-query-client'?: Linter.RuleEntry<[]>
6
66
  /**
7
67
  * Linter integration with remark plugins
8
68
  */
@@ -41,6 +101,11 @@ export interface RuleOptions {
41
101
  * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/meta-inline-properties.md
42
102
  */
43
103
  'storybook/meta-inline-properties'?: Linter.RuleEntry<StorybookMetaInlineProperties>
104
+ /**
105
+ * Meta should use `satisfies Meta`
106
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/meta-satisfies-type.md
107
+ */
108
+ 'storybook/meta-satisfies-type'?: Linter.RuleEntry<[]>
44
109
  /**
45
110
  * A story should not have a redundant name property
46
111
  * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-redundant-story-name.md
@@ -84,6 +149,13 @@ export interface RuleOptions {
84
149
  }
85
150
 
86
151
  /* ======= Declarations ======= */
152
+ // ----- @emotion/jsx-import -----
153
+ type EmotionJsxImport = (string | {
154
+ runtime: string
155
+ importSource?: string
156
+ })[]
157
+ // ----- @emotion/syntax-preference -----
158
+ type EmotionSyntaxPreference = []|[("string" | "object")]
87
159
  // ----- react-compiler/react-compiler -----
88
160
  type ReactCompilerReactCompiler = []|[{
89
161
  [k: string]: unknown | undefined
@@ -99,5 +171,5 @@ type StorybookNoUninstalledAddons = []|[{
99
171
  [k: string]: unknown | undefined
100
172
  }]
101
173
  // Names of all the configs
102
- export type ConfigNames = 'vdustr/mdx/setup' | 'vdustr/mdx/processor' | 'vdustr/mdx/rules' | 'vdustr/mdx/code-blocks' | 'vdustr/prettier/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/stroybook/setup' | 'vdustr/storybook/stories/rules' | 'vdustr/storybook/main/rules' | 'vdustr/imports/rules' | 'vdustr/imports/no-default-export/rules' | 'vdustr/javascript/rules' | 'vdustr/jsonc/rules' | 'vdustr/sort/json-keys' | 'vdustr/sort/json-array-values' | 'vdustr/react/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/react/md/rules' | 'vdustr/typescript/rules' | 'vdustr/yaml/rules' | 'vdustr/yaml/sort-keys/rules'
174
+ export type ConfigNames = 'vdustr/emotion/setup' | 'vdustr/emotion/rules' | 'vdustr/tanstack-query/setup' | 'vdustr/tanstack-query/rules' | 'vdustr/mdx/setup' | 'vdustr/mdx/processor' | 'vdustr/mdx/rules' | 'vdustr/mdx/code-blocks' | 'vdustr/prettier/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/stroybook/setup' | 'vdustr/storybook/stories/rules' | 'vdustr/storybook/main/rules' | 'vdustr/imports/rules' | 'vdustr/imports/no-default-export/rules' | 'vdustr/javascript/rules' | 'vdustr/jsonc/rules' | 'vdustr/sort/json-keys' | 'vdustr/sort/json-array-values' | 'vdustr/react/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/react/md/rules' | 'vdustr/typescript/rules' | 'vdustr/yaml/rules' | 'vdustr/yaml/sort-keys/rules'
103
175
 
@@ -1,9 +1,2 @@
1
- import type { ESLint, Linter } from "eslint";
2
- interface ReactCompiler extends ESLint.Plugin {
3
- rules: NonNullable<ESLint.Plugin["rules"]>;
4
- configs: {
5
- recommended: Linter.LegacyConfig;
6
- };
7
- }
8
- declare const reactCompiler: () => Promise<ReactCompiler>;
1
+ declare const reactCompiler: () => Promise<typeof import("eslint-plugin-react-compiler")>;
9
2
  export { reactCompiler };
@@ -2,10 +2,7 @@ import { ensurePackages, interopDefault } from "@antfu/eslint-config";
2
2
  const reactCompiler = async () => {
3
3
  await ensurePackages(["eslint-plugin-react-compiler"]);
4
4
  const reactCompiler2 = await interopDefault(
5
- import(
6
- // @ts-expect-error -- Untyped library.
7
- "eslint-plugin-react-compiler"
8
- )
5
+ import("eslint-plugin-react-compiler")
9
6
  );
10
7
  return reactCompiler2;
11
8
  };
@@ -1,10 +1,12 @@
1
1
  import type { sort } from "./extends/sort";
2
2
  import type { Config, ReplaceAntfuEslintRulesWithVpRulesDeeply, VpComposer } from "./types";
3
3
  import antfu from "@antfu/eslint-config";
4
+ import { emotion } from "./configs/emotion";
4
5
  import { mdx } from "./configs/mdx";
5
6
  import { packageJson } from "./configs/packageJson";
6
7
  import { prettier } from "./configs/prettier";
7
8
  import { storybook } from "./configs/storybook";
9
+ import { tanstackQuery } from "./configs/tanstackQuery";
8
10
  import { imports } from "./extends/imports";
9
11
  import { javascript } from "./extends/javascript";
10
12
  import { jsonc } from "./extends/jsonc";
@@ -22,6 +24,8 @@ type Options = ReplaceAntfuEslintRulesWithVpRulesDeeply<NonNullable<Parameters<t
22
24
  react?: react.Options;
23
25
  };
24
26
  packageJson?: boolean | packageJson.Options;
27
+ emotion?: boolean | emotion.Options;
28
+ tanstackQuery?: boolean | tanstackQuery.Options;
25
29
  mdx?: boolean | mdx.Options;
26
30
  storybook?: boolean | storybook.Options;
27
31
  prettier?: boolean | prettier.Options;
@@ -1,9 +1,11 @@
1
1
  import antfu from "@antfu/eslint-config";
2
2
  import { omit, pick } from "es-toolkit";
3
+ import { emotion } from "./configs/emotion.mjs";
3
4
  import { mdx } from "./configs/mdx.mjs";
4
5
  import { packageJson } from "./configs/packageJson.mjs";
5
6
  import { prettier } from "./configs/prettier.mjs";
6
7
  import { storybook } from "./configs/storybook.mjs";
8
+ import { tanstackQuery } from "./configs/tanstackQuery.mjs";
7
9
  import { imports } from "./extends/imports.mjs";
8
10
  import { javascript } from "./extends/javascript.mjs";
9
11
  import { jsonc } from "./extends/jsonc.mjs";
@@ -19,6 +21,8 @@ import { yaml } from "./extends/yaml.mjs";
19
21
  const ownedConfigNames = [
20
22
  "extends",
21
23
  "packageJson",
24
+ "emotion",
25
+ "tanstackQuery",
22
26
  "mdx",
23
27
  "storybook",
24
28
  "prettier"
@@ -30,8 +34,12 @@ const vdustr = (options, ...userConfigs) => {
30
34
  );
31
35
  const vpOptions = pick(options ?? {}, ownedConfigNames);
32
36
  const packageJsonEnabled = Boolean(vpOptions?.packageJson ?? true);
33
- const storybookEnabled = Boolean(vpOptions?.storybook ?? false);
37
+ const emotionEnabled = Boolean(vpOptions?.emotion ?? false);
38
+ const tanstackQueryEnabled = Boolean(
39
+ vpOptions?.tanstackQuery ?? false
40
+ );
34
41
  const mdxEnabled = Boolean(vpOptions?.mdx ?? false);
42
+ const storybookEnabled = Boolean(vpOptions?.storybook ?? false);
35
43
  const prettierEnabled = Boolean(vpOptions?.prettier ?? true);
36
44
  let config = antfu({
37
45
  ...antfuOptions,
@@ -57,6 +65,18 @@ const vdustr = (options, ...userConfigs) => {
57
65
  packageJson(...!packageJsonOptions ? [] : [packageJsonOptions])
58
66
  );
59
67
  }
68
+ if (emotionEnabled) {
69
+ const emotionOptions = typeof vpOptions?.emotion !== "object" ? void 0 : vpOptions.emotion;
70
+ config = config.append(
71
+ emotion(...!emotionOptions ? [] : [emotionOptions])
72
+ );
73
+ }
74
+ if (tanstackQueryEnabled) {
75
+ const tanstackQueryOptions = typeof vpOptions?.tanstackQuery !== "object" ? void 0 : vpOptions.tanstackQuery;
76
+ config = config.append(
77
+ tanstackQuery(...!tanstackQueryOptions ? [] : [tanstackQueryOptions])
78
+ );
79
+ }
60
80
  if (storybookEnabled) {
61
81
  const storybookOptions = typeof vpOptions?.storybook !== "object" ? void 0 : vpOptions.storybook;
62
82
  config = config.append(
@@ -1,9 +1,2 @@
1
- import type { ESLint, Linter } from "eslint";
2
- interface ReactCompiler extends ESLint.Plugin {
3
- rules: NonNullable<ESLint.Plugin["rules"]>;
4
- configs: {
5
- recommended: Linter.LegacyConfig;
6
- };
7
- }
8
- declare const reactCompiler: () => Promise<ReactCompiler>;
1
+ declare const reactCompiler: () => Promise<typeof import("eslint-plugin-react-compiler")>;
9
2
  export { reactCompiler };
package/dist/vdustr.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import type { sort } from "./extends/sort";
2
2
  import type { Config, ReplaceAntfuEslintRulesWithVpRulesDeeply, VpComposer } from "./types";
3
3
  import antfu from "@antfu/eslint-config";
4
+ import { emotion } from "./configs/emotion";
4
5
  import { mdx } from "./configs/mdx";
5
6
  import { packageJson } from "./configs/packageJson";
6
7
  import { prettier } from "./configs/prettier";
7
8
  import { storybook } from "./configs/storybook";
9
+ import { tanstackQuery } from "./configs/tanstackQuery";
8
10
  import { imports } from "./extends/imports";
9
11
  import { javascript } from "./extends/javascript";
10
12
  import { jsonc } from "./extends/jsonc";
@@ -22,6 +24,8 @@ type Options = ReplaceAntfuEslintRulesWithVpRulesDeeply<NonNullable<Parameters<t
22
24
  react?: react.Options;
23
25
  };
24
26
  packageJson?: boolean | packageJson.Options;
27
+ emotion?: boolean | emotion.Options;
28
+ tanstackQuery?: boolean | tanstackQuery.Options;
25
29
  mdx?: boolean | mdx.Options;
26
30
  storybook?: boolean | storybook.Options;
27
31
  prettier?: boolean | prettier.Options;
package/dist/vdustr.js CHANGED
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.vdustr = void 0;
7
7
  var _eslintConfig = _interopRequireDefault(require("@antfu/eslint-config"));
8
8
  var _esToolkit = require("es-toolkit");
9
+ var _emotion = require("./configs/emotion");
9
10
  var _mdx = require("./configs/mdx");
10
11
  var _packageJson = require("./configs/packageJson");
11
12
  var _prettier = require("./configs/prettier");
12
13
  var _storybook = require("./configs/storybook");
14
+ var _tanstackQuery = require("./configs/tanstackQuery");
13
15
  var _imports = require("./extends/imports");
14
16
  var _javascript = require("./extends/javascript");
15
17
  var _jsonc = require("./extends/jsonc");
@@ -18,13 +20,15 @@ var _sort = require("./extends/sort");
18
20
  var _typescript = require("./extends/typescript");
19
21
  var _yaml = require("./extends/yaml");
20
22
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
- const ownedConfigNames = ["extends", "packageJson", "mdx", "storybook", "prettier"];
23
+ const ownedConfigNames = ["extends", "packageJson", "emotion", "tanstackQuery", "mdx", "storybook", "prettier"];
22
24
  const vdustr = (options, ...userConfigs) => {
23
25
  const antfuOptions = (0, _esToolkit.omit)(options ?? {}, ownedConfigNames);
24
26
  const vpOptions = (0, _esToolkit.pick)(options ?? {}, ownedConfigNames);
25
27
  const packageJsonEnabled = Boolean(vpOptions?.packageJson ?? true);
26
- const storybookEnabled = Boolean(vpOptions?.storybook ?? false);
28
+ const emotionEnabled = Boolean(vpOptions?.emotion ?? false);
29
+ const tanstackQueryEnabled = Boolean(vpOptions?.tanstackQuery ?? false);
27
30
  const mdxEnabled = Boolean(vpOptions?.mdx ?? false);
31
+ const storybookEnabled = Boolean(vpOptions?.storybook ?? false);
28
32
  const prettierEnabled = Boolean(vpOptions?.prettier ?? true);
29
33
  let config = (0, _eslintConfig.default)({
30
34
  ...antfuOptions,
@@ -47,6 +51,14 @@ const vdustr = (options, ...userConfigs) => {
47
51
  const packageJsonOptions = typeof vpOptions?.packageJson !== "object" ? void 0 : vpOptions.packageJson;
48
52
  config = config.append((0, _packageJson.packageJson)(...(!packageJsonOptions ? [] : [packageJsonOptions])));
49
53
  }
54
+ if (emotionEnabled) {
55
+ const emotionOptions = typeof vpOptions?.emotion !== "object" ? void 0 : vpOptions.emotion;
56
+ config = config.append((0, _emotion.emotion)(...(!emotionOptions ? [] : [emotionOptions])));
57
+ }
58
+ if (tanstackQueryEnabled) {
59
+ const tanstackQueryOptions = typeof vpOptions?.tanstackQuery !== "object" ? void 0 : vpOptions.tanstackQuery;
60
+ config = config.append((0, _tanstackQuery.tanstackQuery)(...(!tanstackQueryOptions ? [] : [tanstackQueryOptions])));
61
+ }
50
62
  if (storybookEnabled) {
51
63
  const storybookOptions = typeof vpOptions?.storybook !== "object" ? void 0 : vpOptions.storybook;
52
64
  config = config.append((0, _storybook.storybook)(...(!storybookOptions ? [] : [storybookOptions])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vp-tw/eslint-config",
3
- "version": "0.0.29",
3
+ "version": "0.1.0",
4
4
  "description": "ViPro's ESLint configuration",
5
5
  "homepage": "https://github.com/vdustr/eslint-config",
6
6
  "author": {
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@mui/types": "^7.2.21",
43
- "es-toolkit": "^1.33.0",
43
+ "es-toolkit": "^1.37.2",
44
44
  "eslint-flat-config-utils": "^2.0.1",
45
45
  "local-pkg": "^1.1.1"
46
46
  },
@@ -49,17 +49,25 @@
49
49
  "unbuild": "^3.3.1"
50
50
  },
51
51
  "peerDependencies": {
52
- "@antfu/eslint-config": "4.10.1",
52
+ "@antfu/eslint-config": "^4.13.0",
53
+ "@emotion/eslint-plugin": "^11.12.0",
54
+ "@tanstack/eslint-plugin-query": "^5.74.7",
53
55
  "@types/eslint-config-prettier": "^6.11.3",
54
- "eslint": "^9.22.0",
55
- "eslint-config-prettier": "^10.1.1",
56
- "eslint-plugin-mdx": "^3.2.0",
57
- "eslint-plugin-package-json": "^0.26.3",
58
- "eslint-plugin-react-compiler": "^19.0.0-beta-bafa41b-20250307",
59
- "eslint-plugin-storybook": "^0.11.4",
60
- "eslint-plugin-yml": "^1.17.0"
56
+ "eslint": "^9.26.0",
57
+ "eslint-config-prettier": "^10.1.5",
58
+ "eslint-plugin-mdx": "^3.4.1",
59
+ "eslint-plugin-package-json": "^0.31.0",
60
+ "eslint-plugin-react-compiler": "^19.1.0-rc.1",
61
+ "eslint-plugin-storybook": "^0.12.0",
62
+ "eslint-plugin-yml": "^1.18.0"
61
63
  },
62
64
  "peerDependenciesMeta": {
65
+ "@emotion/eslint-plugin": {
66
+ "optional": true
67
+ },
68
+ "@tanstack/eslint-plugin-query": {
69
+ "optional": true
70
+ },
63
71
  "@types/eslint-config-prettier": {
64
72
  "optional": true
65
73
  },