@vp-tw/eslint-config 0.0.2 → 0.0.4

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.
@@ -1,236 +1,11 @@
1
1
  import type { TypedFlatConfigItem } from "@antfu/eslint-config";
2
2
  import type { DistributiveOmit } from "@mui/types";
3
- import type { Config } from "../types";
4
3
  import * as mdxPlugin from "eslint-plugin-mdx";
5
4
  declare namespace mdx {
6
5
  interface Options extends DistributiveOmit<TypedFlatConfigItem, "processor"> {
7
6
  processorOptions?: mdxPlugin.ProcessorOptions;
8
- flatCodeBlocks?: boolean | Config;
7
+ flatCodeBlocks?: boolean | TypedFlatConfigItem;
9
8
  }
10
9
  }
11
- declare const mdx: ({ flatCodeBlocks, processorOptions, ...options }?: mdx.Options) => ({
12
- length: number;
13
- toString(): string;
14
- toLocaleString(): string;
15
- toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
16
- pop(): TypedFlatConfigItem | undefined;
17
- push(...items: TypedFlatConfigItem[]): number;
18
- concat(...items: ConcatArray<TypedFlatConfigItem>[]): TypedFlatConfigItem[];
19
- concat(...items: (TypedFlatConfigItem | ConcatArray<TypedFlatConfigItem>)[]): TypedFlatConfigItem[];
20
- join(separator?: string): string;
21
- reverse(): TypedFlatConfigItem[];
22
- shift(): TypedFlatConfigItem | undefined;
23
- slice(start?: number, end?: number): TypedFlatConfigItem[];
24
- sort(compareFn?: ((a: TypedFlatConfigItem, b: TypedFlatConfigItem) => number) | undefined): TypedFlatConfigItem[];
25
- splice(start: number, deleteCount?: number): TypedFlatConfigItem[];
26
- splice(start: number, deleteCount: number, ...items: TypedFlatConfigItem[]): TypedFlatConfigItem[];
27
- unshift(...items: TypedFlatConfigItem[]): number;
28
- indexOf(searchElement: TypedFlatConfigItem, fromIndex?: number): number;
29
- lastIndexOf(searchElement: TypedFlatConfigItem, fromIndex?: number): number;
30
- every<S extends TypedFlatConfigItem>(predicate: (value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => value is S, thisArg?: any): this is S[];
31
- every(predicate: (value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => unknown, thisArg?: any): boolean;
32
- some(predicate: (value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => unknown, thisArg?: any): boolean;
33
- forEach(callbackfn: (value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => void, thisArg?: any): void;
34
- map<U>(callbackfn: (value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => U, thisArg?: any): U[];
35
- filter<S extends TypedFlatConfigItem>(predicate: (value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => value is S, thisArg?: any): S[];
36
- filter(predicate: (value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => unknown, thisArg?: any): TypedFlatConfigItem[];
37
- reduce(callbackfn: (previousValue: TypedFlatConfigItem, currentValue: TypedFlatConfigItem, currentIndex: number, array: TypedFlatConfigItem[]) => TypedFlatConfigItem): TypedFlatConfigItem;
38
- reduce(callbackfn: (previousValue: TypedFlatConfigItem, currentValue: TypedFlatConfigItem, currentIndex: number, array: TypedFlatConfigItem[]) => TypedFlatConfigItem, initialValue: TypedFlatConfigItem): TypedFlatConfigItem;
39
- reduce<U>(callbackfn: (previousValue: U, currentValue: TypedFlatConfigItem, currentIndex: number, array: TypedFlatConfigItem[]) => U, initialValue: U): U;
40
- reduceRight(callbackfn: (previousValue: TypedFlatConfigItem, currentValue: TypedFlatConfigItem, currentIndex: number, array: TypedFlatConfigItem[]) => TypedFlatConfigItem): TypedFlatConfigItem;
41
- reduceRight(callbackfn: (previousValue: TypedFlatConfigItem, currentValue: TypedFlatConfigItem, currentIndex: number, array: TypedFlatConfigItem[]) => TypedFlatConfigItem, initialValue: TypedFlatConfigItem): TypedFlatConfigItem;
42
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: TypedFlatConfigItem, currentIndex: number, array: TypedFlatConfigItem[]) => U, initialValue: U): U;
43
- find<S extends TypedFlatConfigItem>(predicate: (value: TypedFlatConfigItem, index: number, obj: TypedFlatConfigItem[]) => value is S, thisArg?: any): S | undefined;
44
- find(predicate: (value: TypedFlatConfigItem, index: number, obj: TypedFlatConfigItem[]) => unknown, thisArg?: any): TypedFlatConfigItem | undefined;
45
- findIndex(predicate: (value: TypedFlatConfigItem, index: number, obj: TypedFlatConfigItem[]) => unknown, thisArg?: any): number;
46
- fill(value: TypedFlatConfigItem, start?: number, end?: number): TypedFlatConfigItem[];
47
- copyWithin(target: number, start: number, end?: number): TypedFlatConfigItem[];
48
- entries(): ArrayIterator<[number, TypedFlatConfigItem]>;
49
- keys(): ArrayIterator<number>;
50
- values(): ArrayIterator<TypedFlatConfigItem>;
51
- includes(searchElement: TypedFlatConfigItem, fromIndex?: number): boolean;
52
- flatMap<U, This = undefined>(callback: (this: This, value: TypedFlatConfigItem, index: number, array: TypedFlatConfigItem[]) => U | readonly U[], thisArg?: This | undefined): U[];
53
- flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
54
- [Symbol.iterator](): ArrayIterator<TypedFlatConfigItem>;
55
- [Symbol.unscopables]: {
56
- [x: number]: boolean | undefined;
57
- length?: boolean | undefined;
58
- toString?: boolean | undefined;
59
- toLocaleString?: boolean | undefined;
60
- pop?: boolean | undefined;
61
- push?: boolean | undefined;
62
- concat?: boolean | undefined;
63
- join?: boolean | undefined;
64
- reverse?: boolean | undefined;
65
- shift?: boolean | undefined;
66
- slice?: boolean | undefined;
67
- sort?: boolean | undefined;
68
- splice?: boolean | undefined;
69
- unshift?: boolean | undefined;
70
- indexOf?: boolean | undefined;
71
- lastIndexOf?: boolean | undefined;
72
- every?: boolean | undefined;
73
- some?: boolean | undefined;
74
- forEach?: boolean | undefined;
75
- map?: boolean | undefined;
76
- filter?: boolean | undefined;
77
- reduce?: boolean | undefined;
78
- reduceRight?: boolean | undefined;
79
- find?: boolean | undefined;
80
- findIndex?: boolean | undefined;
81
- fill?: boolean | undefined;
82
- copyWithin?: boolean | undefined;
83
- entries?: boolean | undefined;
84
- keys?: boolean | undefined;
85
- values?: boolean | undefined;
86
- includes?: boolean | undefined;
87
- flatMap?: boolean | undefined;
88
- flat?: boolean | undefined;
89
- [Symbol.iterator]?: boolean | undefined;
90
- readonly [Symbol.unscopables]?: boolean | undefined;
91
- at?: boolean | undefined;
92
- };
93
- at(index: number): TypedFlatConfigItem | undefined;
94
- name: string;
95
- files?: Array<string | string[]>;
96
- ignores?: string[];
97
- language?: string;
98
- languageOptions?: import("eslint").Linter.LanguageOptions;
99
- linterOptions?: import("eslint").Linter.LinterOptions;
100
- processor?: string | import("eslint").Linter.Processor;
101
- plugins?: Record<string, import("eslint").ESLint.Plugin>;
102
- rules?: Partial<import("eslint").Linter.RulesRecord> | undefined;
103
- settings?: Record<string, unknown>;
104
- } | {
105
- [Symbol.toStringTag]: string;
106
- name: string;
107
- files?: Array<string | string[]>;
108
- ignores?: string[];
109
- language?: string;
110
- languageOptions?: import("eslint").Linter.LanguageOptions;
111
- linterOptions?: import("eslint").Linter.LinterOptions;
112
- processor?: string | import("eslint").Linter.Processor;
113
- plugins?: Record<string, import("eslint").ESLint.Plugin>;
114
- rules?: Partial<import("eslint").Linter.RulesRecord> | undefined;
115
- settings?: Record<string, unknown>;
116
- } | {
117
- length: number;
118
- toString(): string;
119
- toLocaleString(): string;
120
- toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
121
- pop(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | undefined;
122
- push(...items: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]): number;
123
- concat(...items: ConcatArray<import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>>[]): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
124
- concat(...items: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | ConcatArray<import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>>)[]): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
125
- join(separator?: string): string;
126
- reverse(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
127
- shift(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | undefined;
128
- slice(start?: number, end?: number): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
129
- sort(compareFn?: ((a: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, b: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>) => number) | undefined): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
130
- splice(start: number, deleteCount?: number): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
131
- splice(start: number, deleteCount: number, ...items: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
132
- unshift(...items: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]): number;
133
- indexOf(searchElement: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, fromIndex?: number): number;
134
- lastIndexOf(searchElement: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, fromIndex?: number): number;
135
- every<S extends import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>>(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => value is S, thisArg?: any): this is S[];
136
- every(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => unknown, thisArg?: any): boolean;
137
- some(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => unknown, thisArg?: any): boolean;
138
- forEach(callbackfn: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => void, thisArg?: any): void;
139
- map<U>(callbackfn: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => U, thisArg?: any): U[];
140
- filter<S extends import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>>(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => value is S, thisArg?: any): S[];
141
- filter(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => unknown, thisArg?: any): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
142
- reduce(callbackfn: (previousValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentIndex: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>;
143
- reduce(callbackfn: (previousValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentIndex: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, initialValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>;
144
- reduce<U>(callbackfn: (previousValue: U, currentValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentIndex: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => U, initialValue: U): U;
145
- reduceRight(callbackfn: (previousValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentIndex: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>;
146
- reduceRight(callbackfn: (previousValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentIndex: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, initialValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>;
147
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, currentIndex: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => U, initialValue: U): U;
148
- find<S extends import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>>(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, obj: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => value is S, thisArg?: any): S | undefined;
149
- find(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, obj: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => unknown, thisArg?: any): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | undefined;
150
- findIndex(predicate: (value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, obj: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => unknown, thisArg?: any): number;
151
- fill(value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, start?: number, end?: number): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
152
- copyWithin(target: number, start: number, end?: number): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
153
- entries(): ArrayIterator<[number, import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>]>;
154
- keys(): ArrayIterator<number>;
155
- values(): ArrayIterator<import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>>;
156
- includes(searchElement: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, fromIndex?: number): boolean;
157
- flatMap<U, This = undefined>(callback: (this: This, value: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>, index: number, array: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => U | readonly U[], thisArg?: This | undefined): U[];
158
- flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
159
- [Symbol.iterator](): ArrayIterator<import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>>;
160
- [Symbol.unscopables]: {
161
- [x: number]: boolean | undefined;
162
- length?: boolean | undefined;
163
- toString?: boolean | undefined;
164
- toLocaleString?: boolean | undefined;
165
- pop?: boolean | undefined;
166
- push?: boolean | undefined;
167
- concat?: boolean | undefined;
168
- join?: boolean | undefined;
169
- reverse?: boolean | undefined;
170
- shift?: boolean | undefined;
171
- slice?: boolean | undefined;
172
- sort?: boolean | undefined;
173
- splice?: boolean | undefined;
174
- unshift?: boolean | undefined;
175
- indexOf?: boolean | undefined;
176
- lastIndexOf?: boolean | undefined;
177
- every?: boolean | undefined;
178
- some?: boolean | undefined;
179
- forEach?: boolean | undefined;
180
- map?: boolean | undefined;
181
- filter?: boolean | undefined;
182
- reduce?: boolean | undefined;
183
- reduceRight?: boolean | undefined;
184
- find?: boolean | undefined;
185
- findIndex?: boolean | undefined;
186
- fill?: boolean | undefined;
187
- copyWithin?: boolean | undefined;
188
- entries?: boolean | undefined;
189
- keys?: boolean | undefined;
190
- values?: boolean | undefined;
191
- includes?: boolean | undefined;
192
- flatMap?: boolean | undefined;
193
- flat?: boolean | undefined;
194
- [Symbol.iterator]?: boolean | undefined;
195
- readonly [Symbol.unscopables]?: boolean | undefined;
196
- at?: boolean | undefined;
197
- };
198
- at(index: number): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | undefined;
199
- name: string;
200
- files?: Array<string | string[]>;
201
- ignores?: string[];
202
- language?: string;
203
- languageOptions?: import("eslint").Linter.LanguageOptions;
204
- linterOptions?: import("eslint").Linter.LinterOptions;
205
- processor?: string | import("eslint").Linter.Processor;
206
- plugins?: Record<string, import("eslint").ESLint.Plugin>;
207
- rules?: Partial<import("eslint").Linter.RulesRecord> | undefined;
208
- settings?: Record<string, unknown>;
209
- } | {
210
- then<TResult1 = TypedFlatConfigItem | TypedFlatConfigItem[] | import("eslint-flat-config-utils/index").FlatConfigComposer<any, any> | import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[], TResult2 = never>(onfulfilled?: ((value: TypedFlatConfigItem | TypedFlatConfigItem[] | import("eslint-flat-config-utils/index").FlatConfigComposer<any, any> | import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
211
- catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<TypedFlatConfigItem | TypedFlatConfigItem[] | import("eslint-flat-config-utils/index").FlatConfigComposer<any, any> | import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[] | TResult>;
212
- finally(onfinally?: (() => void) | null | undefined): Promise<TypedFlatConfigItem | TypedFlatConfigItem[] | import("eslint-flat-config-utils/index").FlatConfigComposer<any, any> | import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[]>;
213
- [Symbol.toStringTag]: string;
214
- name: string;
215
- files?: Array<string | string[]>;
216
- ignores?: string[];
217
- language?: string;
218
- languageOptions?: import("eslint").Linter.LanguageOptions;
219
- linterOptions?: import("eslint").Linter.LinterOptions;
220
- processor?: string | import("eslint").Linter.Processor;
221
- plugins?: Record<string, import("eslint").ESLint.Plugin>;
222
- rules?: Partial<import("eslint").Linter.RulesRecord> | undefined;
223
- settings?: Record<string, unknown>;
224
- } | {
225
- name: string;
226
- files?: Array<string | string[]>;
227
- ignores?: string[];
228
- language?: string;
229
- languageOptions?: import("eslint").Linter.LanguageOptions;
230
- linterOptions?: import("eslint").Linter.LinterOptions;
231
- processor?: string | import("eslint").Linter.Processor;
232
- rules?: Partial<import("eslint").Linter.RulesRecord> | undefined;
233
- settings?: Record<string, unknown>;
234
- plugins?: Record<string, any> | undefined;
235
- })[];
10
+ declare const mdx: ({ flatCodeBlocks, processorOptions, ...options }?: mdx.Options) => TypedFlatConfigItem[];
236
11
  export { mdx };
@@ -1,27 +1,44 @@
1
1
  import * as mdxPlugin from "eslint-plugin-mdx";
2
+ import { renameRules } from "../utils/renameRules.mjs";
2
3
  const mdx = ({
3
4
  flatCodeBlocks = true,
4
5
  processorOptions,
5
6
  ...options
6
- } = {}) => [
7
- {
8
- name: "vdustr/mdx",
9
- ...mdxPlugin.flat,
10
- ...options,
11
- processor: mdxPlugin.createRemarkProcessor({
12
- lintCodeBlocks: Boolean(flatCodeBlocks),
13
- ...processorOptions,
14
- languageMapper: {
15
- ...processorOptions?.languageMapper
16
- }
17
- })
18
- },
19
- ...!flatCodeBlocks ? [] : [
7
+ } = {}) => {
8
+ const flatCodeBlocksOptions = typeof flatCodeBlocks !== "object" ? {} : flatCodeBlocks;
9
+ const configs = [
20
10
  {
21
- name: "vdustr/mdx/flat-code-blocks",
22
- ...mdxPlugin.flatCodeBlocks,
23
- ...typeof flatCodeBlocks !== "object" ? null : flatCodeBlocks
24
- }
25
- ]
26
- ];
11
+ name: "vdustr/mdx",
12
+ ...mdxPlugin.flat,
13
+ ...options,
14
+ rules: {
15
+ ...renameRules({
16
+ ...mdxPlugin.flat.rules
17
+ }),
18
+ ...options.rules
19
+ },
20
+ processor: mdxPlugin.createRemarkProcessor({
21
+ lintCodeBlocks: Boolean(flatCodeBlocks),
22
+ ...processorOptions,
23
+ languageMapper: {
24
+ ...processorOptions?.languageMapper
25
+ }
26
+ })
27
+ },
28
+ ...!flatCodeBlocks ? [] : [
29
+ {
30
+ name: "vdustr/mdx/flat-code-blocks",
31
+ ...mdxPlugin.flatCodeBlocks,
32
+ ...flatCodeBlocksOptions,
33
+ rules: {
34
+ ...renameRules({
35
+ ...mdxPlugin.flatCodeBlocks.rules
36
+ }),
37
+ ...flatCodeBlocksOptions.rules
38
+ }
39
+ }
40
+ ]
41
+ ];
42
+ return configs;
43
+ };
27
44
  export { mdx };
@@ -1,3 +1,2 @@
1
- import type { Config } from "../types";
2
- declare const prettier: Config;
1
+ declare const prettier: any;
3
2
  export { prettier };
@@ -1,8 +1,8 @@
1
- import { defaultPluginRenaming, renameRules } from "@antfu/eslint-config";
2
1
  import eslintConfigPrettier from "eslint-config-prettier";
2
+ import { renameRules } from "../utils/renameRules.mjs";
3
3
  const prettier = {
4
4
  name: "vdustr/prettier",
5
5
  ...eslintConfigPrettier,
6
- rules: renameRules(eslintConfigPrettier.rules, defaultPluginRenaming)
6
+ rules: renameRules(eslintConfigPrettier.rules)
7
7
  };
8
8
  export { prettier };
@@ -0,0 +1,2 @@
1
+ declare const storybook: any;
2
+ export { storybook };
@@ -0,0 +1,15 @@
1
+ import storybookPlugin from "eslint-plugin-storybook";
2
+ import { renameRules } from "../utils/renameRules.mjs";
3
+ const storybook = storybookPlugin.configs["flat/csf-strict"].map((config) => {
4
+ const allConfig = config;
5
+ const { rules, files, plugins, ...rest } = allConfig;
6
+ return {
7
+ ...rest,
8
+ ...!rules ? null : {
9
+ rules: renameRules(rules)
10
+ },
11
+ ...!files ? null : { files },
12
+ ...!plugins ? null : { plugins }
13
+ };
14
+ });
15
+ export { storybook };
@@ -17,10 +17,90 @@ export interface RuleOptions {
17
17
  * Surfaces diagnostics from React Forget
18
18
  */
19
19
  'react-compiler/react-compiler'?: Linter.RuleEntry<ReactCompilerReactCompiler>
20
+ /**
21
+ * Interactions should be awaited
22
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/await-interactions.md
23
+ */
24
+ 'storybook/await-interactions'?: Linter.RuleEntry<[]>
25
+ /**
26
+ * Pass a context when invoking play function of another story
27
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/context-in-play-function.md
28
+ */
29
+ 'storybook/context-in-play-function'?: Linter.RuleEntry<[]>
30
+ /**
31
+ * The component property should be set
32
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/csf-component.md
33
+ */
34
+ 'storybook/csf-component'?: Linter.RuleEntry<[]>
35
+ /**
36
+ * Story files should have a default export
37
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/default-exports.md
38
+ */
39
+ 'storybook/default-exports'?: Linter.RuleEntry<[]>
40
+ /**
41
+ * Deprecated hierarchy separator in title property
42
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/hierarchy-separator.md
43
+ */
44
+ 'storybook/hierarchy-separator'?: Linter.RuleEntry<[]>
45
+ /**
46
+ * Meta should only have inline properties
47
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/meta-inline-properties.md
48
+ */
49
+ 'storybook/meta-inline-properties'?: Linter.RuleEntry<StorybookMetaInlineProperties>
50
+ /**
51
+ * A story should not have a redundant name property
52
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-redundant-story-name.md
53
+ */
54
+ 'storybook/no-redundant-story-name'?: Linter.RuleEntry<[]>
55
+ /**
56
+ * storiesOf is deprecated and should not be used
57
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-stories-of.md
58
+ */
59
+ 'storybook/no-stories-of'?: Linter.RuleEntry<[]>
60
+ /**
61
+ * Do not define a title in meta
62
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-title-property-in-meta.md
63
+ */
64
+ 'storybook/no-title-property-in-meta'?: Linter.RuleEntry<[]>
65
+ /**
66
+ * This rule identifies storybook addons that are invalid because they are either not installed or contain a typo in their name.
67
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-uninstalled-addons.md
68
+ */
69
+ 'storybook/no-uninstalled-addons'?: Linter.RuleEntry<StorybookNoUninstalledAddons>
70
+ /**
71
+ * Stories should use PascalCase
72
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/prefer-pascal-case.md
73
+ */
74
+ 'storybook/prefer-pascal-case'?: Linter.RuleEntry<[]>
75
+ /**
76
+ * A story file must contain at least one story export
77
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/story-exports.md
78
+ */
79
+ 'storybook/story-exports'?: Linter.RuleEntry<[]>
80
+ /**
81
+ * Use expect from `@storybook/test` or `@storybook/jest`
82
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/use-storybook-expect.md
83
+ */
84
+ 'storybook/use-storybook-expect'?: Linter.RuleEntry<[]>
85
+ /**
86
+ * Do not use testing-library directly on stories
87
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/use-storybook-testing-library.md
88
+ */
89
+ 'storybook/use-storybook-testing-library'?: Linter.RuleEntry<[]>
20
90
  }
21
91
 
22
92
  /* ======= Declarations ======= */
23
93
  // ----- react-compiler/react-compiler -----
24
94
  type ReactCompilerReactCompiler = []|[{
25
95
  [k: string]: unknown | undefined
96
+ }]
97
+ // ----- storybook/meta-inline-properties -----
98
+ type StorybookMetaInlineProperties = []|[{
99
+ csfVersion?: number
100
+ }]
101
+ // ----- storybook/no-uninstalled-addons -----
102
+ type StorybookNoUninstalledAddons = []|[{
103
+ packageJsonLocation?: string
104
+ ignore?: string[]
105
+ [k: string]: unknown | undefined
26
106
  }]
@@ -1,13 +1,9 @@
1
- declare module "eslint-plugin-react-compiler" {
2
- type Plugin = import("eslint").ESLint.Plugin;
3
- type LegacyConfig = import("eslint").Linter.LegacyConfig;
4
- interface ReactCompiler extends Plugin {
5
- rules: NonNullable<Plugin["rules"]>;
6
- configs: {
7
- recommended: LegacyConfig;
8
- };
9
- }
10
- const rules: ReactCompiler["rules"];
11
- const configs: ReactCompiler["configs"];
12
- export { configs, rules };
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
+ };
13
7
  }
8
+ declare const reactCompilerInternal: ReactCompiler;
9
+ export { reactCompilerInternal as reactCompiler };
@@ -0,0 +1,3 @@
1
+ import * as reactCompiler from "eslint-plugin-react-compiler";
2
+ const reactCompilerInternal = reactCompiler.default ?? reactCompiler;
3
+ export { reactCompilerInternal as reactCompiler };
@@ -0,0 +1,3 @@
1
+ import { renameRules } from "@antfu/eslint-config";
2
+ declare function renameRulesInternal(rules: Parameters<typeof renameRules>[0]): Record<string, any>;
3
+ export { renameRulesInternal as renameRules };
@@ -0,0 +1,5 @@
1
+ import { defaultPluginRenaming, renameRules } from "@antfu/eslint-config";
2
+ function renameRulesInternal(rules) {
3
+ return renameRules(rules, defaultPluginRenaming);
4
+ }
5
+ export { renameRulesInternal as renameRules };
@@ -1,9 +1,9 @@
1
1
  import type { Config } from "./types";
2
2
  import antfu from "@antfu/eslint-config";
3
3
  import { mdx } from "./configs/mdx";
4
- import "./eslint-typegen.d";
5
4
  type Options = NonNullable<Parameters<typeof antfu>[0]> & {
6
5
  mdx?: boolean | mdx.Options;
6
+ storybook?: boolean;
7
7
  };
8
8
  declare const vdustr: (options?: Options, ...userConfigs: Array<Config>) => import("eslint-flat-config-utils/index").FlatConfigComposer<import("@antfu/eslint-config").TypedFlatConfigItem, import("@antfu/eslint-config").ConfigNames>;
9
9
  export { vdustr };