@wongxy/eslint-config 2.0.1 → 3.0.1

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