@debbl/eslint-config 3.1.6 → 3.1.7

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.cjs CHANGED
@@ -1383,7 +1383,7 @@ async function perfectionist() {
1383
1383
  }
1384
1384
 
1385
1385
  // src/configs/prettier.ts
1386
- var prettier = async (options) => {
1386
+ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
1387
1387
  const [pluginPrettier, configPrettier] = await Promise.all([
1388
1388
  interopDefault(import("eslint-plugin-prettier")),
1389
1389
  // @ts-expect-error missing types
@@ -1458,11 +1458,18 @@ var prettier = async (options) => {
1458
1458
  name: "eslint/prettier/rules",
1459
1459
  ignores: [GLOB_TOML],
1460
1460
  rules: {
1461
+ // disable rules with prettier conflicts
1461
1462
  ...configPrettier.rules,
1462
- ...pluginPrettier.configs.recommended.rules,
1463
+ // eslint-plugin-prettier recommended rules
1464
+ ...{
1465
+ "prettier/prettier": "error",
1466
+ "arrow-body-style": "off",
1467
+ "prefer-arrow-callback": "off"
1468
+ },
1463
1469
  "prettier/prettier": [
1464
1470
  "warn",
1465
1471
  {
1472
+ plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
1466
1473
  quoteProps: "consistent",
1467
1474
  ...options
1468
1475
  }
@@ -1657,11 +1664,16 @@ function config(options = {}) {
1657
1664
  })
1658
1665
  );
1659
1666
  }
1660
- if (enableTailwindcss) {
1667
+ if (typeof enableTailwindcss === "boolean" && enableTailwindcss) {
1661
1668
  configs.push(tailwindcss());
1662
1669
  }
1663
1670
  if (options.prettier ?? true) {
1664
- configs.push(prettier(getConfigOption(options.prettier)));
1671
+ configs.push(
1672
+ prettier({
1673
+ ...getConfigOption(options.prettier),
1674
+ tailwindcss: enableTailwindcss === "prettier"
1675
+ })
1676
+ );
1665
1677
  }
1666
1678
  const merged = combine(...configs, options.customConfig ?? []);
1667
1679
  return merged;
package/dist/index.d.cts CHANGED
@@ -71,7 +71,9 @@ declare const test: TestConfig;
71
71
  declare function perfectionist(): Promise<ConfigItem[]>;
72
72
 
73
73
  type PrettierRequiredOptions = Partial<RequiredOptions>;
74
- type PrettierConfig = (options: PrettierRequiredOptions) => Promise<ConfigItem[]>;
74
+ type PrettierConfig = ({ options, }: PrettierRequiredOptions & {
75
+ tailwindcss?: boolean;
76
+ }) => Promise<ConfigItem[]>;
75
77
  declare const prettier: PrettierConfig;
76
78
 
77
79
  type Awaitable<T> = T | Promise<T>;
@@ -180,12 +182,13 @@ interface OptionsConfig extends OptionsComponentExts {
180
182
  *
181
183
  * @default true
182
184
  */
183
- prettier?: boolean | GetConfigOption<PrettierConfig>;
185
+ prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, "tailwindcss">;
184
186
  /**
185
187
  * Enable Tailwind CSS support.
188
+ * if set to "prettier", it will use `prettier-plugin-tailwindcss`
186
189
  * @default false
187
190
  */
188
- tailwindcss?: boolean;
191
+ tailwindcss?: boolean | "prettier";
189
192
  /**
190
193
  * Custom config
191
194
  */
package/dist/index.d.ts CHANGED
@@ -71,7 +71,9 @@ declare const test: TestConfig;
71
71
  declare function perfectionist(): Promise<ConfigItem[]>;
72
72
 
73
73
  type PrettierRequiredOptions = Partial<RequiredOptions>;
74
- type PrettierConfig = (options: PrettierRequiredOptions) => Promise<ConfigItem[]>;
74
+ type PrettierConfig = ({ options, }: PrettierRequiredOptions & {
75
+ tailwindcss?: boolean;
76
+ }) => Promise<ConfigItem[]>;
75
77
  declare const prettier: PrettierConfig;
76
78
 
77
79
  type Awaitable<T> = T | Promise<T>;
@@ -180,12 +182,13 @@ interface OptionsConfig extends OptionsComponentExts {
180
182
  *
181
183
  * @default true
182
184
  */
183
- prettier?: boolean | GetConfigOption<PrettierConfig>;
185
+ prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, "tailwindcss">;
184
186
  /**
185
187
  * Enable Tailwind CSS support.
188
+ * if set to "prettier", it will use `prettier-plugin-tailwindcss`
186
189
  * @default false
187
190
  */
188
- tailwindcss?: boolean;
191
+ tailwindcss?: boolean | "prettier";
189
192
  /**
190
193
  * Custom config
191
194
  */
package/dist/index.js CHANGED
@@ -1301,7 +1301,7 @@ async function perfectionist() {
1301
1301
  }
1302
1302
 
1303
1303
  // src/configs/prettier.ts
1304
- var prettier = async (options) => {
1304
+ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
1305
1305
  const [pluginPrettier, configPrettier] = await Promise.all([
1306
1306
  interopDefault(import("eslint-plugin-prettier")),
1307
1307
  // @ts-expect-error missing types
@@ -1376,11 +1376,18 @@ var prettier = async (options) => {
1376
1376
  name: "eslint/prettier/rules",
1377
1377
  ignores: [GLOB_TOML],
1378
1378
  rules: {
1379
+ // disable rules with prettier conflicts
1379
1380
  ...configPrettier.rules,
1380
- ...pluginPrettier.configs.recommended.rules,
1381
+ // eslint-plugin-prettier recommended rules
1382
+ ...{
1383
+ "prettier/prettier": "error",
1384
+ "arrow-body-style": "off",
1385
+ "prefer-arrow-callback": "off"
1386
+ },
1381
1387
  "prettier/prettier": [
1382
1388
  "warn",
1383
1389
  {
1390
+ plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
1384
1391
  quoteProps: "consistent",
1385
1392
  ...options
1386
1393
  }
@@ -1575,11 +1582,16 @@ function config(options = {}) {
1575
1582
  })
1576
1583
  );
1577
1584
  }
1578
- if (enableTailwindcss) {
1585
+ if (typeof enableTailwindcss === "boolean" && enableTailwindcss) {
1579
1586
  configs.push(tailwindcss());
1580
1587
  }
1581
1588
  if (options.prettier ?? true) {
1582
- configs.push(prettier(getConfigOption(options.prettier)));
1589
+ configs.push(
1590
+ prettier({
1591
+ ...getConfigOption(options.prettier),
1592
+ tailwindcss: enableTailwindcss === "prettier"
1593
+ })
1594
+ );
1583
1595
  }
1584
1596
  const merged = combine(...configs, options.customConfig ?? []);
1585
1597
  return merged;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debbl/eslint-config",
3
3
  "type": "module",
4
- "version": "3.1.6",
4
+ "version": "3.1.7",
5
5
  "description": "Brendan Dash's ESLint config",
6
6
  "author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
7
7
  "license": "MIT",
@@ -23,13 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "peerDependencies": {
26
- "eslint": ">=8.40.0",
27
- "eslint-plugin-tailwindcss": "^3.15.1"
28
- },
29
- "peerDependenciesMeta": {
30
- "eslint-plugin-tailwindcss": {
31
- "optional": true
32
- }
26
+ "eslint": ">=8.40.0"
33
27
  },
34
28
  "dependencies": {
35
29
  "@next/eslint-plugin-next": "^14.2.3",
@@ -50,6 +44,7 @@
50
44
  "eslint-plugin-react": "^7.34.1",
51
45
  "eslint-plugin-react-hooks": "4.6.2",
52
46
  "eslint-plugin-react-refresh": "^0.4.6",
47
+ "eslint-plugin-tailwindcss": "^3.15.2",
53
48
  "eslint-plugin-toml": "^0.11.0",
54
49
  "eslint-plugin-unicorn": "^52.0.0",
55
50
  "eslint-plugin-unused-imports": "^3.2.0",
@@ -59,6 +54,7 @@
59
54
  "globals": "^15.1.0",
60
55
  "jsonc-eslint-parser": "^2.4.0",
61
56
  "prettier": "^3.2.5",
57
+ "prettier-plugin-tailwindcss": "^0.5.14",
62
58
  "toml-eslint-parser": "^0.9.3",
63
59
  "vue-eslint-parser": "^9.4.2",
64
60
  "yaml-eslint-parser": "^1.2.2"
@@ -70,7 +66,6 @@
70
66
  "@types/react": "^18.3.1",
71
67
  "bumpp": "^9.4.1",
72
68
  "eslint": "^8.57.0",
73
- "eslint-plugin-tailwindcss": "^3.15.1",
74
69
  "execa": "^8.0.1",
75
70
  "fast-glob": "^3.3.2",
76
71
  "fs-extra": "^11.2.0",