@wongxy/eslint-config 2.0.0 → 3.0.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.
package/dist/index.d.cts CHANGED
@@ -1,180 +1,679 @@
1
- import { Linter } from 'eslint';
2
- import { FlatConfigComposer } from 'eslint-flat-config-utils';
3
- import { OptionsConfig as OptionsConfig$1, TypedFlatConfigItem as TypedFlatConfigItem$1, Rules as Rules$1, ConfigNames as ConfigNames$2, OptionsOverrides as OptionsOverrides$1, Awaitable } from '@antfu/eslint-config';
4
- export * from '@antfu/eslint-config';
5
-
6
- /* eslint-disable */
7
- /* prettier-ignore */
8
-
1
+ import { OptionsOverrides, antfu } from "@antfu/eslint-config";
2
+ import { Linter } from "eslint";
9
3
 
4
+ //#region src/typegen.d.ts
10
5
  interface RuleOptions {
11
6
  /**
12
- * Enforce a consistent and logical order of the Tailwind CSS classnames
13
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/classnames-order.md
7
+ * Enforce a consistent order for tailwind classes.
8
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md
9
+ */
10
+ 'tw/enforce-consistent-class-order'?: Linter.RuleEntry<TwEnforceConsistentClassOrder>;
11
+ /**
12
+ * Enforce consistent important position for classes.
13
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-important-position.md
14
14
  */
15
- 'tw/classnames-order'?: Linter.RuleEntry<TwClassnamesOrder>
15
+ 'tw/enforce-consistent-important-position'?: Linter.RuleEntry<TwEnforceConsistentImportantPosition>;
16
16
  /**
17
- * Warns about dash prefixed classnames using arbitrary values
18
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-negative-arbitrary-values.md
17
+ * Enforce consistent line wrapping for tailwind classes.
18
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/multiline.md
19
19
  */
20
- 'tw/enforces-negative-arbitrary-values'?: Linter.RuleEntry<TwEnforcesNegativeArbitraryValues>
20
+ 'tw/enforce-consistent-line-wrapping'?: Linter.RuleEntry<TwEnforceConsistentLineWrapping>;
21
21
  /**
22
- * Enforces the usage of shorthand Tailwind CSS classnames
23
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-shorthand.md
22
+ * Enforce consistent syntax for css variables.
23
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-variable-syntax.md
24
24
  */
25
- 'tw/enforces-shorthand'?: Linter.RuleEntry<TwEnforcesShorthand>
25
+ 'tw/enforce-consistent-variable-syntax'?: Linter.RuleEntry<TwEnforceConsistentVariableSyntax>;
26
26
  /**
27
- * Detect obsolete classnames when upgrading to Tailwind CSS v3
28
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/migration-from-tailwind-2.md
27
+ * Enforce shorthand class names instead of longhand class names.
28
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-shorthand-classes.md
29
29
  */
30
- 'tw/migration-from-tailwind-2'?: Linter.RuleEntry<TwMigrationFromTailwind2>
30
+ 'tw/enforce-shorthand-classes'?: Linter.RuleEntry<TwEnforceShorthandClasses>;
31
31
  /**
32
- * Forbid using arbitrary values in classnames
33
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-arbitrary-value.md
32
+ * Enforce consistent line wrapping for tailwind classes.
33
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/multiline.md
34
+ * @deprecated
34
35
  */
35
- 'tw/no-arbitrary-value'?: Linter.RuleEntry<TwNoArbitraryValue>
36
+ 'tw/multiline'?: Linter.RuleEntry<TwMultiline>;
36
37
  /**
37
- * Avoid contradicting Tailwind CSS classnames (e.g. "w-3 w-5")
38
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-contradicting-classname.md
38
+ * Disallow classes that produce conflicting styles.
39
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-conflicting-classes.md
39
40
  */
40
- 'tw/no-contradicting-classname'?: Linter.RuleEntry<TwNoContradictingClassname>
41
+ 'tw/no-conflicting-classes'?: Linter.RuleEntry<TwNoConflictingClasses>;
41
42
  /**
42
- * Detect classnames which do not belong to Tailwind CSS
43
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-custom-classname.md
43
+ * Disallow the use of deprecated Tailwind CSS classes.
44
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-deprecated-classes.md
44
45
  */
45
- 'tw/no-custom-classname'?: Linter.RuleEntry<TwNoCustomClassname>
46
+ 'tw/no-deprecated-classes'?: Linter.RuleEntry<TwNoDeprecatedClasses>;
46
47
  /**
47
- * Forbid using arbitrary values in classnames when an equivalent preset exists
48
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-unnecessary-arbitrary-value.md
48
+ * Disallow duplicate class names in tailwind classes.
49
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-duplicate-classes.md
49
50
  */
50
- 'tw/no-unnecessary-arbitrary-value'?: Linter.RuleEntry<TwNoUnnecessaryArbitraryValue>
51
+ 'tw/no-duplicate-classes'?: Linter.RuleEntry<TwNoDuplicateClasses>;
52
+ /**
53
+ * Disallow restricted classes.
54
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md
55
+ */
56
+ 'tw/no-restricted-classes'?: Linter.RuleEntry<TwNoRestrictedClasses>;
57
+ /**
58
+ * Disallow unnecessary whitespace between Tailwind CSS classes.
59
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md
60
+ */
61
+ 'tw/no-unnecessary-whitespace'?: Linter.RuleEntry<TwNoUnnecessaryWhitespace>;
62
+ /**
63
+ * Disallow any css classes that are not registered in tailwindcss.
64
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unregistered-classes.md
65
+ */
66
+ 'tw/no-unregistered-classes'?: Linter.RuleEntry<TwNoUnregisteredClasses>;
67
+ /**
68
+ * Enforce a consistent order for tailwind classes.
69
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md
70
+ * @deprecated
71
+ */
72
+ 'tw/sort-classes'?: Linter.RuleEntry<TwSortClasses>;
51
73
  }
52
74
 
53
75
  /* ======= Declarations ======= */
54
- // ----- tw/classnames-order -----
55
- type TwClassnamesOrder = []|[{
56
- callees?: string[]
57
- ignoredKeys?: string[]
58
- config?: (string | {
59
- [k: string]: unknown | undefined
60
- })
61
- removeDuplicates?: boolean
62
- tags?: string[]
63
- [k: string]: unknown | undefined
64
- }]
65
- // ----- tw/enforces-negative-arbitrary-values -----
66
- type TwEnforcesNegativeArbitraryValues = []|[{
67
- callees?: string[]
68
- ignoredKeys?: string[]
69
- config?: (string | {
70
- [k: string]: unknown | undefined
71
- })
72
- tags?: string[]
73
- [k: string]: unknown | undefined
74
- }]
75
- // ----- tw/enforces-shorthand -----
76
- type TwEnforcesShorthand = []|[{
77
- callees?: string[]
78
- ignoredKeys?: string[]
79
- config?: (string | {
80
- [k: string]: unknown | undefined
81
- })
82
- tags?: string[]
83
- [k: string]: unknown | undefined
84
- }]
85
- // ----- tw/migration-from-tailwind-2 -----
86
- type TwMigrationFromTailwind2 = []|[{
87
- callees?: string[]
88
- ignoredKeys?: string[]
89
- config?: (string | {
90
- [k: string]: unknown | undefined
91
- })
92
- tags?: string[]
93
- [k: string]: unknown | undefined
94
- }]
95
- // ----- tw/no-arbitrary-value -----
96
- type TwNoArbitraryValue = []|[{
97
- callees?: string[]
98
- ignoredKeys?: string[]
99
- config?: (string | {
100
- [k: string]: unknown | undefined
101
- })
102
- tags?: string[]
103
- [k: string]: unknown | undefined
104
- }]
105
- // ----- tw/no-contradicting-classname -----
106
- type TwNoContradictingClassname = []|[{
107
- callees?: string[]
108
- ignoredKeys?: string[]
109
- config?: (string | {
110
- [k: string]: unknown | undefined
111
- })
112
- tags?: string[]
113
- [k: string]: unknown | undefined
114
- }]
115
- // ----- tw/no-custom-classname -----
116
- type TwNoCustomClassname = []|[{
117
- callees?: string[]
118
- ignoredKeys?: string[]
119
- config?: (string | {
120
- [k: string]: unknown | undefined
121
- })
122
- cssFiles?: string[]
123
- cssFilesRefreshRate?: number
124
- tags?: string[]
125
- whitelist?: string[]
126
- [k: string]: unknown | undefined
127
- }]
128
- // ----- tw/no-unnecessary-arbitrary-value -----
129
- type TwNoUnnecessaryArbitraryValue = []|[{
130
- callees?: string[]
131
- ignoredKeys?: string[]
132
- config?: (string | {
133
- [k: string]: unknown | undefined
134
- })
135
- tags?: string[]
136
- [k: string]: unknown | undefined
137
- }]
76
+ // ----- tw/enforce-consistent-class-order -----
77
+ type TwEnforceConsistentClassOrder = [] | [{
78
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
79
+ match?: "strings";
80
+ } | {
81
+ match?: "objectKeys";
82
+ pathPattern?: string;
83
+ } | {
84
+ match?: "objectValues";
85
+ pathPattern?: string;
86
+ })[]] | string)[];
87
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
88
+ match?: "strings";
89
+ } | {
90
+ match?: "objectKeys";
91
+ pathPattern?: string;
92
+ } | {
93
+ match?: "objectValues";
94
+ pathPattern?: string;
95
+ })[]])[];
96
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
97
+ match?: "strings";
98
+ } | {
99
+ match?: "objectKeys";
100
+ pathPattern?: string;
101
+ } | {
102
+ match?: "objectValues";
103
+ pathPattern?: string;
104
+ })[]] | string)[];
105
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
106
+ match?: "strings";
107
+ } | {
108
+ match?: "objectKeys";
109
+ pathPattern?: string;
110
+ } | {
111
+ match?: "objectValues";
112
+ pathPattern?: string;
113
+ })[]] | string)[];
114
+ entryPoint?: string;
115
+ tailwindConfig?: string;
116
+ tsconfig?: string;
117
+ order?: ("asc" | "desc" | "official" | "improved");
118
+ }];
119
+ // ----- tw/enforce-consistent-important-position -----
120
+ type TwEnforceConsistentImportantPosition = [] | [{
121
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
122
+ match?: "strings";
123
+ } | {
124
+ match?: "objectKeys";
125
+ pathPattern?: string;
126
+ } | {
127
+ match?: "objectValues";
128
+ pathPattern?: string;
129
+ })[]] | string)[];
130
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
131
+ match?: "strings";
132
+ } | {
133
+ match?: "objectKeys";
134
+ pathPattern?: string;
135
+ } | {
136
+ match?: "objectValues";
137
+ pathPattern?: string;
138
+ })[]])[];
139
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
140
+ match?: "strings";
141
+ } | {
142
+ match?: "objectKeys";
143
+ pathPattern?: string;
144
+ } | {
145
+ match?: "objectValues";
146
+ pathPattern?: string;
147
+ })[]] | string)[];
148
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
149
+ match?: "strings";
150
+ } | {
151
+ match?: "objectKeys";
152
+ pathPattern?: string;
153
+ } | {
154
+ match?: "objectValues";
155
+ pathPattern?: string;
156
+ })[]] | string)[];
157
+ entryPoint?: string;
158
+ tailwindConfig?: string;
159
+ tsconfig?: string;
160
+ position?: ("legacy" | "recommended");
161
+ }];
162
+ // ----- tw/enforce-consistent-line-wrapping -----
163
+ type TwEnforceConsistentLineWrapping = [] | [{
164
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
165
+ match?: "strings";
166
+ } | {
167
+ match?: "objectKeys";
168
+ pathPattern?: string;
169
+ } | {
170
+ match?: "objectValues";
171
+ pathPattern?: string;
172
+ })[]] | string)[];
173
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
174
+ match?: "strings";
175
+ } | {
176
+ match?: "objectKeys";
177
+ pathPattern?: string;
178
+ } | {
179
+ match?: "objectValues";
180
+ pathPattern?: string;
181
+ })[]])[];
182
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
183
+ match?: "strings";
184
+ } | {
185
+ match?: "objectKeys";
186
+ pathPattern?: string;
187
+ } | {
188
+ match?: "objectValues";
189
+ pathPattern?: string;
190
+ })[]] | string)[];
191
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
192
+ match?: "strings";
193
+ } | {
194
+ match?: "objectKeys";
195
+ pathPattern?: string;
196
+ } | {
197
+ match?: "objectValues";
198
+ pathPattern?: string;
199
+ })[]] | string)[];
200
+ entryPoint?: string;
201
+ tailwindConfig?: string;
202
+ tsconfig?: string;
203
+ classesPerLine?: number;
204
+ group?: ("emptyLine" | "never" | "newLine");
205
+ indent?: ("tab" | number);
206
+ lineBreakStyle?: ("unix" | "windows");
207
+ preferSingleLine?: boolean;
208
+ printWidth?: number;
209
+ }];
210
+ // ----- tw/enforce-consistent-variable-syntax -----
211
+ type TwEnforceConsistentVariableSyntax = [] | [{
212
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
213
+ match?: "strings";
214
+ } | {
215
+ match?: "objectKeys";
216
+ pathPattern?: string;
217
+ } | {
218
+ match?: "objectValues";
219
+ pathPattern?: string;
220
+ })[]] | string)[];
221
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
222
+ match?: "strings";
223
+ } | {
224
+ match?: "objectKeys";
225
+ pathPattern?: string;
226
+ } | {
227
+ match?: "objectValues";
228
+ pathPattern?: string;
229
+ })[]])[];
230
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
231
+ match?: "strings";
232
+ } | {
233
+ match?: "objectKeys";
234
+ pathPattern?: string;
235
+ } | {
236
+ match?: "objectValues";
237
+ pathPattern?: string;
238
+ })[]] | string)[];
239
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
240
+ match?: "strings";
241
+ } | {
242
+ match?: "objectKeys";
243
+ pathPattern?: string;
244
+ } | {
245
+ match?: "objectValues";
246
+ pathPattern?: string;
247
+ })[]] | string)[];
248
+ syntax?: ("arbitrary" | "parentheses" | "shorthand" | "variable");
249
+ }];
250
+ // ----- tw/enforce-shorthand-classes -----
251
+ type TwEnforceShorthandClasses = [] | [{
252
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
253
+ match?: "strings";
254
+ } | {
255
+ match?: "objectKeys";
256
+ pathPattern?: string;
257
+ } | {
258
+ match?: "objectValues";
259
+ pathPattern?: string;
260
+ })[]] | string)[];
261
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
262
+ match?: "strings";
263
+ } | {
264
+ match?: "objectKeys";
265
+ pathPattern?: string;
266
+ } | {
267
+ match?: "objectValues";
268
+ pathPattern?: string;
269
+ })[]])[];
270
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
271
+ match?: "strings";
272
+ } | {
273
+ match?: "objectKeys";
274
+ pathPattern?: string;
275
+ } | {
276
+ match?: "objectValues";
277
+ pathPattern?: string;
278
+ })[]] | string)[];
279
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
280
+ match?: "strings";
281
+ } | {
282
+ match?: "objectKeys";
283
+ pathPattern?: string;
284
+ } | {
285
+ match?: "objectValues";
286
+ pathPattern?: string;
287
+ })[]] | string)[];
288
+ entryPoint?: string;
289
+ tailwindConfig?: string;
290
+ tsconfig?: string;
291
+ }];
292
+ // ----- tw/multiline -----
293
+ type TwMultiline = [] | [{
294
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
295
+ match?: "strings";
296
+ } | {
297
+ match?: "objectKeys";
298
+ pathPattern?: string;
299
+ } | {
300
+ match?: "objectValues";
301
+ pathPattern?: string;
302
+ })[]] | string)[];
303
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
304
+ match?: "strings";
305
+ } | {
306
+ match?: "objectKeys";
307
+ pathPattern?: string;
308
+ } | {
309
+ match?: "objectValues";
310
+ pathPattern?: string;
311
+ })[]])[];
312
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
313
+ match?: "strings";
314
+ } | {
315
+ match?: "objectKeys";
316
+ pathPattern?: string;
317
+ } | {
318
+ match?: "objectValues";
319
+ pathPattern?: string;
320
+ })[]] | string)[];
321
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
322
+ match?: "strings";
323
+ } | {
324
+ match?: "objectKeys";
325
+ pathPattern?: string;
326
+ } | {
327
+ match?: "objectValues";
328
+ pathPattern?: string;
329
+ })[]] | string)[];
330
+ entryPoint?: string;
331
+ tailwindConfig?: string;
332
+ tsconfig?: string;
333
+ classesPerLine?: number;
334
+ group?: ("emptyLine" | "never" | "newLine");
335
+ indent?: ("tab" | number);
336
+ lineBreakStyle?: ("unix" | "windows");
337
+ preferSingleLine?: boolean;
338
+ printWidth?: number;
339
+ }];
340
+ // ----- tw/no-conflicting-classes -----
341
+ type TwNoConflictingClasses = [] | [{
342
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
343
+ match?: "strings";
344
+ } | {
345
+ match?: "objectKeys";
346
+ pathPattern?: string;
347
+ } | {
348
+ match?: "objectValues";
349
+ pathPattern?: string;
350
+ })[]] | string)[];
351
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
352
+ match?: "strings";
353
+ } | {
354
+ match?: "objectKeys";
355
+ pathPattern?: string;
356
+ } | {
357
+ match?: "objectValues";
358
+ pathPattern?: string;
359
+ })[]])[];
360
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
361
+ match?: "strings";
362
+ } | {
363
+ match?: "objectKeys";
364
+ pathPattern?: string;
365
+ } | {
366
+ match?: "objectValues";
367
+ pathPattern?: string;
368
+ })[]] | string)[];
369
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
370
+ match?: "strings";
371
+ } | {
372
+ match?: "objectKeys";
373
+ pathPattern?: string;
374
+ } | {
375
+ match?: "objectValues";
376
+ pathPattern?: string;
377
+ })[]] | string)[];
378
+ entryPoint?: string;
379
+ tailwindConfig?: string;
380
+ tsconfig?: string;
381
+ }];
382
+ // ----- tw/no-deprecated-classes -----
383
+ type TwNoDeprecatedClasses = [] | [{
384
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
385
+ match?: "strings";
386
+ } | {
387
+ match?: "objectKeys";
388
+ pathPattern?: string;
389
+ } | {
390
+ match?: "objectValues";
391
+ pathPattern?: string;
392
+ })[]] | string)[];
393
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
394
+ match?: "strings";
395
+ } | {
396
+ match?: "objectKeys";
397
+ pathPattern?: string;
398
+ } | {
399
+ match?: "objectValues";
400
+ pathPattern?: string;
401
+ })[]])[];
402
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
403
+ match?: "strings";
404
+ } | {
405
+ match?: "objectKeys";
406
+ pathPattern?: string;
407
+ } | {
408
+ match?: "objectValues";
409
+ pathPattern?: string;
410
+ })[]] | string)[];
411
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
412
+ match?: "strings";
413
+ } | {
414
+ match?: "objectKeys";
415
+ pathPattern?: string;
416
+ } | {
417
+ match?: "objectValues";
418
+ pathPattern?: string;
419
+ })[]] | string)[];
420
+ entryPoint?: string;
421
+ tailwindConfig?: string;
422
+ tsconfig?: string;
423
+ }];
424
+ // ----- tw/no-duplicate-classes -----
425
+ type TwNoDuplicateClasses = [] | [{
426
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
427
+ match?: "strings";
428
+ } | {
429
+ match?: "objectKeys";
430
+ pathPattern?: string;
431
+ } | {
432
+ match?: "objectValues";
433
+ pathPattern?: string;
434
+ })[]] | string)[];
435
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
436
+ match?: "strings";
437
+ } | {
438
+ match?: "objectKeys";
439
+ pathPattern?: string;
440
+ } | {
441
+ match?: "objectValues";
442
+ pathPattern?: string;
443
+ })[]])[];
444
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
445
+ match?: "strings";
446
+ } | {
447
+ match?: "objectKeys";
448
+ pathPattern?: string;
449
+ } | {
450
+ match?: "objectValues";
451
+ pathPattern?: string;
452
+ })[]] | string)[];
453
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
454
+ match?: "strings";
455
+ } | {
456
+ match?: "objectKeys";
457
+ pathPattern?: string;
458
+ } | {
459
+ match?: "objectValues";
460
+ pathPattern?: string;
461
+ })[]] | string)[];
462
+ }];
463
+ // ----- tw/no-restricted-classes -----
464
+ type TwNoRestrictedClasses = [] | [{
465
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
466
+ match?: "strings";
467
+ } | {
468
+ match?: "objectKeys";
469
+ pathPattern?: string;
470
+ } | {
471
+ match?: "objectValues";
472
+ pathPattern?: string;
473
+ })[]] | string)[];
474
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
475
+ match?: "strings";
476
+ } | {
477
+ match?: "objectKeys";
478
+ pathPattern?: string;
479
+ } | {
480
+ match?: "objectValues";
481
+ pathPattern?: string;
482
+ })[]])[];
483
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
484
+ match?: "strings";
485
+ } | {
486
+ match?: "objectKeys";
487
+ pathPattern?: string;
488
+ } | {
489
+ match?: "objectValues";
490
+ pathPattern?: string;
491
+ })[]] | string)[];
492
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
493
+ match?: "strings";
494
+ } | {
495
+ match?: "objectKeys";
496
+ pathPattern?: string;
497
+ } | {
498
+ match?: "objectValues";
499
+ pathPattern?: string;
500
+ })[]] | string)[];
501
+ restrict?: ({
502
+ fix?: string;
503
+ message?: string;
504
+ pattern: string;
505
+ } | string)[];
506
+ }];
507
+ // ----- tw/no-unnecessary-whitespace -----
508
+ type TwNoUnnecessaryWhitespace = [] | [{
509
+ allowMultiline?: boolean;
510
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
511
+ match?: "strings";
512
+ } | {
513
+ match?: "objectKeys";
514
+ pathPattern?: string;
515
+ } | {
516
+ match?: "objectValues";
517
+ pathPattern?: string;
518
+ })[]] | string)[];
519
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
520
+ match?: "strings";
521
+ } | {
522
+ match?: "objectKeys";
523
+ pathPattern?: string;
524
+ } | {
525
+ match?: "objectValues";
526
+ pathPattern?: string;
527
+ })[]])[];
528
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
529
+ match?: "strings";
530
+ } | {
531
+ match?: "objectKeys";
532
+ pathPattern?: string;
533
+ } | {
534
+ match?: "objectValues";
535
+ pathPattern?: string;
536
+ })[]] | string)[];
537
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
538
+ match?: "strings";
539
+ } | {
540
+ match?: "objectKeys";
541
+ pathPattern?: string;
542
+ } | {
543
+ match?: "objectValues";
544
+ pathPattern?: string;
545
+ })[]] | string)[];
546
+ }];
547
+ // ----- tw/no-unregistered-classes -----
548
+ type TwNoUnregisteredClasses = [] | [{
549
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
550
+ match?: "strings";
551
+ } | {
552
+ match?: "objectKeys";
553
+ pathPattern?: string;
554
+ } | {
555
+ match?: "objectValues";
556
+ pathPattern?: string;
557
+ })[]] | string)[];
558
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
559
+ match?: "strings";
560
+ } | {
561
+ match?: "objectKeys";
562
+ pathPattern?: string;
563
+ } | {
564
+ match?: "objectValues";
565
+ pathPattern?: string;
566
+ })[]])[];
567
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
568
+ match?: "strings";
569
+ } | {
570
+ match?: "objectKeys";
571
+ pathPattern?: string;
572
+ } | {
573
+ match?: "objectValues";
574
+ pathPattern?: string;
575
+ })[]] | string)[];
576
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
577
+ match?: "strings";
578
+ } | {
579
+ match?: "objectKeys";
580
+ pathPattern?: string;
581
+ } | {
582
+ match?: "objectValues";
583
+ pathPattern?: string;
584
+ })[]] | string)[];
585
+ entryPoint?: string;
586
+ tailwindConfig?: string;
587
+ tsconfig?: string;
588
+ detectComponentClasses?: boolean;
589
+ ignore?: string[];
590
+ }];
591
+ // ----- tw/sort-classes -----
592
+ type TwSortClasses = [] | [{
593
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
594
+ match?: "strings";
595
+ } | {
596
+ match?: "objectKeys";
597
+ pathPattern?: string;
598
+ } | {
599
+ match?: "objectValues";
600
+ pathPattern?: string;
601
+ })[]] | string)[];
602
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
603
+ match?: "strings";
604
+ } | {
605
+ match?: "objectKeys";
606
+ pathPattern?: string;
607
+ } | {
608
+ match?: "objectValues";
609
+ pathPattern?: string;
610
+ })[]])[];
611
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
612
+ match?: "strings";
613
+ } | {
614
+ match?: "objectKeys";
615
+ pathPattern?: string;
616
+ } | {
617
+ match?: "objectValues";
618
+ pathPattern?: string;
619
+ })[]] | string)[];
620
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
621
+ match?: "strings";
622
+ } | {
623
+ match?: "objectKeys";
624
+ pathPattern?: string;
625
+ } | {
626
+ match?: "objectValues";
627
+ pathPattern?: string;
628
+ })[]] | string)[];
629
+ entryPoint?: string;
630
+ tailwindConfig?: string;
631
+ tsconfig?: string;
632
+ order?: ("asc" | "desc" | "official" | "improved");
633
+ }];
138
634
  // Names of all the configs
139
- type ConfigNames$1 = 'wongxy/tailwindcss'
140
-
141
- interface OptionsOverrides {
142
- overrides?: TypedFlatConfigItem['rules'];
143
- }
144
- type ConfigNames = ConfigNames$2 & ConfigNames$1;
145
- type TypedFlatConfigItem = TypedFlatConfigItem$1 & MyTypedFlatConfigItem;
146
- interface MyRules extends RuleOptions {
147
- }
148
- interface Rules extends MyRules, Rules$1 {
149
- }
150
- type MyTypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plugins'> & {
151
- plugins?: Record<string, any>;
635
+ //#endregion
636
+ //#region src/types.d.ts
637
+ type Options = Parameters<typeof antfu>[0] & {
638
+ /**
639
+ * Enable Tailwind rules.
640
+ *
641
+ * @default auto-detect based on the dependencies
642
+ */
643
+ tailwindcss?: boolean | OptionsTailwindCSS;
644
+ /**
645
+ * Enable React Native support.
646
+ *
647
+ * Will enable `react` support automatically.
648
+ *
649
+ * @default auto-detect based on the dependencies
650
+ */
651
+ reactnative?: boolean;
652
+ /**
653
+ * Enable react rules.
654
+ *
655
+ * @default auto-detect based on the dependencies
656
+ */
657
+ react?: boolean | OptionsOverrides;
658
+ };
659
+ type UserConfig = Parameters<typeof antfu>[1] & {
660
+ rules?: RuleOptions;
152
661
  };
153
- interface OptionsConfig extends OptionsConfig$1 {
154
- /**
155
- * Enable Tailwind rules.
156
- *
157
- * @default auto-detect based on the dependencies
158
- */
159
- tailwindcss?: boolean | OptionsOverrides;
160
- /**
161
- * Enable React Native support.
162
- *
163
- * Will enable `react` support automatically.
164
- *
165
- * @default auto-detect based on the dependencies
166
- */
167
- reactnative?: boolean;
168
- /**
169
- * Enable react rules.
170
- *
171
- * @default auto-detect based on the dependencies
172
- */
173
- react?: boolean | OptionsOverrides;
662
+ type OptionsReturn = ReturnType<typeof antfu>;
663
+ type PickKeysByPrefix<T extends object, P extends string> = { [K in keyof T as K extends `${P}${string}` ? K : never]: T[K] };
664
+ type RuleOptionsTailwindCSS = PickKeysByPrefix<RuleOptions, 'tw/'>;
665
+ interface OptionsTailwindCSS {
666
+ overrides?: Partial<RuleOptionsTailwindCSS>;
667
+ settings?: {
668
+ entryPoint?: string;
669
+ tailwindConfig?: string;
670
+ attributes?: string[];
671
+ callees?: string[];
672
+ variables?: string[];
673
+ tags?: string[];
674
+ };
174
675
  }
175
-
176
- declare function tailwindcss(options?: OptionsOverrides$1): Promise<TypedFlatConfigItem$1[]>;
177
-
178
- declare function wongxy(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
179
-
180
- export { type ConfigNames, type MyTypedFlatConfigItem, type OptionsConfig, type TypedFlatConfigItem, wongxy as default, tailwindcss };
676
+ //#endregion
677
+ //#region src/index.d.ts
678
+ declare function wongxy(options?: Options, ...userConfigs: UserConfig[]): OptionsReturn;
679
+ export = wongxy;