@coderwyd/eslint-config 2.2.0 → 2.2.2

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
@@ -218,9 +218,6 @@ interface OptionsConfig {
218
218
  /**
219
219
  * Use external formatters to format files.
220
220
  *
221
- * Requires installing:
222
- * - `eslint-plugin-prettier`
223
- *
224
221
  * @default
225
222
  * {
226
223
  * "html": true,
package/dist/cli.cjs CHANGED
@@ -46,31 +46,31 @@ 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.2.0";
49
+ var version = "2.2.2";
50
50
  var devDependencies = {
51
51
  "@antfu/ni": "^0.21.12",
52
- "@types/eslint": "^8.56.2",
52
+ "@types/eslint": "^8.56.5",
53
53
  "@types/fs-extra": "^11.0.4",
54
- "@types/node": "^20.11.19",
54
+ "@types/node": "^20.11.25",
55
55
  "@types/prompts": "^2.4.9",
56
56
  "@types/yargs": "^17.0.32",
57
57
  "@unocss/eslint-plugin": "^0.58.5",
58
- bumpp: "^9.3.0",
59
- eslint: "^8.56.0",
58
+ bumpp: "^9.4.0",
59
+ eslint: "^8.57.0",
60
60
  "eslint-flat-config-viewer": "^0.1.11",
61
- "eslint-plugin-react": "^7.33.2",
61
+ "eslint-plugin-react": "^7.34.0",
62
62
  "eslint-plugin-react-hooks": "^4.6.0",
63
63
  "eslint-plugin-react-refresh": "^0.4.5",
64
64
  "eslint-plugin-svelte": "^2.35.1",
65
- esno: "^4.0.0",
66
65
  execa: "^8.0.1",
67
66
  "fast-glob": "^3.3.2",
68
67
  "fs-extra": "^11.2.0",
69
68
  "lint-staged": "^15.2.2",
70
69
  rimraf: "^5.0.5",
71
- "simple-git-hooks": "^2.9.0",
70
+ "simple-git-hooks": "^2.10.0",
72
71
  "svelte-eslint-parser": "^0.33.1",
73
72
  tsup: "^8.0.2",
73
+ tsx: "^4.7.1",
74
74
  typescript: "^5.3.3"
75
75
  };
76
76
 
@@ -196,7 +196,7 @@ ${coderwydConfig}
196
196
  const files = import_node_fs.default.readdirSync(cwd);
197
197
  const legacyConfig = [];
198
198
  files.forEach((file) => {
199
- if (file.includes("eslint") || file.includes("prettier"))
199
+ if (/eslint|prettier/.test(file) && !/eslint.config./.test(file))
200
200
  legacyConfig.push(file);
201
201
  });
202
202
  if (legacyConfig.length > 0) {
package/dist/cli.js CHANGED
@@ -17,31 +17,31 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.2.0";
20
+ var version = "2.2.2";
21
21
  var devDependencies = {
22
22
  "@antfu/ni": "^0.21.12",
23
- "@types/eslint": "^8.56.2",
23
+ "@types/eslint": "^8.56.5",
24
24
  "@types/fs-extra": "^11.0.4",
25
- "@types/node": "^20.11.19",
25
+ "@types/node": "^20.11.25",
26
26
  "@types/prompts": "^2.4.9",
27
27
  "@types/yargs": "^17.0.32",
28
28
  "@unocss/eslint-plugin": "^0.58.5",
29
- bumpp: "^9.3.0",
30
- eslint: "^8.56.0",
29
+ bumpp: "^9.4.0",
30
+ eslint: "^8.57.0",
31
31
  "eslint-flat-config-viewer": "^0.1.11",
32
- "eslint-plugin-react": "^7.33.2",
32
+ "eslint-plugin-react": "^7.34.0",
33
33
  "eslint-plugin-react-hooks": "^4.6.0",
34
34
  "eslint-plugin-react-refresh": "^0.4.5",
35
35
  "eslint-plugin-svelte": "^2.35.1",
36
- esno: "^4.0.0",
37
36
  execa: "^8.0.1",
38
37
  "fast-glob": "^3.3.2",
39
38
  "fs-extra": "^11.2.0",
40
39
  "lint-staged": "^15.2.2",
41
40
  rimraf: "^5.0.5",
42
- "simple-git-hooks": "^2.9.0",
41
+ "simple-git-hooks": "^2.10.0",
43
42
  "svelte-eslint-parser": "^0.33.1",
44
43
  tsup: "^8.0.2",
44
+ tsx: "^4.7.1",
45
45
  typescript: "^5.3.3"
46
46
  };
47
47
 
@@ -167,7 +167,7 @@ ${coderwydConfig}
167
167
  const files = fs.readdirSync(cwd);
168
168
  const legacyConfig = [];
169
169
  files.forEach((file) => {
170
- if (file.includes("eslint") || file.includes("prettier"))
170
+ if (/eslint|prettier/.test(file) && !/eslint.config./.test(file))
171
171
  legacyConfig.push(file);
172
172
  });
173
173
  if (legacyConfig.length > 0) {
package/dist/index.cjs CHANGED
@@ -124,6 +124,7 @@ var GLOB_EXCLUDE = [
124
124
  "**/.cache",
125
125
  "**/.output",
126
126
  "**/.vite-inspect",
127
+ "**/.yarn",
127
128
  "**/CHANGELOG*.md",
128
129
  "**/*.min.*",
129
130
  "**/LICENSE*",
@@ -240,6 +241,8 @@ async function javascript(options = {}) {
240
241
  "default-case-last": "error",
241
242
  "dot-notation": ["error", { allowKeywords: true }],
242
243
  eqeqeq: ["error", "smart"],
244
+ "for-direction": "error",
245
+ "getter-return": "error",
243
246
  "new-cap": [
244
247
  "error",
245
248
  { capIsNew: false, newIsCap: true, properties: true }
@@ -254,6 +257,8 @@ async function javascript(options = {}) {
254
257
  "no-cond-assign": ["error", "always"],
255
258
  "no-console": ["error", { allow: ["warn", "error"] }],
256
259
  "no-const-assign": "error",
260
+ "no-constant-binary-expression": "error",
261
+ "no-constant-condition": "error",
257
262
  "no-control-regex": "error",
258
263
  "no-debugger": "error",
259
264
  "no-delete-var": "error",
@@ -1161,6 +1166,26 @@ async function vue(options = {}) {
1161
1166
  }, {});
1162
1167
  return [
1163
1168
  {
1169
+ // This allows Vue plugin to work with auto imports
1170
+ // https://github.com/vuejs/eslint-plugin-vue/pull/2422
1171
+ languageOptions: {
1172
+ globals: {
1173
+ computed: "readonly",
1174
+ defineEmits: "readonly",
1175
+ defineExpose: "readonly",
1176
+ defineProps: "readonly",
1177
+ onMounted: "readonly",
1178
+ onUnmounted: "readonly",
1179
+ reactive: "readonly",
1180
+ ref: "readonly",
1181
+ shallowReactive: "readonly",
1182
+ shallowRef: "readonly",
1183
+ toRef: "readonly",
1184
+ toRefs: "readonly",
1185
+ watch: "readonly",
1186
+ watchEffect: "readonly"
1187
+ }
1188
+ },
1164
1189
  name: "coderwyd:vue:setup",
1165
1190
  plugins: {
1166
1191
  vue: pluginVue
@@ -1682,7 +1707,7 @@ async function tailwindcss(options = {}) {
1682
1707
  // src/env.ts
1683
1708
  var import_node_process3 = __toESM(require("process"), 1);
1684
1709
  var import_local_pkg3 = require("local-pkg");
1685
- var isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI);
1710
+ 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);
1686
1711
  var hasTypeScript = (0, import_local_pkg3.isPackageExists)("typescript");
1687
1712
  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");
1688
1713
  var hasUnocss = (0, import_local_pkg3.isPackageExists)("unocss") || (0, import_local_pkg3.isPackageExists)("@unocss/webpack") || (0, import_local_pkg3.isPackageExists)("@unocss/nuxt");
package/dist/index.js CHANGED
@@ -90,6 +90,7 @@ var GLOB_EXCLUDE = [
90
90
  "**/.cache",
91
91
  "**/.output",
92
92
  "**/.vite-inspect",
93
+ "**/.yarn",
93
94
  "**/CHANGELOG*.md",
94
95
  "**/*.min.*",
95
96
  "**/LICENSE*",
@@ -206,6 +207,8 @@ async function javascript(options = {}) {
206
207
  "default-case-last": "error",
207
208
  "dot-notation": ["error", { allowKeywords: true }],
208
209
  eqeqeq: ["error", "smart"],
210
+ "for-direction": "error",
211
+ "getter-return": "error",
209
212
  "new-cap": [
210
213
  "error",
211
214
  { capIsNew: false, newIsCap: true, properties: true }
@@ -220,6 +223,8 @@ async function javascript(options = {}) {
220
223
  "no-cond-assign": ["error", "always"],
221
224
  "no-console": ["error", { allow: ["warn", "error"] }],
222
225
  "no-const-assign": "error",
226
+ "no-constant-binary-expression": "error",
227
+ "no-constant-condition": "error",
223
228
  "no-control-regex": "error",
224
229
  "no-debugger": "error",
225
230
  "no-delete-var": "error",
@@ -1127,6 +1132,26 @@ async function vue(options = {}) {
1127
1132
  }, {});
1128
1133
  return [
1129
1134
  {
1135
+ // This allows Vue plugin to work with auto imports
1136
+ // https://github.com/vuejs/eslint-plugin-vue/pull/2422
1137
+ languageOptions: {
1138
+ globals: {
1139
+ computed: "readonly",
1140
+ defineEmits: "readonly",
1141
+ defineExpose: "readonly",
1142
+ defineProps: "readonly",
1143
+ onMounted: "readonly",
1144
+ onUnmounted: "readonly",
1145
+ reactive: "readonly",
1146
+ ref: "readonly",
1147
+ shallowReactive: "readonly",
1148
+ shallowRef: "readonly",
1149
+ toRef: "readonly",
1150
+ toRefs: "readonly",
1151
+ watch: "readonly",
1152
+ watchEffect: "readonly"
1153
+ }
1154
+ },
1130
1155
  name: "coderwyd:vue:setup",
1131
1156
  plugins: {
1132
1157
  vue: pluginVue
@@ -1648,7 +1673,7 @@ async function tailwindcss(options = {}) {
1648
1673
  // src/env.ts
1649
1674
  import process3 from "node:process";
1650
1675
  import { isPackageExists as isPackageExists3 } from "local-pkg";
1651
- var isInEditor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI);
1676
+ var isInEditor = !!((process3.env.VSCODE_PID || process3.env.VSCODE_CWD || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI);
1652
1677
  var hasTypeScript = isPackageExists3("typescript");
1653
1678
  var hasVue = isPackageExists3("vue") || isPackageExists3("nuxt") || isPackageExists3("vitepress") || isPackageExists3("@slidev/cli");
1654
1679
  var hasUnocss = isPackageExists3("unocss") || isPackageExists3("@unocss/webpack") || isPackageExists3("@unocss/nuxt");
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "2.2.0",
5
- "packageManager": "pnpm@8.15.3",
4
+ "version": "2.2.2",
5
+ "packageManager": "pnpm@8.15.4",
6
6
  "description": "Donny's ESLint config",
7
7
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
8
8
  "license": "MIT",
@@ -68,28 +68,28 @@
68
68
  "dependencies": {
69
69
  "@antfu/eslint-define-config": "1.23.0-2",
70
70
  "@antfu/install-pkg": "^0.3.1",
71
- "@eslint-types/jsdoc": "48.0.6",
72
- "@eslint-types/typescript-eslint": "^6.21.0",
71
+ "@eslint-types/jsdoc": "48.2.0",
72
+ "@eslint-types/typescript-eslint": "^7.0.2",
73
73
  "@eslint-types/unicorn": "^51.0.1",
74
74
  "@toml-tools/parser": "^1.0.0",
75
- "@typescript-eslint/eslint-plugin": "^7.0.1",
76
- "@typescript-eslint/parser": "^7.0.1",
75
+ "@typescript-eslint/eslint-plugin": "^7.1.1",
76
+ "@typescript-eslint/parser": "^7.1.1",
77
77
  "eslint-config-flat-gitignore": "^0.1.3",
78
78
  "eslint-config-prettier": "^9.1.0",
79
79
  "eslint-plugin-antfu": "^2.1.2",
80
80
  "eslint-plugin-eslint-comments": "^3.2.0",
81
81
  "eslint-plugin-i": "^2.29.1",
82
- "eslint-plugin-jsdoc": "^48.1.0",
82
+ "eslint-plugin-jsdoc": "^48.2.1",
83
83
  "eslint-plugin-jsonc": "^2.13.0",
84
84
  "eslint-plugin-n": "^16.6.2",
85
85
  "eslint-plugin-no-only-tests": "^3.1.0",
86
- "eslint-plugin-perfectionist": "^2.5.0",
86
+ "eslint-plugin-perfectionist": "^2.6.0",
87
87
  "eslint-plugin-prettier": "^5.1.3",
88
- "eslint-plugin-tailwindcss": "^3.14.2",
88
+ "eslint-plugin-tailwindcss": "^3.14.3",
89
89
  "eslint-plugin-unicorn": "^51.0.1",
90
- "eslint-plugin-unused-imports": "^3.0.0",
91
- "eslint-plugin-vitest": "^0.3.22",
92
- "eslint-plugin-vue": "^9.21.1",
90
+ "eslint-plugin-unused-imports": "^3.1.0",
91
+ "eslint-plugin-vitest": "^0.3.25",
92
+ "eslint-plugin-vue": "^9.23.0",
93
93
  "globals": "^14.0.0",
94
94
  "jsonc-eslint-parser": "^2.4.0",
95
95
  "local-pkg": "^0.5.0",
@@ -103,28 +103,28 @@
103
103
  },
104
104
  "devDependencies": {
105
105
  "@antfu/ni": "^0.21.12",
106
- "@types/eslint": "^8.56.2",
106
+ "@types/eslint": "^8.56.5",
107
107
  "@types/fs-extra": "^11.0.4",
108
- "@types/node": "^20.11.19",
108
+ "@types/node": "^20.11.25",
109
109
  "@types/prompts": "^2.4.9",
110
110
  "@types/yargs": "^17.0.32",
111
111
  "@unocss/eslint-plugin": "^0.58.5",
112
- "bumpp": "^9.3.0",
113
- "eslint": "^8.56.0",
112
+ "bumpp": "^9.4.0",
113
+ "eslint": "^8.57.0",
114
114
  "eslint-flat-config-viewer": "^0.1.11",
115
- "eslint-plugin-react": "^7.33.2",
115
+ "eslint-plugin-react": "^7.34.0",
116
116
  "eslint-plugin-react-hooks": "^4.6.0",
117
117
  "eslint-plugin-react-refresh": "^0.4.5",
118
118
  "eslint-plugin-svelte": "^2.35.1",
119
- "esno": "^4.0.0",
120
119
  "execa": "^8.0.1",
121
120
  "fast-glob": "^3.3.2",
122
121
  "fs-extra": "^11.2.0",
123
122
  "lint-staged": "^15.2.2",
124
123
  "rimraf": "^5.0.5",
125
- "simple-git-hooks": "^2.9.0",
124
+ "simple-git-hooks": "^2.10.0",
126
125
  "svelte-eslint-parser": "^0.33.1",
127
126
  "tsup": "^8.0.2",
127
+ "tsx": "^4.7.1",
128
128
  "typescript": "^5.3.3"
129
129
  },
130
130
  "simple-git-hooks": {