@ghettoddos/eslint-config 3.0.1 → 3.1.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/README.md CHANGED
@@ -8,6 +8,7 @@
8
8
  - Opinionated, but [very customizable](#customization)
9
9
  - [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
10
10
  - Optional [UnoCSS](#unocss) support
11
+ - Optional [TailwindCSS](#tailwindcss) support
11
12
  - Optional [formatters](#formatters) support for formatting CSS, HTML, XML, etc.
12
13
  - **Style principle**: Minimal for reading, stable for diff, consistent
13
14
  - Sorted imports, dangling commas
@@ -93,6 +94,7 @@ Add the following settings to your `.vscode/settings.json`:
93
94
  "javascriptreact",
94
95
  "typescript",
95
96
  "typescriptreact",
97
+ "vue",
96
98
  "html",
97
99
  "markdown",
98
100
  "json",
@@ -100,6 +102,10 @@ Add the following settings to your `.vscode/settings.json`:
100
102
  "yaml",
101
103
  "toml",
102
104
  "xml",
105
+ "gql",
106
+ "graphql",
107
+ "astro",
108
+ "svelte",
103
109
  "css",
104
110
  "less",
105
111
  "scss",
@@ -301,16 +307,17 @@ Check out the [configs](https://github.com/ghettoDdOS/eslint-config/blob/master/
301
307
 
302
308
  Since flat config requires us to explicitly provide the plugin names (instead of the mandatory convention from npm package name), we renamed some plugins to make the overall scope more consistent and easier to write.
303
309
 
304
- | New Prefix | Original Prefix | Source Plugin |
305
- | ---------- | ---------------------- | ----------------------------------------------------------------------------------------------------- |
306
- | `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite) |
307
- | `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
308
- | `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
309
- | `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
310
- | `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
311
- | `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
312
- | `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests) |
313
- | `next/*` | `@next/next` | [@next/eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
310
+ | New Prefix | Original Prefix | Source Plugin |
311
+ | --------------- | ---------------------- | ----------------------------------------------------------------------------------------------------- |
312
+ | `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite) |
313
+ | `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
314
+ | `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
315
+ | `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
316
+ | `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
317
+ | `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
318
+ | `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests) |
319
+ | `next/*` | `@next/next` | [@next/eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
320
+ | `tailwindcss/*` | `better-tailwindcss` | [eslint-plugin-better-tailwindcss](https://github.com/schoero/eslint-plugin-better-tailwindcss) |
314
321
 
315
322
  When you want to override rules, or disable them inline, you need to update to the new prefix:
316
323
 
@@ -481,12 +488,63 @@ export default config({
481
488
  })
482
489
  ```
483
490
 
491
+ #### TailwindCSS
492
+
493
+ To enable TailwindCSS support, you need to explicitly turn it on:
494
+
495
+ ```js
496
+ // eslint.config.js
497
+ import config from '@ghettoddos/eslint-config'
498
+
499
+ export default config({
500
+ tailwindcss: true,
501
+ })
502
+ ```
503
+
484
504
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
485
505
 
486
506
  ```bash
487
- npm i -D @unocss/eslint-plugin
507
+ npm i -D eslint-plugin-better-tailwindcss
508
+ ```
509
+
510
+ ### Optional Rules
511
+
512
+ This config also provides some optional plugins/rules for extended usage.
513
+
514
+ #### `command`
515
+
516
+ Powered by [`eslint-plugin-command`](https://github.com/antfu/eslint-plugin-command). It is not a typical rule for linting, but an on-demand micro-codemod tool that triggers by specific comments.
517
+
518
+ For a few triggers, for example:
519
+
520
+ - `/// to-function` - converts an arrow function to a normal function
521
+ - `/// to-arrow` - converts a normal function to an arrow function
522
+ - `/// to-for-each` - converts a for-in/for-of loop to `.forEach()`
523
+ - `/// to-for-of` - converts a `.forEach()` to a for-of loop
524
+ - `/// keep-sorted` - sorts an object/array/interface
525
+ - ... etc. - refer to the [documentation](https://github.com/antfu/eslint-plugin-command#built-in-commands)
526
+
527
+ You can add the trigger comment one line above the code you want to transform, for example (note the triple slash):
528
+
529
+ <!-- eslint-skip -->
530
+
531
+ ```ts
532
+ /// to-function
533
+ const foo = async (msg: string): void => {
534
+ console.log(msg)
535
+ }
488
536
  ```
489
537
 
538
+ Will be transformed to this when you hit save with your editor or run `eslint --fix`:
539
+
540
+ ```ts
541
+ async function foo(msg: string): void {
542
+ console.log(msg)
543
+ }
544
+ ```
545
+
546
+ The command comments are usually one-off and will be removed along with the transformation.
547
+
490
548
  ### Type Aware Rules
491
549
 
492
550
  You can optionally enable the [type aware rules](https://typescript-eslint.io/linting/typed-linting/) by passing the options object to the `typescript` config:
package/dist/index.d.ts CHANGED
@@ -163,6 +163,11 @@ interface RuleOptions {
163
163
  * @deprecated
164
164
  */
165
165
  'comma-style'?: Linter.RuleEntry<CommaStyle>;
166
+ /**
167
+ * Comment-as-command for one-off codemod with ESLint
168
+ * @see https://github.com/antfu/eslint-plugin-command
169
+ */
170
+ 'command/command'?: Linter.RuleEntry<[]>;
166
171
  /**
167
172
  * Enforce a maximum cyclomatic complexity allowed in a program
168
173
  * @see https://eslint.org/docs/latest/rules/complexity
@@ -4601,6 +4606,73 @@ interface RuleOptions {
4601
4606
  * @see https://eslint.org/docs/latest/rules/symbol-description
4602
4607
  */
4603
4608
  'symbol-description'?: Linter.RuleEntry<[]>;
4609
+ /**
4610
+ * Enforce a consistent order for tailwind classes.
4611
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md
4612
+ */
4613
+ 'tailwindcss/enforce-consistent-class-order'?: Linter.RuleEntry<TailwindcssEnforceConsistentClassOrder>;
4614
+ /**
4615
+ * Enforce consistent important position for classes.
4616
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-important-position.md
4617
+ */
4618
+ 'tailwindcss/enforce-consistent-important-position'?: Linter.RuleEntry<TailwindcssEnforceConsistentImportantPosition>;
4619
+ /**
4620
+ * Enforce consistent line wrapping for tailwind classes.
4621
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-line-wrapping.md
4622
+ */
4623
+ 'tailwindcss/enforce-consistent-line-wrapping'?: Linter.RuleEntry<TailwindcssEnforceConsistentLineWrapping>;
4624
+ /**
4625
+ * Enforce consistent syntax for css variables.
4626
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-variable-syntax.md
4627
+ */
4628
+ 'tailwindcss/enforce-consistent-variable-syntax'?: Linter.RuleEntry<TailwindcssEnforceConsistentVariableSyntax>;
4629
+ /**
4630
+ * Enforce shorthand class names instead of longhand class names.
4631
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-shorthand-classes.md
4632
+ */
4633
+ 'tailwindcss/enforce-shorthand-classes'?: Linter.RuleEntry<TailwindcssEnforceShorthandClasses>;
4634
+ /**
4635
+ * Enforce consistent line wrapping for tailwind classes.
4636
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-line-wrapping.md
4637
+ * @deprecated
4638
+ */
4639
+ 'tailwindcss/multiline'?: Linter.RuleEntry<TailwindcssMultiline>;
4640
+ /**
4641
+ * Disallow classes that produce conflicting styles.
4642
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-conflicting-classes.md
4643
+ */
4644
+ 'tailwindcss/no-conflicting-classes'?: Linter.RuleEntry<TailwindcssNoConflictingClasses>;
4645
+ /**
4646
+ * Disallow the use of deprecated Tailwind CSS classes.
4647
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-deprecated-classes.md
4648
+ */
4649
+ 'tailwindcss/no-deprecated-classes'?: Linter.RuleEntry<TailwindcssNoDeprecatedClasses>;
4650
+ /**
4651
+ * Disallow duplicate class names in tailwind classes.
4652
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-duplicate-classes.md
4653
+ */
4654
+ 'tailwindcss/no-duplicate-classes'?: Linter.RuleEntry<TailwindcssNoDuplicateClasses>;
4655
+ /**
4656
+ * Disallow restricted classes.
4657
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md
4658
+ */
4659
+ 'tailwindcss/no-restricted-classes'?: Linter.RuleEntry<TailwindcssNoRestrictedClasses>;
4660
+ /**
4661
+ * Disallow unnecessary whitespace between Tailwind CSS classes.
4662
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md
4663
+ */
4664
+ 'tailwindcss/no-unnecessary-whitespace'?: Linter.RuleEntry<TailwindcssNoUnnecessaryWhitespace>;
4665
+ /**
4666
+ * Disallow any css classes that are not registered in tailwindcss.
4667
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unregistered-classes.md
4668
+ */
4669
+ 'tailwindcss/no-unregistered-classes'?: Linter.RuleEntry<TailwindcssNoUnregisteredClasses>;
4670
+ /**
4671
+ * Enforce a consistent order for tailwind classes.
4672
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md
4673
+ * @deprecated
4674
+ */
4675
+ 'tailwindcss/sort-classes'?: Linter.RuleEntry<TailwindcssSortClasses>;
4604
4676
  /**
4605
4677
  * Require or disallow spacing around embedded expressions of template strings
4606
4678
  * @see https://eslint.org/docs/latest/rules/template-curly-spacing
@@ -14228,6 +14300,564 @@ type SwitchColonSpacing = [] | [{
14228
14300
  before?: boolean;
14229
14301
  after?: boolean;
14230
14302
  }];
14303
+ // ----- tailwindcss/enforce-consistent-class-order -----
14304
+ type TailwindcssEnforceConsistentClassOrder = [] | [{
14305
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14306
+ match?: "strings";
14307
+ } | {
14308
+ match?: "objectKeys";
14309
+ pathPattern?: string;
14310
+ } | {
14311
+ match?: "objectValues";
14312
+ pathPattern?: string;
14313
+ })[]] | string)[];
14314
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14315
+ match?: "strings";
14316
+ } | {
14317
+ match?: "objectKeys";
14318
+ pathPattern?: string;
14319
+ } | {
14320
+ match?: "objectValues";
14321
+ pathPattern?: string;
14322
+ })[]])[];
14323
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14324
+ match?: "strings";
14325
+ } | {
14326
+ match?: "objectKeys";
14327
+ pathPattern?: string;
14328
+ } | {
14329
+ match?: "objectValues";
14330
+ pathPattern?: string;
14331
+ })[]] | string)[];
14332
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14333
+ match?: "strings";
14334
+ } | {
14335
+ match?: "objectKeys";
14336
+ pathPattern?: string;
14337
+ } | {
14338
+ match?: "objectValues";
14339
+ pathPattern?: string;
14340
+ })[]] | string)[];
14341
+ entryPoint?: string;
14342
+ tailwindConfig?: string;
14343
+ tsconfig?: string;
14344
+ order?: ("asc" | "desc" | "official" | "improved");
14345
+ }];
14346
+ // ----- tailwindcss/enforce-consistent-important-position -----
14347
+ type TailwindcssEnforceConsistentImportantPosition = [] | [{
14348
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14349
+ match?: "strings";
14350
+ } | {
14351
+ match?: "objectKeys";
14352
+ pathPattern?: string;
14353
+ } | {
14354
+ match?: "objectValues";
14355
+ pathPattern?: string;
14356
+ })[]] | string)[];
14357
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14358
+ match?: "strings";
14359
+ } | {
14360
+ match?: "objectKeys";
14361
+ pathPattern?: string;
14362
+ } | {
14363
+ match?: "objectValues";
14364
+ pathPattern?: string;
14365
+ })[]])[];
14366
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14367
+ match?: "strings";
14368
+ } | {
14369
+ match?: "objectKeys";
14370
+ pathPattern?: string;
14371
+ } | {
14372
+ match?: "objectValues";
14373
+ pathPattern?: string;
14374
+ })[]] | string)[];
14375
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14376
+ match?: "strings";
14377
+ } | {
14378
+ match?: "objectKeys";
14379
+ pathPattern?: string;
14380
+ } | {
14381
+ match?: "objectValues";
14382
+ pathPattern?: string;
14383
+ })[]] | string)[];
14384
+ entryPoint?: string;
14385
+ tailwindConfig?: string;
14386
+ tsconfig?: string;
14387
+ position?: ("legacy" | "recommended");
14388
+ }];
14389
+ // ----- tailwindcss/enforce-consistent-line-wrapping -----
14390
+ type TailwindcssEnforceConsistentLineWrapping = [] | [{
14391
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14392
+ match?: "strings";
14393
+ } | {
14394
+ match?: "objectKeys";
14395
+ pathPattern?: string;
14396
+ } | {
14397
+ match?: "objectValues";
14398
+ pathPattern?: string;
14399
+ })[]] | string)[];
14400
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14401
+ match?: "strings";
14402
+ } | {
14403
+ match?: "objectKeys";
14404
+ pathPattern?: string;
14405
+ } | {
14406
+ match?: "objectValues";
14407
+ pathPattern?: string;
14408
+ })[]])[];
14409
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14410
+ match?: "strings";
14411
+ } | {
14412
+ match?: "objectKeys";
14413
+ pathPattern?: string;
14414
+ } | {
14415
+ match?: "objectValues";
14416
+ pathPattern?: string;
14417
+ })[]] | string)[];
14418
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14419
+ match?: "strings";
14420
+ } | {
14421
+ match?: "objectKeys";
14422
+ pathPattern?: string;
14423
+ } | {
14424
+ match?: "objectValues";
14425
+ pathPattern?: string;
14426
+ })[]] | string)[];
14427
+ entryPoint?: string;
14428
+ tailwindConfig?: string;
14429
+ tsconfig?: string;
14430
+ classesPerLine?: number;
14431
+ group?: ("emptyLine" | "never" | "newLine");
14432
+ indent?: ("tab" | number);
14433
+ lineBreakStyle?: ("unix" | "windows");
14434
+ preferSingleLine?: boolean;
14435
+ printWidth?: number;
14436
+ }];
14437
+ // ----- tailwindcss/enforce-consistent-variable-syntax -----
14438
+ type TailwindcssEnforceConsistentVariableSyntax = [] | [{
14439
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14440
+ match?: "strings";
14441
+ } | {
14442
+ match?: "objectKeys";
14443
+ pathPattern?: string;
14444
+ } | {
14445
+ match?: "objectValues";
14446
+ pathPattern?: string;
14447
+ })[]] | string)[];
14448
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14449
+ match?: "strings";
14450
+ } | {
14451
+ match?: "objectKeys";
14452
+ pathPattern?: string;
14453
+ } | {
14454
+ match?: "objectValues";
14455
+ pathPattern?: string;
14456
+ })[]])[];
14457
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14458
+ match?: "strings";
14459
+ } | {
14460
+ match?: "objectKeys";
14461
+ pathPattern?: string;
14462
+ } | {
14463
+ match?: "objectValues";
14464
+ pathPattern?: string;
14465
+ })[]] | string)[];
14466
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14467
+ match?: "strings";
14468
+ } | {
14469
+ match?: "objectKeys";
14470
+ pathPattern?: string;
14471
+ } | {
14472
+ match?: "objectValues";
14473
+ pathPattern?: string;
14474
+ })[]] | string)[];
14475
+ syntax?: ("arbitrary" | "parentheses" | "shorthand" | "variable");
14476
+ }];
14477
+ // ----- tailwindcss/enforce-shorthand-classes -----
14478
+ type TailwindcssEnforceShorthandClasses = [] | [{
14479
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14480
+ match?: "strings";
14481
+ } | {
14482
+ match?: "objectKeys";
14483
+ pathPattern?: string;
14484
+ } | {
14485
+ match?: "objectValues";
14486
+ pathPattern?: string;
14487
+ })[]] | string)[];
14488
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14489
+ match?: "strings";
14490
+ } | {
14491
+ match?: "objectKeys";
14492
+ pathPattern?: string;
14493
+ } | {
14494
+ match?: "objectValues";
14495
+ pathPattern?: string;
14496
+ })[]])[];
14497
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14498
+ match?: "strings";
14499
+ } | {
14500
+ match?: "objectKeys";
14501
+ pathPattern?: string;
14502
+ } | {
14503
+ match?: "objectValues";
14504
+ pathPattern?: string;
14505
+ })[]] | string)[];
14506
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14507
+ match?: "strings";
14508
+ } | {
14509
+ match?: "objectKeys";
14510
+ pathPattern?: string;
14511
+ } | {
14512
+ match?: "objectValues";
14513
+ pathPattern?: string;
14514
+ })[]] | string)[];
14515
+ entryPoint?: string;
14516
+ tailwindConfig?: string;
14517
+ tsconfig?: string;
14518
+ }];
14519
+ // ----- tailwindcss/multiline -----
14520
+ type TailwindcssMultiline = [] | [{
14521
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14522
+ match?: "strings";
14523
+ } | {
14524
+ match?: "objectKeys";
14525
+ pathPattern?: string;
14526
+ } | {
14527
+ match?: "objectValues";
14528
+ pathPattern?: string;
14529
+ })[]] | string)[];
14530
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14531
+ match?: "strings";
14532
+ } | {
14533
+ match?: "objectKeys";
14534
+ pathPattern?: string;
14535
+ } | {
14536
+ match?: "objectValues";
14537
+ pathPattern?: string;
14538
+ })[]])[];
14539
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14540
+ match?: "strings";
14541
+ } | {
14542
+ match?: "objectKeys";
14543
+ pathPattern?: string;
14544
+ } | {
14545
+ match?: "objectValues";
14546
+ pathPattern?: string;
14547
+ })[]] | string)[];
14548
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14549
+ match?: "strings";
14550
+ } | {
14551
+ match?: "objectKeys";
14552
+ pathPattern?: string;
14553
+ } | {
14554
+ match?: "objectValues";
14555
+ pathPattern?: string;
14556
+ })[]] | string)[];
14557
+ entryPoint?: string;
14558
+ tailwindConfig?: string;
14559
+ tsconfig?: string;
14560
+ classesPerLine?: number;
14561
+ group?: ("emptyLine" | "never" | "newLine");
14562
+ indent?: ("tab" | number);
14563
+ lineBreakStyle?: ("unix" | "windows");
14564
+ preferSingleLine?: boolean;
14565
+ printWidth?: number;
14566
+ }];
14567
+ // ----- tailwindcss/no-conflicting-classes -----
14568
+ type TailwindcssNoConflictingClasses = [] | [{
14569
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14570
+ match?: "strings";
14571
+ } | {
14572
+ match?: "objectKeys";
14573
+ pathPattern?: string;
14574
+ } | {
14575
+ match?: "objectValues";
14576
+ pathPattern?: string;
14577
+ })[]] | string)[];
14578
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14579
+ match?: "strings";
14580
+ } | {
14581
+ match?: "objectKeys";
14582
+ pathPattern?: string;
14583
+ } | {
14584
+ match?: "objectValues";
14585
+ pathPattern?: string;
14586
+ })[]])[];
14587
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14588
+ match?: "strings";
14589
+ } | {
14590
+ match?: "objectKeys";
14591
+ pathPattern?: string;
14592
+ } | {
14593
+ match?: "objectValues";
14594
+ pathPattern?: string;
14595
+ })[]] | string)[];
14596
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14597
+ match?: "strings";
14598
+ } | {
14599
+ match?: "objectKeys";
14600
+ pathPattern?: string;
14601
+ } | {
14602
+ match?: "objectValues";
14603
+ pathPattern?: string;
14604
+ })[]] | string)[];
14605
+ entryPoint?: string;
14606
+ tailwindConfig?: string;
14607
+ tsconfig?: string;
14608
+ }];
14609
+ // ----- tailwindcss/no-deprecated-classes -----
14610
+ type TailwindcssNoDeprecatedClasses = [] | [{
14611
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14612
+ match?: "strings";
14613
+ } | {
14614
+ match?: "objectKeys";
14615
+ pathPattern?: string;
14616
+ } | {
14617
+ match?: "objectValues";
14618
+ pathPattern?: string;
14619
+ })[]] | string)[];
14620
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14621
+ match?: "strings";
14622
+ } | {
14623
+ match?: "objectKeys";
14624
+ pathPattern?: string;
14625
+ } | {
14626
+ match?: "objectValues";
14627
+ pathPattern?: string;
14628
+ })[]])[];
14629
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14630
+ match?: "strings";
14631
+ } | {
14632
+ match?: "objectKeys";
14633
+ pathPattern?: string;
14634
+ } | {
14635
+ match?: "objectValues";
14636
+ pathPattern?: string;
14637
+ })[]] | string)[];
14638
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14639
+ match?: "strings";
14640
+ } | {
14641
+ match?: "objectKeys";
14642
+ pathPattern?: string;
14643
+ } | {
14644
+ match?: "objectValues";
14645
+ pathPattern?: string;
14646
+ })[]] | string)[];
14647
+ entryPoint?: string;
14648
+ tailwindConfig?: string;
14649
+ tsconfig?: string;
14650
+ }];
14651
+ // ----- tailwindcss/no-duplicate-classes -----
14652
+ type TailwindcssNoDuplicateClasses = [] | [{
14653
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14654
+ match?: "strings";
14655
+ } | {
14656
+ match?: "objectKeys";
14657
+ pathPattern?: string;
14658
+ } | {
14659
+ match?: "objectValues";
14660
+ pathPattern?: string;
14661
+ })[]] | string)[];
14662
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14663
+ match?: "strings";
14664
+ } | {
14665
+ match?: "objectKeys";
14666
+ pathPattern?: string;
14667
+ } | {
14668
+ match?: "objectValues";
14669
+ pathPattern?: string;
14670
+ })[]])[];
14671
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14672
+ match?: "strings";
14673
+ } | {
14674
+ match?: "objectKeys";
14675
+ pathPattern?: string;
14676
+ } | {
14677
+ match?: "objectValues";
14678
+ pathPattern?: string;
14679
+ })[]] | string)[];
14680
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14681
+ match?: "strings";
14682
+ } | {
14683
+ match?: "objectKeys";
14684
+ pathPattern?: string;
14685
+ } | {
14686
+ match?: "objectValues";
14687
+ pathPattern?: string;
14688
+ })[]] | string)[];
14689
+ }];
14690
+ // ----- tailwindcss/no-restricted-classes -----
14691
+ type TailwindcssNoRestrictedClasses = [] | [{
14692
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14693
+ match?: "strings";
14694
+ } | {
14695
+ match?: "objectKeys";
14696
+ pathPattern?: string;
14697
+ } | {
14698
+ match?: "objectValues";
14699
+ pathPattern?: string;
14700
+ })[]] | string)[];
14701
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14702
+ match?: "strings";
14703
+ } | {
14704
+ match?: "objectKeys";
14705
+ pathPattern?: string;
14706
+ } | {
14707
+ match?: "objectValues";
14708
+ pathPattern?: string;
14709
+ })[]])[];
14710
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14711
+ match?: "strings";
14712
+ } | {
14713
+ match?: "objectKeys";
14714
+ pathPattern?: string;
14715
+ } | {
14716
+ match?: "objectValues";
14717
+ pathPattern?: string;
14718
+ })[]] | string)[];
14719
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14720
+ match?: "strings";
14721
+ } | {
14722
+ match?: "objectKeys";
14723
+ pathPattern?: string;
14724
+ } | {
14725
+ match?: "objectValues";
14726
+ pathPattern?: string;
14727
+ })[]] | string)[];
14728
+ restrict?: ({
14729
+ fix?: string;
14730
+ message?: string;
14731
+ pattern: string;
14732
+ } | string)[];
14733
+ }];
14734
+ // ----- tailwindcss/no-unnecessary-whitespace -----
14735
+ type TailwindcssNoUnnecessaryWhitespace = [] | [{
14736
+ allowMultiline?: boolean;
14737
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14738
+ match?: "strings";
14739
+ } | {
14740
+ match?: "objectKeys";
14741
+ pathPattern?: string;
14742
+ } | {
14743
+ match?: "objectValues";
14744
+ pathPattern?: string;
14745
+ })[]] | string)[];
14746
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14747
+ match?: "strings";
14748
+ } | {
14749
+ match?: "objectKeys";
14750
+ pathPattern?: string;
14751
+ } | {
14752
+ match?: "objectValues";
14753
+ pathPattern?: string;
14754
+ })[]])[];
14755
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14756
+ match?: "strings";
14757
+ } | {
14758
+ match?: "objectKeys";
14759
+ pathPattern?: string;
14760
+ } | {
14761
+ match?: "objectValues";
14762
+ pathPattern?: string;
14763
+ })[]] | string)[];
14764
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14765
+ match?: "strings";
14766
+ } | {
14767
+ match?: "objectKeys";
14768
+ pathPattern?: string;
14769
+ } | {
14770
+ match?: "objectValues";
14771
+ pathPattern?: string;
14772
+ })[]] | string)[];
14773
+ }];
14774
+ // ----- tailwindcss/no-unregistered-classes -----
14775
+ type TailwindcssNoUnregisteredClasses = [] | [{
14776
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14777
+ match?: "strings";
14778
+ } | {
14779
+ match?: "objectKeys";
14780
+ pathPattern?: string;
14781
+ } | {
14782
+ match?: "objectValues";
14783
+ pathPattern?: string;
14784
+ })[]] | string)[];
14785
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14786
+ match?: "strings";
14787
+ } | {
14788
+ match?: "objectKeys";
14789
+ pathPattern?: string;
14790
+ } | {
14791
+ match?: "objectValues";
14792
+ pathPattern?: string;
14793
+ })[]])[];
14794
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14795
+ match?: "strings";
14796
+ } | {
14797
+ match?: "objectKeys";
14798
+ pathPattern?: string;
14799
+ } | {
14800
+ match?: "objectValues";
14801
+ pathPattern?: string;
14802
+ })[]] | string)[];
14803
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14804
+ match?: "strings";
14805
+ } | {
14806
+ match?: "objectKeys";
14807
+ pathPattern?: string;
14808
+ } | {
14809
+ match?: "objectValues";
14810
+ pathPattern?: string;
14811
+ })[]] | string)[];
14812
+ entryPoint?: string;
14813
+ tailwindConfig?: string;
14814
+ tsconfig?: string;
14815
+ detectComponentClasses?: boolean;
14816
+ ignore?: string[];
14817
+ }];
14818
+ // ----- tailwindcss/sort-classes -----
14819
+ type TailwindcssSortClasses = [] | [{
14820
+ callees?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14821
+ match?: "strings";
14822
+ } | {
14823
+ match?: "objectKeys";
14824
+ pathPattern?: string;
14825
+ } | {
14826
+ match?: "objectValues";
14827
+ pathPattern?: string;
14828
+ })[]] | string)[];
14829
+ attributes?: (string | [] | [string] | [string, string] | [] | [string] | [string, ({
14830
+ match?: "strings";
14831
+ } | {
14832
+ match?: "objectKeys";
14833
+ pathPattern?: string;
14834
+ } | {
14835
+ match?: "objectValues";
14836
+ pathPattern?: string;
14837
+ })[]])[];
14838
+ variables?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14839
+ match?: "strings";
14840
+ } | {
14841
+ match?: "objectKeys";
14842
+ pathPattern?: string;
14843
+ } | {
14844
+ match?: "objectValues";
14845
+ pathPattern?: string;
14846
+ })[]] | string)[];
14847
+ tags?: ([] | [string] | [string, string] | [] | [string] | [string, ({
14848
+ match?: "strings";
14849
+ } | {
14850
+ match?: "objectKeys";
14851
+ pathPattern?: string;
14852
+ } | {
14853
+ match?: "objectValues";
14854
+ pathPattern?: string;
14855
+ })[]] | string)[];
14856
+ entryPoint?: string;
14857
+ tailwindConfig?: string;
14858
+ tsconfig?: string;
14859
+ order?: ("asc" | "desc" | "official" | "improved");
14860
+ }];
14231
14861
  // ----- template-curly-spacing -----
14232
14862
  type TemplateCurlySpacing = [] | [("always" | "never")];
14233
14863
  // ----- template-tag-spacing -----
@@ -17168,7 +17798,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
17168
17798
  onlyEquality?: boolean;
17169
17799
  }];
17170
17800
  // Names of all the configs
17171
- type ConfigNames = 'gitignore' | 'ignores' | 'javascript/setup' | 'javascript/rules' | 'eslint-comments/rules' | 'node/rules' | 'jsdoc/rules' | 'imports/rules' | 'perfectionist/setup' | 'imports/rules' | 'unicorn/rules' | 'jsx/setup' | 'typescript/setup' | 'typescript/parser' | 'typescript/type-aware-parser' | 'typescript/rules' | 'typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'stylistic/rules' | 'regexp/rules' | 'test/setup' | 'test/rules' | 'vue/setup' | 'vue/rules' | 'react/setup' | 'react/rules' | 'react/type-aware-rules' | 'react-native/setup' | 'react-native/rules' | 'next/setup' | 'next/rules' | 'effector/setup' | 'effector/rules' | 'unocss' | 'jsonc/setup' | 'jsonc/rules' | 'sort/package-json' | 'sort/tsconfig-json' | 'pnpm/package-json' | 'pnpm/pnpm-workspace-yaml' | 'pnpm/pnpm-workspace-yaml-sort' | 'yaml/setup' | 'yaml/rules' | 'toml/setup' | 'toml/rules' | 'markdown/setup' | 'markdown/processor' | 'markdown/parser' | 'markdown/disables' | 'formatter/setup' | 'formatter/css' | 'formatter/scss' | 'formatter/html' | 'formatter/xml' | 'formatter/svg' | 'formatter/markdown' | 'disables/scripts' | 'disables/dts' | 'disables/cjs';
17801
+ type ConfigNames = 'gitignore' | 'ignores' | 'javascript/setup' | 'javascript/rules' | 'eslint-comments/rules' | 'node/rules' | 'jsdoc/rules' | 'imports/rules' | 'command/rules' | 'perfectionist/setup' | 'imports/rules' | 'unicorn/rules' | 'jsx/setup' | 'typescript/setup' | 'typescript/parser' | 'typescript/type-aware-parser' | 'typescript/rules' | 'typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'stylistic/rules' | 'regexp/rules' | 'test/setup' | 'test/rules' | 'vue/setup' | 'vue/rules' | 'react/setup' | 'react/rules' | 'react/type-aware-rules' | 'react-native/setup' | 'react-native/rules' | 'next/setup' | 'next/rules' | 'effector/setup' | 'effector/rules' | 'unocss' | 'tailwindcss' | 'jsonc/setup' | 'jsonc/rules' | 'sort/package-json' | 'sort/tsconfig-json' | 'pnpm/package-json' | 'pnpm/pnpm-workspace-yaml' | 'pnpm/pnpm-workspace-yaml-sort' | 'yaml/setup' | 'yaml/rules' | 'toml/setup' | 'toml/rules' | 'markdown/setup' | 'markdown/processor' | 'markdown/parser' | 'markdown/disables' | 'formatter/setup' | 'formatter/css' | 'formatter/scss' | 'formatter/html' | 'formatter/xml' | 'formatter/svg' | 'formatter/markdown' | 'disables/scripts' | 'disables/dts' | 'disables/cjs';
17172
17802
  //#endregion
17173
17803
  //#region src/vendor/prettier-types.d.ts
17174
17804
  /**
@@ -17521,6 +18151,15 @@ interface OptionsUnoCSS extends OptionsOverrides {
17521
18151
  */
17522
18152
  strict?: boolean;
17523
18153
  }
18154
+ interface OptionsTailwindCSS extends OptionsOverrides {
18155
+ /**
18156
+ * The path to the entry file of the css based tailwind config
18157
+ *
18158
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/tree/main?tab=readme-ov-file#quick-start
18159
+ * @example `src/global.css`
18160
+ */
18161
+ entryPoint?: string;
18162
+ }
17524
18163
  interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
17525
18164
  /**
17526
18165
  * Enable gitignore support.
@@ -17581,6 +18220,11 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
17581
18220
  /**
17582
18221
  * Enable Vue support.
17583
18222
  *
18223
+ * Requires installing:
18224
+ * - `eslint-plugin-vue`
18225
+ * - `eslint-processor-vue-blocks`
18226
+ * - `vue-eslint-parser`
18227
+ *
17584
18228
  * @default auto-detect based on the dependencies
17585
18229
  */
17586
18230
  vue?: boolean | OptionsVue;
@@ -17627,12 +18271,20 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
17627
18271
  /**
17628
18272
  * Enable react rules.
17629
18273
  *
18274
+ * Requires installing:
18275
+ * - `@eslint-react/eslint-plugin`
18276
+ * - `eslint-plugin-react-hooks`
18277
+ * - `eslint-plugin-react-refresh`
18278
+ *
17630
18279
  * @default auto-detect based on the dependencies
17631
18280
  */
17632
18281
  react?: boolean | OptionsOverrides;
17633
18282
  /**
17634
18283
  * Enable next rules.
17635
18284
  *
18285
+ * Requires installing:
18286
+ * - `@next/eslint-plugin-next`
18287
+ *
17636
18288
  * @default auto-detect based on the dependencies
17637
18289
  */
17638
18290
  nextjs?: boolean | OptionsOverrides;
@@ -17661,9 +18313,18 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
17661
18313
  * Requires installing:
17662
18314
  * - `@unocss/eslint-plugin`
17663
18315
  *
17664
- * @default false
18316
+ * @default auto-detect based on the dependencies
17665
18317
  */
17666
18318
  unocss?: boolean | OptionsUnoCSS;
18319
+ /**
18320
+ * Enable tailwindcss rules.
18321
+ *
18322
+ * Requires installing:
18323
+ * - `eslint-plugin-better-tailwindcss`
18324
+ *
18325
+ * @default auto-detect based on the dependencies
18326
+ */
18327
+ tailwindcss?: boolean | OptionsTailwindCSS;
17667
18328
  /**
17668
18329
  * Enable pnpm (workspace/catalogs) support.
17669
18330
  *
@@ -17724,6 +18385,7 @@ declare const defaultPluginRenaming: {
17724
18385
  '@next/next': string;
17725
18386
  '@stylistic': string;
17726
18387
  '@typescript-eslint': string;
18388
+ 'better-tailwindcss': string;
17727
18389
  'import-lite': string;
17728
18390
  n: string;
17729
18391
  vitest: string;
@@ -17741,6 +18403,9 @@ declare const defaultPluginRenaming: {
17741
18403
  */
17742
18404
  declare function config(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files' | 'ignores'>, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
17743
18405
  //#endregion
18406
+ //#region src/configs/command.d.ts
18407
+ declare function command(): Promise<TypedFlatConfigItem[]>;
18408
+ //#endregion
17744
18409
  //#region src/configs/comments.d.ts
17745
18410
  declare function comments(): Promise<TypedFlatConfigItem[]>;
17746
18411
  //#endregion
@@ -17819,6 +18484,9 @@ declare const StylisticConfigDefaults: StylisticConfig;
17819
18484
  interface StylisticOptions extends StylisticConfig, OptionsOverrides {}
17820
18485
  declare function stylistic(options?: StylisticOptions): Promise<TypedFlatConfigItem[]>;
17821
18486
  //#endregion
18487
+ //#region src/configs/tailwindcss.d.ts
18488
+ declare function tailwindcss(options?: OptionsTailwindCSS & OptionsStylistic & OptionsTypeScriptWithTypes): Promise<TypedFlatConfigItem[]>;
18489
+ //#endregion
17822
18490
  //#region src/configs/test.d.ts
17823
18491
  declare function test(options?: OptionsFiles & OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
17824
18492
  //#endregion
@@ -17927,4 +18595,4 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
17927
18595
  declare function resolveSubOptions<C extends Record<string, any>, K extends keyof C>(options: C, key: K): ResolvedOptions<C[K]>;
17928
18596
  declare function getOverrides<C extends Record<string, any>, K extends keyof C>(options: C, key: K): Partial<Linter.RulesRecord & RuleOptions>;
17929
18597
  //#endregion
17930
- export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsEffector, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsProjectType, OptionsReactNative, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, combine, comments, config, config as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, reactNative, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toml, typescript, unicorn, unocss, vue, yaml };
18598
+ export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsEffector, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsProjectType, OptionsReactNative, OptionsRegExp, OptionsStylistic, OptionsTailwindCSS, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, combine, command, comments, config, config as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, reactNative, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
6
6
  import { isPackageExists } from "local-pkg";
7
+ import createCommand from "eslint-plugin-command/config";
7
8
  import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
8
9
  import pluginAntfu from "eslint-plugin-antfu";
9
10
  import pluginImportLite from "eslint-plugin-import-lite";
@@ -34,6 +35,15 @@ function findUpSync(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
34
35
  }
35
36
  }
36
37
 
38
+ //#endregion
39
+ //#region src/configs/command.ts
40
+ async function command() {
41
+ return [{
42
+ ...createCommand(),
43
+ name: "command/rules"
44
+ }];
45
+ }
46
+
37
47
  //#endregion
38
48
  //#region src/configs/comments.ts
39
49
  async function comments() {
@@ -1107,7 +1117,7 @@ async function pnpm(options) {
1107
1117
  "preferWorkspacePackages",
1108
1118
  "publicHoistPattern",
1109
1119
  "registrySupportsTimeField",
1110
- "requiredScrpts",
1120
+ "requiredScripts",
1111
1121
  "resolutionMode",
1112
1122
  "savePrefix",
1113
1123
  "scriptShell",
@@ -1618,6 +1628,34 @@ function sortTsconfig() {
1618
1628
  }];
1619
1629
  }
1620
1630
 
1631
+ //#endregion
1632
+ //#region src/configs/tailwindcss.ts
1633
+ async function tailwindcss(options = {}) {
1634
+ const { entryPoint, overrides = {}, stylistic: stylistic$1 = true, tsconfigPath } = options;
1635
+ await ensurePackages(["eslint-plugin-better-tailwindcss"]);
1636
+ const [pluginTailwindCSS] = await Promise.all([interopDefault(import("eslint-plugin-better-tailwindcss"))]);
1637
+ const { indent = 2 } = typeof stylistic$1 === "boolean" ? {} : stylistic$1;
1638
+ return [{
1639
+ name: "tailwindcss",
1640
+ plugins: { tailwindcss: pluginTailwindCSS },
1641
+ rules: {
1642
+ ...stylistic$1 ? {
1643
+ "tailwindcss/enforce-consistent-class-order": "warn",
1644
+ "tailwindcss/enforce-consistent-line-wrapping": ["warn", { indent }],
1645
+ "tailwindcss/no-duplicate-classes": "warn",
1646
+ "tailwindcss/no-unnecessary-whitespace": "warn"
1647
+ } : {},
1648
+ "tailwindcss/no-conflicting-classes": "error",
1649
+ "tailwindcss/no-unregistered-classes": "error",
1650
+ ...overrides
1651
+ },
1652
+ settings: { "better-tailwindcss": {
1653
+ entryPoint,
1654
+ tsconfig: tsconfigPath
1655
+ } }
1656
+ }];
1657
+ }
1658
+
1621
1659
  //#endregion
1622
1660
  //#region src/configs/test.ts
1623
1661
  let _pluginTest;
@@ -1874,7 +1912,7 @@ async function unicorn(options = {}) {
1874
1912
  //#endregion
1875
1913
  //#region src/configs/unocss.ts
1876
1914
  async function unocss(options = {}) {
1877
- const { attributify = true, strict = false } = options;
1915
+ const { attributify = true, overrides = {}, strict = false } = options;
1878
1916
  await ensurePackages(["@unocss/eslint-plugin"]);
1879
1917
  const [pluginUnoCSS] = await Promise.all([interopDefault(import("@unocss/eslint-plugin"))]);
1880
1918
  return [{
@@ -1883,7 +1921,8 @@ async function unocss(options = {}) {
1883
1921
  rules: {
1884
1922
  "unocss/order": "warn",
1885
1923
  ...attributify ? { "unocss/order-attributify": "warn" } : {},
1886
- ...strict ? { "unocss/blocklist": "error" } : {}
1924
+ ...strict ? { "unocss/blocklist": "error" } : {},
1925
+ ...overrides
1887
1926
  }
1888
1927
  }];
1889
1928
  }
@@ -2161,6 +2200,7 @@ const defaultPluginRenaming = {
2161
2200
  "@next/next": "next",
2162
2201
  "@stylistic": "style",
2163
2202
  "@typescript-eslint": "ts",
2203
+ "better-tailwindcss": "tailwindcss",
2164
2204
  "import-lite": "import",
2165
2205
  "n": "node",
2166
2206
  "vitest": "test",
@@ -2177,7 +2217,7 @@ const defaultPluginRenaming = {
2177
2217
  * The merged ESLint configurations.
2178
2218
  */
2179
2219
  function config(options = {}, ...userConfigs) {
2180
- const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"), gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsx: enableJsx = true, nextjs: enableNext = NextJsPackages.some((i) => isPackageExists(i)), pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = ReactPackages.some((i) => isPackageExists(i)), reactNative: enableReactNative = ReactNativePackages.some((i) => isPackageExists(i)), regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = isPackageExists("unocss"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2220
+ const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"), gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsx: enableJsx = true, nextjs: enableNext = NextJsPackages.some((i) => isPackageExists(i)), pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = ReactPackages.some((i) => isPackageExists(i)), reactNative: enableReactNative = ReactNativePackages.some((i) => isPackageExists(i)), regexp: enableRegexp = true, tailwindcss: enableTailwindCSS = isPackageExists("tailwindcss"), typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = isPackageExists("unocss"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2181
2221
  let isInEditor = options.isInEditor;
2182
2222
  if (isInEditor == null) {
2183
2223
  isInEditor = isInEditorEnv();
@@ -2199,7 +2239,7 @@ function config(options = {}, ...userConfigs) {
2199
2239
  configs$1.push(ignores(userIgnores), javascript({
2200
2240
  isInEditor,
2201
2241
  overrides: getOverrides(options, "javascript")
2202
- }), comments(), node(), jsdoc({ stylistic: stylisticOptions }), imports({ stylistic: stylisticOptions }), perfectionist());
2242
+ }), comments(), node(), jsdoc({ stylistic: stylisticOptions }), imports({ stylistic: stylisticOptions }), command(), perfectionist());
2203
2243
  if (enableImports) configs$1.push(imports(enableImports === true ? { stylistic: stylisticOptions } : {
2204
2244
  stylistic: stylisticOptions,
2205
2245
  ...enableImports
@@ -2246,6 +2286,12 @@ function config(options = {}, ...userConfigs) {
2246
2286
  ...resolveSubOptions(options, "unocss"),
2247
2287
  overrides: getOverrides(options, "unocss")
2248
2288
  }));
2289
+ if (enableTailwindCSS) configs$1.push(tailwindcss({
2290
+ ...typescriptOptions,
2291
+ ...resolveSubOptions(options, "tailwindcss"),
2292
+ overrides: getOverrides(options, "tailwindcss"),
2293
+ stylistic: stylisticOptions
2294
+ }));
2249
2295
  if (options.jsonc ?? true) configs$1.push(jsonc({
2250
2296
  overrides: getOverrides(options, "jsonc"),
2251
2297
  stylistic: stylisticOptions
@@ -2287,4 +2333,4 @@ function config(options = {}, ...userConfigs) {
2287
2333
  var src_default = config;
2288
2334
 
2289
2335
  //#endregion
2290
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, comments, config, src_default as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, reactNative, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toml, typescript, unicorn, unocss, vue, yaml };
2336
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, command, comments, config, src_default as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, reactNative, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toml, typescript, unicorn, unocss, vue, yaml };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ghettoddos/eslint-config",
3
3
  "type": "module",
4
- "version": "3.0.1",
4
+ "version": "3.1.1",
5
5
  "description": "ghettoDdOS ESLint config",
6
6
  "author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
7
7
  "license": "MIT",
@@ -31,6 +31,7 @@
31
31
  "@react-native/eslint-plugin": ">=0.80.0",
32
32
  "@unocss/eslint-plugin": ">=0.50.0",
33
33
  "eslint": "^9.10.0",
34
+ "eslint-plugin-better-tailwindcss": "^3.8.0",
34
35
  "eslint-plugin-effector": ">=0.15.0",
35
36
  "eslint-plugin-expo": "^0.1.4",
36
37
  "eslint-plugin-format": ">=0.1.0",
@@ -59,6 +60,9 @@
59
60
  "@unocss/eslint-plugin": {
60
61
  "optional": true
61
62
  },
63
+ "eslint-plugin-better-tailwindcss": {
64
+ "optional": true
65
+ },
62
66
  "eslint-plugin-effector": {
63
67
  "optional": true
64
68
  },
@@ -107,6 +111,7 @@
107
111
  "eslint-flat-config-utils": "^2.1.4",
108
112
  "eslint-merge-processors": "^2.0.0",
109
113
  "eslint-plugin-antfu": "^3.1.1",
114
+ "eslint-plugin-command": "^3.3.1",
110
115
  "eslint-plugin-import-lite": "^0.3.0",
111
116
  "eslint-plugin-jsdoc": "^61.4.1",
112
117
  "eslint-plugin-jsonc": "^2.21.0",
@@ -138,6 +143,7 @@
138
143
  "bumpp": "^10.3.2",
139
144
  "eslint": "^9.39.1",
140
145
  "eslint-plugin-astro": "^1.5.0",
146
+ "eslint-plugin-better-tailwindcss": "^3.8.0",
141
147
  "eslint-plugin-erasable-syntax-only": "^0.4.0",
142
148
  "eslint-plugin-format": "^1.0.2",
143
149
  "eslint-plugin-jsx-a11y": "^6.10.2",
@@ -157,7 +163,7 @@
157
163
  "vitest": "^4.0.15",
158
164
  "vue": "^3.5.25",
159
165
  "vue-eslint-parser": "^10.2.0",
160
- "@ghettoddos/eslint-config": "3.0.1"
166
+ "@ghettoddos/eslint-config": "3.1.1"
161
167
  },
162
168
  "resolutions": {
163
169
  "eslint": "catalog:peer"