@coderwyd/eslint-config 2.5.5 → 2.6.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/README.md CHANGED
@@ -59,9 +59,6 @@ Add the following settings to your `.vscode/settings.json`:
59
59
 
60
60
  ```jsonc
61
61
  {
62
- // Enable the ESlint flat config support
63
- "eslint.experimental.useFlatConfig": true,
64
-
65
62
  // Disable the default formatter, use eslint instead
66
63
  "prettier.enable": false,
67
64
  "editor.formatOnSave": false,
package/dist/cli.cjs CHANGED
@@ -46,35 +46,35 @@ 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.5";
49
+ var version = "2.6.0";
50
50
  var devDependencies = {
51
51
  "@antfu/ni": "^0.21.12",
52
- "@eslint-react/eslint-plugin": "^1.5.15",
53
- "@eslint/config-inspector": "^0.4.11",
54
- "@stylistic/eslint-plugin-migrate": "^2.1.0",
52
+ "@eslint-react/eslint-plugin": "^1.5.24",
53
+ "@eslint/config-inspector": "^0.5.1",
54
+ "@stylistic/eslint-plugin-migrate": "^2.3.0",
55
55
  "@types/eslint": "^8.56.10",
56
56
  "@types/fs-extra": "^11.0.4",
57
- "@types/node": "^20.14.2",
57
+ "@types/node": "^20.14.10",
58
58
  "@types/prompts": "^2.4.9",
59
59
  "@types/yargs": "^17.0.32",
60
- "@unocss/eslint-plugin": "^0.61.0",
60
+ "@unocss/eslint-plugin": "^0.61.3",
61
61
  bumpp: "^9.4.1",
62
- eslint: "^9.4.0",
62
+ eslint: "^9.6.0",
63
63
  "eslint-plugin-react-hooks": "^4.6.2",
64
- "eslint-plugin-react-refresh": "^0.4.7",
65
- "eslint-plugin-svelte": "2.39.0",
66
- "eslint-plugin-tailwindcss": "^3.17.3",
67
- execa: "^9.2.0",
64
+ "eslint-plugin-react-refresh": "^0.4.8",
65
+ "eslint-plugin-svelte": "2.41.0",
66
+ "eslint-plugin-tailwindcss": "^3.17.4",
67
+ execa: "^9.3.0",
68
68
  "fast-glob": "^3.3.2",
69
69
  "fs-extra": "^11.2.0",
70
- "lint-staged": "^15.2.6",
71
- rimraf: "^5.0.7",
70
+ "lint-staged": "^15.2.7",
71
+ rimraf: "^6.0.1",
72
72
  "simple-git-hooks": "^2.11.1",
73
73
  svelte: "^4.2.18",
74
- "svelte-eslint-parser": "^0.37.0",
74
+ "svelte-eslint-parser": "^0.40.0",
75
75
  tsup: "^8.1.0",
76
- tsx: "^4.15.2",
77
- typescript: "^5.4.5"
76
+ tsx: "^4.16.2",
77
+ typescript: "^5.5.3"
78
78
  };
79
79
 
80
80
  // src/cli/constants.ts
@@ -84,9 +84,6 @@ var CROSS = import_picocolors.default.red("\u2718");
84
84
  var WARN = import_picocolors.default.yellow("\u2139");
85
85
  var eslintVersion = devDependencies.eslint;
86
86
  var vscodeSettingsString = `
87
- // Enable the ESlint flat config support
88
- "eslint.experimental.useFlatConfig": true,
89
-
90
87
  // Disable the default formatter, use eslint instead
91
88
  "prettier.enable": false,
92
89
  "editor.formatOnSave": false,
package/dist/cli.js CHANGED
@@ -17,35 +17,35 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.5.5";
20
+ var version = "2.6.0";
21
21
  var devDependencies = {
22
22
  "@antfu/ni": "^0.21.12",
23
- "@eslint-react/eslint-plugin": "^1.5.15",
24
- "@eslint/config-inspector": "^0.4.11",
25
- "@stylistic/eslint-plugin-migrate": "^2.1.0",
23
+ "@eslint-react/eslint-plugin": "^1.5.24",
24
+ "@eslint/config-inspector": "^0.5.1",
25
+ "@stylistic/eslint-plugin-migrate": "^2.3.0",
26
26
  "@types/eslint": "^8.56.10",
27
27
  "@types/fs-extra": "^11.0.4",
28
- "@types/node": "^20.14.2",
28
+ "@types/node": "^20.14.10",
29
29
  "@types/prompts": "^2.4.9",
30
30
  "@types/yargs": "^17.0.32",
31
- "@unocss/eslint-plugin": "^0.61.0",
31
+ "@unocss/eslint-plugin": "^0.61.3",
32
32
  bumpp: "^9.4.1",
33
- eslint: "^9.4.0",
33
+ eslint: "^9.6.0",
34
34
  "eslint-plugin-react-hooks": "^4.6.2",
35
- "eslint-plugin-react-refresh": "^0.4.7",
36
- "eslint-plugin-svelte": "2.39.0",
37
- "eslint-plugin-tailwindcss": "^3.17.3",
38
- execa: "^9.2.0",
35
+ "eslint-plugin-react-refresh": "^0.4.8",
36
+ "eslint-plugin-svelte": "2.41.0",
37
+ "eslint-plugin-tailwindcss": "^3.17.4",
38
+ execa: "^9.3.0",
39
39
  "fast-glob": "^3.3.2",
40
40
  "fs-extra": "^11.2.0",
41
- "lint-staged": "^15.2.6",
42
- rimraf: "^5.0.7",
41
+ "lint-staged": "^15.2.7",
42
+ rimraf: "^6.0.1",
43
43
  "simple-git-hooks": "^2.11.1",
44
44
  svelte: "^4.2.18",
45
- "svelte-eslint-parser": "^0.37.0",
45
+ "svelte-eslint-parser": "^0.40.0",
46
46
  tsup: "^8.1.0",
47
- tsx: "^4.15.2",
48
- typescript: "^5.4.5"
47
+ tsx: "^4.16.2",
48
+ typescript: "^5.5.3"
49
49
  };
50
50
 
51
51
  // src/cli/constants.ts
@@ -55,9 +55,6 @@ var CROSS = c.red("\u2718");
55
55
  var WARN = c.yellow("\u2139");
56
56
  var eslintVersion = devDependencies.eslint;
57
57
  var vscodeSettingsString = `
58
- // Enable the ESlint flat config support
59
- "eslint.experimental.useFlatConfig": true,
60
-
61
58
  // Disable the default formatter, use eslint instead
62
59
  "prettier.enable": false,
63
60
  "editor.formatOnSave": false,
package/dist/index.cjs CHANGED
@@ -76,9 +76,9 @@ 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
79
  var GLOB_JSX = "**/*.?([cm])jsx";
81
80
  var GLOB_TS = "**/*.?([cm])ts";
81
+ var GLOB_DTS = "**/*.d.?([cm])ts";
82
82
  var GLOB_TSX = "**/*.?([cm])tsx";
83
83
  var GLOB_VUE = "**/*.vue";
84
84
  var GLOB_ASTRO_TS = "**/*.astro/*.ts";
@@ -127,6 +127,7 @@ var GLOB_EXCLUDE = [
127
127
  "**/.output",
128
128
  "**/.vite-inspect",
129
129
  "**/.yarn",
130
+ "**/vite.config.*.timestamp-*",
130
131
  "**/CHANGELOG*.md",
131
132
  "**/*.min.*",
132
133
  "**/LICENSE*",
@@ -980,23 +981,24 @@ async function typescript(options = {}) {
980
981
  const typeAwareRules = {
981
982
  "dot-notation": "off",
982
983
  "no-implied-eval": "off",
983
- "no-throw-literal": "off",
984
984
  "ts/await-thenable": "error",
985
985
  "ts/dot-notation": ["error", { allowKeywords: true }],
986
986
  "ts/no-floating-promises": "error",
987
987
  "ts/no-for-in-array": "error",
988
988
  "ts/no-implied-eval": "error",
989
989
  "ts/no-misused-promises": "error",
990
- "ts/no-throw-literal": "error",
991
990
  "ts/no-unnecessary-type-assertion": "error",
992
991
  "ts/no-unsafe-argument": "error",
993
992
  "ts/no-unsafe-assignment": "error",
994
993
  "ts/no-unsafe-call": "error",
995
994
  "ts/no-unsafe-member-access": "error",
996
995
  "ts/no-unsafe-return": "error",
996
+ "ts/promise-function-async": "error",
997
997
  "ts/restrict-plus-operands": "error",
998
998
  "ts/restrict-template-expressions": "error",
999
+ "ts/return-await": "error",
999
1000
  "ts/strict-boolean-expressions": "error",
1001
+ "ts/switch-exhaustiveness-check": "error",
1000
1002
  "ts/unbound-method": "error"
1001
1003
  };
1002
1004
  const [pluginTs, parserTs] = await Promise.all([
@@ -1013,7 +1015,10 @@ async function typescript(options = {}) {
1013
1015
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1014
1016
  sourceType: "module",
1015
1017
  ...typeAware ? {
1016
- project: tsconfigPath,
1018
+ projectService: {
1019
+ allowDefaultProject: ["./*.js"],
1020
+ defaultProject: tsconfigPath
1021
+ },
1017
1022
  tsconfigRootDir: import_node_process2.default.cwd()
1018
1023
  } : {},
1019
1024
  ...parserOptions
@@ -1056,7 +1061,6 @@ async function typescript(options = {}) {
1056
1061
  "error",
1057
1062
  { "ts-ignore": "allow-with-description" }
1058
1063
  ],
1059
- "ts/ban-types": ["error", { types: { Function: false } }],
1060
1064
  "ts/consistent-type-definitions": ["error", "interface"],
1061
1065
  "ts/consistent-type-imports": [
1062
1066
  "error",
@@ -1066,6 +1070,7 @@ async function typescript(options = {}) {
1066
1070
  // https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
1067
1071
  "ts/no-dupe-class-members": "error",
1068
1072
  "ts/no-dynamic-delete": "off",
1073
+ "ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
1069
1074
  "ts/no-explicit-any": "off",
1070
1075
  "ts/no-extraneous-class": "off",
1071
1076
  "ts/no-import-type-side-effects": "error",
@@ -1080,6 +1085,7 @@ async function typescript(options = {}) {
1080
1085
  { classes: false, functions: false, variables: true }
1081
1086
  ],
1082
1087
  "ts/no-useless-constructor": "off",
1088
+ "ts/no-wrapper-object-types": "error",
1083
1089
  "ts/prefer-ts-expect-error": "error",
1084
1090
  "ts/triple-slash-reference": "off",
1085
1091
  "ts/unified-signatures": "off",
@@ -1098,7 +1104,7 @@ async function typescript(options = {}) {
1098
1104
  }
1099
1105
  ] : [],
1100
1106
  {
1101
- files: [GLOB_TS],
1107
+ files: [GLOB_DTS],
1102
1108
  name: "coderwyd/typescript/disables/dts",
1103
1109
  rules: {
1104
1110
  "eslint-comments/no-unlimited-disable": "off",
@@ -1489,7 +1495,7 @@ var import_local_pkg3 = require("local-pkg");
1489
1495
  // src/env.ts
1490
1496
  var import_node_process3 = __toESM(require("process"), 1);
1491
1497
  var import_local_pkg2 = require("local-pkg");
1492
- 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);
1498
+ 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.NVIM) && !import_node_process3.default.env.CI);
1493
1499
  var hasTypeScript = (0, import_local_pkg2.isPackageExists)("typescript");
1494
1500
  var VueJsPackages = [
1495
1501
  "vue",
@@ -1514,7 +1520,7 @@ function hasPackages(packages) {
1514
1520
  // src/configs/react.ts
1515
1521
  var ReactRefreshAllowConstantExportPackages = ["vite"];
1516
1522
  async function react(options = {}) {
1517
- const { files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX], overrides = {} } = options;
1523
+ const { files = [GLOB_SRC], overrides = {} } = options;
1518
1524
  await ensurePackages([
1519
1525
  "@eslint-react/eslint-plugin",
1520
1526
  "eslint-plugin-react-hooks",