@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.ts CHANGED
@@ -1,161 +1,646 @@
1
- import { __export, __reExport } from "./chunk-CHLpw0oG.js";
2
- import { ConfigNames as ConfigNames$1, OptionsConfig as OptionsConfig$1, Rules, TypedFlatConfigItem as TypedFlatConfigItem$1 } from "@antfu/eslint-config";
1
+ import { OptionsOverrides, antfu } from "@antfu/eslint-config";
3
2
  import { Linter } from "eslint";
4
- import { FlatConfigComposer } from "eslint-flat-config-utils";
5
- export * from "@antfu/eslint-config";
6
3
 
7
4
  //#region src/typegen.d.ts
8
5
  interface RuleOptions {
9
6
  /**
10
- * Enforce a consistent and logical order of the Tailwind CSS classnames
11
- * @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
12
9
  */
13
- 'tw/classnames-order'?: Linter.RuleEntry<TwClassnamesOrder>;
10
+ 'tw/enforce-consistent-class-order'?: Linter.RuleEntry<TwEnforceConsistentClassOrder>;
14
11
  /**
15
- * Warns about dash prefixed classnames using arbitrary values
16
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-negative-arbitrary-values.md
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
17
14
  */
18
- 'tw/enforces-negative-arbitrary-values'?: Linter.RuleEntry<TwEnforcesNegativeArbitraryValues>;
15
+ 'tw/enforce-consistent-important-position'?: Linter.RuleEntry<TwEnforceConsistentImportantPosition>;
19
16
  /**
20
- * Enforces the usage of shorthand Tailwind CSS classnames
21
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-shorthand.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
22
19
  */
23
- 'tw/enforces-shorthand'?: Linter.RuleEntry<TwEnforcesShorthand>;
20
+ 'tw/enforce-consistent-line-wrapping'?: Linter.RuleEntry<TwEnforceConsistentLineWrapping>;
24
21
  /**
25
- * Detect obsolete classnames when upgrading to Tailwind CSS v3
26
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/migration-from-tailwind-2.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
27
24
  */
28
- 'tw/migration-from-tailwind-2'?: Linter.RuleEntry<TwMigrationFromTailwind2>;
25
+ 'tw/enforce-consistent-variable-syntax'?: Linter.RuleEntry<TwEnforceConsistentVariableSyntax>;
29
26
  /**
30
- * Forbid using arbitrary values in classnames
31
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-arbitrary-value.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
32
29
  */
33
- 'tw/no-arbitrary-value'?: Linter.RuleEntry<TwNoArbitraryValue>;
30
+ 'tw/enforce-shorthand-classes'?: Linter.RuleEntry<TwEnforceShorthandClasses>;
34
31
  /**
35
- * Avoid contradicting Tailwind CSS classnames (e.g. "w-3 w-5")
36
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-contradicting-classname.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
37
35
  */
38
- 'tw/no-contradicting-classname'?: Linter.RuleEntry<TwNoContradictingClassname>;
36
+ 'tw/multiline'?: Linter.RuleEntry<TwMultiline>;
39
37
  /**
40
- * Detect classnames which do not belong to Tailwind CSS
41
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-custom-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
42
40
  */
43
- 'tw/no-custom-classname'?: Linter.RuleEntry<TwNoCustomClassname>;
41
+ 'tw/no-conflicting-classes'?: Linter.RuleEntry<TwNoConflictingClasses>;
44
42
  /**
45
- * Forbid using arbitrary values in classnames when an equivalent preset exists
46
- * @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-unnecessary-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
47
45
  */
48
- 'tw/no-unnecessary-arbitrary-value'?: Linter.RuleEntry<TwNoUnnecessaryArbitraryValue>;
46
+ 'tw/no-deprecated-classes'?: Linter.RuleEntry<TwNoDeprecatedClasses>;
47
+ /**
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
50
+ */
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>;
49
73
  }
50
74
 
51
75
  /* ======= Declarations ======= */
52
- // ----- tw/classnames-order -----
53
- type TwClassnamesOrder = [] | [{
54
- callees?: string[];
55
- ignoredKeys?: string[];
56
- config?: (string | {
57
- [k: string]: unknown | undefined;
58
- });
59
- removeDuplicates?: boolean;
60
- tags?: string[];
61
- [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");
62
161
  }];
63
- // ----- tw/enforces-negative-arbitrary-values -----
64
- type TwEnforcesNegativeArbitraryValues = [] | [{
65
- callees?: string[];
66
- ignoredKeys?: string[];
67
- config?: (string | {
68
- [k: string]: unknown | undefined;
69
- });
70
- tags?: string[];
71
- [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;
72
209
  }];
73
- // ----- tw/enforces-shorthand -----
74
- type TwEnforcesShorthand = [] | [{
75
- callees?: string[];
76
- ignoredKeys?: string[];
77
- config?: (string | {
78
- [k: string]: unknown | undefined;
79
- });
80
- tags?: string[];
81
- [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");
82
249
  }];
83
- // ----- tw/migration-from-tailwind-2 -----
84
- type TwMigrationFromTailwind2 = [] | [{
85
- callees?: string[];
86
- ignoredKeys?: string[];
87
- config?: (string | {
88
- [k: string]: unknown | undefined;
89
- });
90
- tags?: string[];
91
- [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;
92
291
  }];
93
- // ----- tw/no-arbitrary-value -----
94
- type TwNoArbitraryValue = [] | [{
95
- callees?: string[];
96
- ignoredKeys?: string[];
97
- config?: (string | {
98
- [k: string]: unknown | undefined;
99
- });
100
- tags?: string[];
101
- [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;
102
339
  }];
103
- // ----- tw/no-contradicting-classname -----
104
- type TwNoContradictingClassname = [] | [{
105
- callees?: string[];
106
- ignoredKeys?: string[];
107
- config?: (string | {
108
- [k: string]: unknown | undefined;
109
- });
110
- tags?: string[];
111
- [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;
112
381
  }];
113
- // ----- tw/no-custom-classname -----
114
- type TwNoCustomClassname = [] | [{
115
- callees?: string[];
116
- ignoredKeys?: string[];
117
- config?: (string | {
118
- [k: string]: unknown | undefined;
119
- });
120
- cssFiles?: string[];
121
- cssFilesRefreshRate?: number;
122
- tags?: string[];
123
- whitelist?: string[];
124
- [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;
125
423
  }];
126
- // ----- tw/no-unnecessary-arbitrary-value -----
127
- type TwNoUnnecessaryArbitraryValue = [] | [{
128
- callees?: string[];
129
- ignoredKeys?: string[];
130
- config?: (string | {
131
- [k: string]: unknown | undefined;
132
- });
133
- tags?: string[];
134
- [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");
135
633
  }];
136
634
  // Names of all the configs
137
- type ConfigNames$2 = 'wongxy/tailwindcss';
138
- declare namespace types_d_exports {
139
- export { ConfigNames, MyTypedFlatConfigItem, OptionsConfig, TypedFlatConfigItem };
140
- }
141
- import * as import___antfu_eslint_config from "@antfu/eslint-config";
142
- interface OptionsOverrides$1 {
143
- overrides?: TypedFlatConfigItem['rules'];
144
- }
145
- type ConfigNames = ConfigNames$1 & ConfigNames$2;
146
- type TypedFlatConfigItem = TypedFlatConfigItem$1 & MyTypedFlatConfigItem;
147
- interface MyRules extends RuleOptions {}
148
- interface Rules$1 extends MyRules, Rules {}
149
- type MyTypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules$1>, 'plugins'> & {
150
- plugins?: Record<string, any>;
151
- };
152
- interface OptionsConfig extends OptionsConfig$1 {
635
+ //#endregion
636
+ //#region src/types.d.ts
637
+ type Options = Parameters<typeof antfu>[0] & {
153
638
  /**
154
639
  * Enable Tailwind rules.
155
640
  *
156
641
  * @default auto-detect based on the dependencies
157
642
  */
158
- tailwindcss?: boolean | OptionsOverrides$1;
643
+ tailwindcss?: boolean | OptionsTailwindCSS;
159
644
  /**
160
645
  * Enable React Native support.
161
646
  *
@@ -169,14 +654,27 @@ interface OptionsConfig extends OptionsConfig$1 {
169
654
  *
170
655
  * @default auto-detect based on the dependencies
171
656
  */
172
- react?: boolean | OptionsOverrides$1;
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
+ };
173
675
  }
174
676
  //#endregion
175
- //#region src/tailwindcss.d.ts
176
- declare function tailwindcss(options?: types_d_exports.OptionsOverrides): Promise<TypedFlatConfigItem$1[]>;
177
- declare namespace index_d_exports {
178
- export { ConfigNames, MyTypedFlatConfigItem, OptionsConfig, TypedFlatConfigItem, wongxy as default, tailwindcss };
179
- }
180
- declare function wongxy(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>, ...userConfigs: types_d_exports.Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
677
+ //#region src/index.d.ts
678
+ declare function wongxy(options?: Options, ...userConfigs: UserConfig[]): OptionsReturn;
181
679
  //#endregion
182
- export { ConfigNames, MyTypedFlatConfigItem, OptionsConfig, TypedFlatConfigItem, wongxy as default, tailwindcss };
680
+ export { wongxy as default };