@wongxy/eslint-config 2.0.1 → 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,162 +1,646 @@
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
24
+ */
25
+ 'tw/enforce-consistent-variable-syntax'?: Linter.RuleEntry<TwEnforceConsistentVariableSyntax>;
26
+ /**
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
13
29
  */
14
- 'tw/classnames-order'?: Linter.RuleEntry<TwClassnamesOrder>;
30
+ 'tw/enforce-shorthand-classes'?: Linter.RuleEntry<TwEnforceShorthandClasses>;
15
31
  /**
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
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
18
35
  */
19
- 'tw/enforces-negative-arbitrary-values'?: Linter.RuleEntry<TwEnforcesNegativeArbitraryValues>;
36
+ 'tw/multiline'?: Linter.RuleEntry<TwMultiline>;
20
37
  /**
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
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
23
40
  */
24
- 'tw/enforces-shorthand'?: Linter.RuleEntry<TwEnforcesShorthand>;
41
+ 'tw/no-conflicting-classes'?: Linter.RuleEntry<TwNoConflictingClasses>;
25
42
  /**
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
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
28
45
  */
29
- 'tw/migration-from-tailwind-2'?: Linter.RuleEntry<TwMigrationFromTailwind2>;
46
+ 'tw/no-deprecated-classes'?: Linter.RuleEntry<TwNoDeprecatedClasses>;
30
47
  /**
31
- * Forbid using arbitrary values in classnames
32
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-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
33
50
  */
34
- 'tw/no-arbitrary-value'?: Linter.RuleEntry<TwNoArbitraryValue>;
51
+ 'tw/no-duplicate-classes'?: Linter.RuleEntry<TwNoDuplicateClasses>;
35
52
  /**
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
53
+ * Disallow restricted classes.
54
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md
38
55
  */
39
- 'tw/no-contradicting-classname'?: Linter.RuleEntry<TwNoContradictingClassname>;
56
+ 'tw/no-restricted-classes'?: Linter.RuleEntry<TwNoRestrictedClasses>;
40
57
  /**
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
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
43
60
  */
44
- 'tw/no-custom-classname'?: Linter.RuleEntry<TwNoCustomClassname>;
61
+ 'tw/no-unnecessary-whitespace'?: Linter.RuleEntry<TwNoUnnecessaryWhitespace>;
45
62
  /**
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
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
48
65
  */
49
- 'tw/no-unnecessary-arbitrary-value'?: Linter.RuleEntry<TwNoUnnecessaryArbitraryValue>;
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
74
 
52
75
  /* ======= 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;
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");
63
161
  }];
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;
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;
73
209
  }];
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;
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");
83
249
  }];
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;
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;
93
291
  }];
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;
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;
103
339
  }];
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;
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;
113
381
  }];
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;
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;
126
423
  }];
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;
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");
136
633
  }];
137
634
  // 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 {
635
+ //#endregion
636
+ //#region src/types.d.ts
637
+ type Options = Parameters<typeof antfu>[0] & {
154
638
  /**
155
639
  * Enable Tailwind rules.
156
640
  *
157
641
  * @default auto-detect based on the dependencies
158
642
  */
159
- tailwindcss?: boolean | OptionsOverrides$1;
643
+ tailwindcss?: boolean | OptionsTailwindCSS;
160
644
  /**
161
645
  * Enable React Native support.
162
646
  *
@@ -170,14 +654,26 @@ interface OptionsConfig extends OptionsConfig$1 {
170
654
  *
171
655
  * @default auto-detect based on the dependencies
172
656
  */
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 };
657
+ react?: boolean | OptionsOverrides;
658
+ };
659
+ type UserConfig = Parameters<typeof antfu>[1] & {
660
+ rules?: RuleOptions;
661
+ };
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
+ };
180
675
  }
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
676
  //#endregion
183
- export { ConfigNames, MyTypedFlatConfigItem, OptionsConfig, TypedFlatConfigItem, wongxy as default, tailwindcss };
677
+ //#region src/index.d.ts
678
+ declare function wongxy(options?: Options, ...userConfigs: UserConfig[]): OptionsReturn;
679
+ export = wongxy;