@coderwyd/eslint-config 2.5.0-beta.2 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -46,7 +46,7 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
46
46
  var import_picocolors = __toESM(require("picocolors"), 1);
47
47
 
48
48
  // package.json
49
- var version = "2.5.0-beta.2";
49
+ var version = "2.5.1";
50
50
  var devDependencies = {
51
51
  "@antfu/ni": "^0.21.12",
52
52
  "@eslint-react/eslint-plugin": "^1.5.12",
@@ -57,17 +57,18 @@ var devDependencies = {
57
57
  "@types/node": "^20.12.12",
58
58
  "@types/prompts": "^2.4.9",
59
59
  "@types/yargs": "^17.0.32",
60
- "@unocss/eslint-plugin": "^0.60.2",
60
+ "@unocss/eslint-plugin": "^0.60.3",
61
61
  bumpp: "^9.4.1",
62
62
  eslint: "^9.3.0",
63
63
  "eslint-plugin-react": "^7.34.1",
64
64
  "eslint-plugin-react-hooks": "^4.6.2",
65
65
  "eslint-plugin-react-refresh": "^0.4.7",
66
66
  "eslint-plugin-svelte": "2.39.0",
67
+ "eslint-plugin-tailwindcss": "^3.16.0",
67
68
  execa: "^9.1.0",
68
69
  "fast-glob": "^3.3.2",
69
70
  "fs-extra": "^11.2.0",
70
- "lint-staged": "^15.2.2",
71
+ "lint-staged": "^15.2.4",
71
72
  rimraf: "^5.0.7",
72
73
  "simple-git-hooks": "^2.11.1",
73
74
  svelte: "^4.2.17",
package/dist/cli.js CHANGED
@@ -17,7 +17,7 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.5.0-beta.2";
20
+ var version = "2.5.1";
21
21
  var devDependencies = {
22
22
  "@antfu/ni": "^0.21.12",
23
23
  "@eslint-react/eslint-plugin": "^1.5.12",
@@ -28,17 +28,18 @@ var devDependencies = {
28
28
  "@types/node": "^20.12.12",
29
29
  "@types/prompts": "^2.4.9",
30
30
  "@types/yargs": "^17.0.32",
31
- "@unocss/eslint-plugin": "^0.60.2",
31
+ "@unocss/eslint-plugin": "^0.60.3",
32
32
  bumpp: "^9.4.1",
33
33
  eslint: "^9.3.0",
34
34
  "eslint-plugin-react": "^7.34.1",
35
35
  "eslint-plugin-react-hooks": "^4.6.2",
36
36
  "eslint-plugin-react-refresh": "^0.4.7",
37
37
  "eslint-plugin-svelte": "2.39.0",
38
+ "eslint-plugin-tailwindcss": "^3.16.0",
38
39
  execa: "^9.1.0",
39
40
  "fast-glob": "^3.3.2",
40
41
  "fs-extra": "^11.2.0",
41
- "lint-staged": "^15.2.2",
42
+ "lint-staged": "^15.2.4",
42
43
  rimraf: "^5.0.7",
43
44
  "simple-git-hooks": "^2.11.1",
44
45
  svelte: "^4.2.17",
package/dist/index.cjs CHANGED
@@ -76,6 +76,8 @@ async function comments() {
76
76
  // src/constants/glob.ts
77
77
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
78
78
  var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
79
+ var GLOB_JS = "**/*.?([cm])js";
80
+ var GLOB_JSX = "**/*.?([cm])jsx";
79
81
  var GLOB_TS = "**/*.?([cm])ts";
80
82
  var GLOB_TSX = "**/*.?([cm])tsx";
81
83
  var GLOB_VUE = "**/*.vue";
@@ -1454,8 +1456,20 @@ async function perfectionist() {
1454
1456
  }
1455
1457
 
1456
1458
  // src/configs/react.ts
1459
+ var import_local_pkg3 = require("local-pkg");
1460
+
1461
+ // src/env.ts
1462
+ var import_node_process3 = __toESM(require("process"), 1);
1457
1463
  var import_local_pkg2 = require("local-pkg");
1458
- var ReactRefreshAllowConstantExportPackages = ["vite"];
1464
+ var isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.VSCODE_CWD || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI);
1465
+ var hasTypeScript = (0, import_local_pkg2.isPackageExists)("typescript");
1466
+ var VueJsPackages = [
1467
+ "vue",
1468
+ "nuxt",
1469
+ "vitepress",
1470
+ "@slidev/cli"
1471
+ ];
1472
+ var hasVue = hasPackages(VueJsPackages);
1459
1473
  var RemixPackages = [
1460
1474
  "@remix-run/node",
1461
1475
  "@remix-run/react",
@@ -1463,8 +1477,16 @@ var RemixPackages = [
1463
1477
  "@remix-run/dev"
1464
1478
  ];
1465
1479
  var NextJsPackages = ["next"];
1480
+ var isUsingRemix = hasPackages(RemixPackages);
1481
+ var isUsingNext = hasPackages(NextJsPackages);
1482
+ function hasPackages(packages) {
1483
+ return packages.some((name) => (0, import_local_pkg2.isPackageExists)(name));
1484
+ }
1485
+
1486
+ // src/configs/react.ts
1487
+ var ReactRefreshAllowConstantExportPackages = ["vite"];
1466
1488
  async function react(options = {}) {
1467
- const { files = [GLOB_TS, GLOB_TSX], overrides = {} } = options;
1489
+ const { files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX], overrides = {} } = options;
1468
1490
  await ensurePackages([
1469
1491
  "@eslint-react/eslint-plugin",
1470
1492
  "eslint-plugin-react-hooks",
@@ -1479,10 +1501,8 @@ async function react(options = {}) {
1479
1501
  interopDefault(import("@typescript-eslint/parser"))
1480
1502
  ]);
1481
1503
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
1482
- (i) => (0, import_local_pkg2.isPackageExists)(i)
1504
+ (i) => (0, import_local_pkg3.isPackageExists)(i)
1483
1505
  );
1484
- const isUsingRemix = RemixPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
1485
- const isUsingNext = NextJsPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
1486
1506
  const plugins = pluginReact.configs.all.plugins;
1487
1507
  return [
1488
1508
  {
@@ -1816,6 +1836,7 @@ async function svelte(options = {}) {
1816
1836
  // src/configs/tailwindcss.ts
1817
1837
  async function tailwindcss(options = {}) {
1818
1838
  const { overrides } = options;
1839
+ await ensurePackages(["eslint-plugin-tailwindcss"]);
1819
1840
  const pluginTailwindcss = await interopDefault(
1820
1841
  import("eslint-plugin-tailwindcss")
1821
1842
  );
@@ -1831,7 +1852,7 @@ async function tailwindcss(options = {}) {
1831
1852
  "tailwindcss/enforces-shorthand": "warn",
1832
1853
  "tailwindcss/migration-from-tailwind-2": "warn",
1833
1854
  "tailwindcss/no-arbitrary-value": "off",
1834
- "tailwindcss/no-contradicting-classname": "error",
1855
+ "tailwindcss/no-contradicting-classname": "warn",
1835
1856
  "tailwindcss/no-custom-classname": "off",
1836
1857
  "tailwindcss/no-unnecessary-arbitrary-value": "warn",
1837
1858
  ...overrides
@@ -1876,15 +1897,6 @@ async function regexp(options = {}) {
1876
1897
  ];
1877
1898
  }
1878
1899
 
1879
- // src/env.ts
1880
- var import_node_process3 = __toESM(require("process"), 1);
1881
- var import_local_pkg3 = require("local-pkg");
1882
- var isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.VSCODE_CWD || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI);
1883
- var hasTypeScript = (0, import_local_pkg3.isPackageExists)("typescript");
1884
- var hasVue = (0, import_local_pkg3.isPackageExists)("vue") || (0, import_local_pkg3.isPackageExists)("nuxt") || (0, import_local_pkg3.isPackageExists)("vitepress") || (0, import_local_pkg3.isPackageExists)("@slidev/cli");
1885
- var hasUnocss = (0, import_local_pkg3.isPackageExists)("unocss") || (0, import_local_pkg3.isPackageExists)("@unocss/webpack") || (0, import_local_pkg3.isPackageExists)("@unocss/nuxt");
1886
- var hasTailwindCSS = (0, import_local_pkg3.isPackageExists)("tailwindcss") && !hasUnocss;
1887
-
1888
1900
  // src/index.ts
1889
1901
  var flatConfigProps = [
1890
1902
  "name",
@@ -1922,7 +1934,7 @@ async function defineConfig(options = {}, ...userConfigs) {
1922
1934
  react: enableReact = false,
1923
1935
  regexp: enableRegexp = true,
1924
1936
  svelte: enableSvelte = false,
1925
- tailwindcss: enableTailwindCSS = hasTailwindCSS,
1937
+ tailwindcss: enableTailwindCSS = false,
1926
1938
  typescript: enableTypeScript = hasTypeScript,
1927
1939
  unocss: enableUnoCSS = false,
1928
1940
  vue: enableVue = hasVue
package/dist/index.d.cts CHANGED
@@ -12664,6 +12664,8 @@ type TsSortTypeConstituents = []|[{
12664
12664
 
12665
12665
  checkUnions?: boolean
12666
12666
 
12667
+ caseSensitive?: boolean
12668
+
12667
12669
  groupOrder?: ("conditional" | "function" | "import" | "intersection" | "keyword" | "nullish" | "literal" | "named" | "object" | "operator" | "tuple" | "union")[]
12668
12670
  }]
12669
12671
  // ----- ts/space-before-blocks -----
package/dist/index.d.ts CHANGED
@@ -12664,6 +12664,8 @@ type TsSortTypeConstituents = []|[{
12664
12664
 
12665
12665
  checkUnions?: boolean
12666
12666
 
12667
+ caseSensitive?: boolean
12668
+
12667
12669
  groupOrder?: ("conditional" | "function" | "import" | "intersection" | "keyword" | "nullish" | "literal" | "named" | "object" | "operator" | "tuple" | "union")[]
12668
12670
  }]
12669
12671
  // ----- ts/space-before-blocks -----
package/dist/index.js CHANGED
@@ -31,6 +31,8 @@ async function comments() {
31
31
  // src/constants/glob.ts
32
32
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
33
33
  var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
34
+ var GLOB_JS = "**/*.?([cm])js";
35
+ var GLOB_JSX = "**/*.?([cm])jsx";
34
36
  var GLOB_TS = "**/*.?([cm])ts";
35
37
  var GLOB_TSX = "**/*.?([cm])tsx";
36
38
  var GLOB_VUE = "**/*.vue";
@@ -1409,8 +1411,20 @@ async function perfectionist() {
1409
1411
  }
1410
1412
 
1411
1413
  // src/configs/react.ts
1414
+ import { isPackageExists as isPackageExists3 } from "local-pkg";
1415
+
1416
+ // src/env.ts
1417
+ import process3 from "node:process";
1412
1418
  import { isPackageExists as isPackageExists2 } from "local-pkg";
1413
- var ReactRefreshAllowConstantExportPackages = ["vite"];
1419
+ var isInEditor = !!((process3.env.VSCODE_PID || process3.env.VSCODE_CWD || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI);
1420
+ var hasTypeScript = isPackageExists2("typescript");
1421
+ var VueJsPackages = [
1422
+ "vue",
1423
+ "nuxt",
1424
+ "vitepress",
1425
+ "@slidev/cli"
1426
+ ];
1427
+ var hasVue = hasPackages(VueJsPackages);
1414
1428
  var RemixPackages = [
1415
1429
  "@remix-run/node",
1416
1430
  "@remix-run/react",
@@ -1418,8 +1432,16 @@ var RemixPackages = [
1418
1432
  "@remix-run/dev"
1419
1433
  ];
1420
1434
  var NextJsPackages = ["next"];
1435
+ var isUsingRemix = hasPackages(RemixPackages);
1436
+ var isUsingNext = hasPackages(NextJsPackages);
1437
+ function hasPackages(packages) {
1438
+ return packages.some((name) => isPackageExists2(name));
1439
+ }
1440
+
1441
+ // src/configs/react.ts
1442
+ var ReactRefreshAllowConstantExportPackages = ["vite"];
1421
1443
  async function react(options = {}) {
1422
- const { files = [GLOB_TS, GLOB_TSX], overrides = {} } = options;
1444
+ const { files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX], overrides = {} } = options;
1423
1445
  await ensurePackages([
1424
1446
  "@eslint-react/eslint-plugin",
1425
1447
  "eslint-plugin-react-hooks",
@@ -1434,10 +1456,8 @@ async function react(options = {}) {
1434
1456
  interopDefault(import("@typescript-eslint/parser"))
1435
1457
  ]);
1436
1458
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
1437
- (i) => isPackageExists2(i)
1459
+ (i) => isPackageExists3(i)
1438
1460
  );
1439
- const isUsingRemix = RemixPackages.some((i) => isPackageExists2(i));
1440
- const isUsingNext = NextJsPackages.some((i) => isPackageExists2(i));
1441
1461
  const plugins = pluginReact.configs.all.plugins;
1442
1462
  return [
1443
1463
  {
@@ -1771,6 +1791,7 @@ async function svelte(options = {}) {
1771
1791
  // src/configs/tailwindcss.ts
1772
1792
  async function tailwindcss(options = {}) {
1773
1793
  const { overrides } = options;
1794
+ await ensurePackages(["eslint-plugin-tailwindcss"]);
1774
1795
  const pluginTailwindcss = await interopDefault(
1775
1796
  import("eslint-plugin-tailwindcss")
1776
1797
  );
@@ -1786,7 +1807,7 @@ async function tailwindcss(options = {}) {
1786
1807
  "tailwindcss/enforces-shorthand": "warn",
1787
1808
  "tailwindcss/migration-from-tailwind-2": "warn",
1788
1809
  "tailwindcss/no-arbitrary-value": "off",
1789
- "tailwindcss/no-contradicting-classname": "error",
1810
+ "tailwindcss/no-contradicting-classname": "warn",
1790
1811
  "tailwindcss/no-custom-classname": "off",
1791
1812
  "tailwindcss/no-unnecessary-arbitrary-value": "warn",
1792
1813
  ...overrides
@@ -1831,15 +1852,6 @@ async function regexp(options = {}) {
1831
1852
  ];
1832
1853
  }
1833
1854
 
1834
- // src/env.ts
1835
- import process3 from "node:process";
1836
- import { isPackageExists as isPackageExists3 } from "local-pkg";
1837
- var isInEditor = !!((process3.env.VSCODE_PID || process3.env.VSCODE_CWD || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI);
1838
- var hasTypeScript = isPackageExists3("typescript");
1839
- var hasVue = isPackageExists3("vue") || isPackageExists3("nuxt") || isPackageExists3("vitepress") || isPackageExists3("@slidev/cli");
1840
- var hasUnocss = isPackageExists3("unocss") || isPackageExists3("@unocss/webpack") || isPackageExists3("@unocss/nuxt");
1841
- var hasTailwindCSS = isPackageExists3("tailwindcss") && !hasUnocss;
1842
-
1843
1855
  // src/index.ts
1844
1856
  var flatConfigProps = [
1845
1857
  "name",
@@ -1877,7 +1889,7 @@ async function defineConfig(options = {}, ...userConfigs) {
1877
1889
  react: enableReact = false,
1878
1890
  regexp: enableRegexp = true,
1879
1891
  svelte: enableSvelte = false,
1880
- tailwindcss: enableTailwindCSS = hasTailwindCSS,
1892
+ tailwindcss: enableTailwindCSS = false,
1881
1893
  typescript: enableTypeScript = hasTypeScript,
1882
1894
  unocss: enableUnoCSS = false,
1883
1895
  vue: enableVue = hasVue
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "2.5.0-beta.2",
4
+ "version": "2.5.1",
5
5
  "description": "Donny's ESLint config",
6
6
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
7
7
  "license": "MIT",
@@ -41,6 +41,7 @@
41
41
  "eslint-plugin-react-hooks": "^4.6.0",
42
42
  "eslint-plugin-react-refresh": "^0.4.4",
43
43
  "eslint-plugin-svelte": "^2.34.1",
44
+ "eslint-plugin-tailwindcss": "^3.16.0",
44
45
  "svelte-eslint-parser": "^0.33.1"
45
46
  },
46
47
  "peerDependenciesMeta": {
@@ -59,6 +60,9 @@
59
60
  "eslint-plugin-svelte": {
60
61
  "optional": true
61
62
  },
63
+ "eslint-plugin-tailwindcss": {
64
+ "optional": true
65
+ },
62
66
  "svelte-eslint-parser": {
63
67
  "optional": true
64
68
  }
@@ -67,8 +71,8 @@
67
71
  "@antfu/install-pkg": "^0.3.3",
68
72
  "@stylistic/eslint-plugin": "^2.1.0",
69
73
  "@toml-tools/parser": "^1.0.0",
70
- "@typescript-eslint/eslint-plugin": "^7.9.0",
71
- "@typescript-eslint/parser": "^7.9.0",
74
+ "@typescript-eslint/eslint-plugin": "^7.10.0",
75
+ "@typescript-eslint/parser": "^7.10.0",
72
76
  "eslint-config-flat-gitignore": "^0.1.5",
73
77
  "eslint-merge-processors": "^0.1.0",
74
78
  "eslint-plugin-antfu": "^2.2.0",
@@ -81,8 +85,7 @@
81
85
  "eslint-plugin-n": "^17.7.0",
82
86
  "eslint-plugin-no-only-tests": "^3.1.0",
83
87
  "eslint-plugin-perfectionist": "^2.10.0",
84
- "eslint-plugin-regexp": "^2.5.0",
85
- "eslint-plugin-tailwindcss": "^3.15.2",
88
+ "eslint-plugin-regexp": "^2.6.0",
86
89
  "eslint-plugin-unicorn": "^53.0.0",
87
90
  "eslint-plugin-unused-imports": "^3.2.0",
88
91
  "eslint-plugin-vitest": "^0.5.4",
@@ -109,17 +112,18 @@
109
112
  "@types/node": "^20.12.12",
110
113
  "@types/prompts": "^2.4.9",
111
114
  "@types/yargs": "^17.0.32",
112
- "@unocss/eslint-plugin": "^0.60.2",
115
+ "@unocss/eslint-plugin": "^0.60.3",
113
116
  "bumpp": "^9.4.1",
114
117
  "eslint": "^9.3.0",
115
118
  "eslint-plugin-react": "^7.34.1",
116
119
  "eslint-plugin-react-hooks": "^4.6.2",
117
120
  "eslint-plugin-react-refresh": "^0.4.7",
118
121
  "eslint-plugin-svelte": "2.39.0",
122
+ "eslint-plugin-tailwindcss": "^3.16.0",
119
123
  "execa": "^9.1.0",
120
124
  "fast-glob": "^3.3.2",
121
125
  "fs-extra": "^11.2.0",
122
- "lint-staged": "^15.2.2",
126
+ "lint-staged": "^15.2.4",
123
127
  "rimraf": "^5.0.7",
124
128
  "simple-git-hooks": "^2.11.1",
125
129
  "svelte": "^4.2.17",