@coderwyd/eslint-config 2.7.3 → 3.1.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
@@ -10,7 +10,6 @@
10
10
  - ✨ Support Vue, React, Svelte.
11
11
  - 🎯 Designed to work with TypeScript, Vue out-of-box
12
12
  - 🏆 Reasonable defaults, best practices, only one-line of config
13
- - 🎨 Use ESlint to format HTML, CSS, LESS, SCSS, YAML, TOML, Markdown, JSON, JSONC.
14
13
 
15
14
  ## Usage
16
15
 
@@ -59,43 +58,14 @@ Add the following settings to your `.vscode/settings.json`:
59
58
 
60
59
  ```jsonc
61
60
  {
62
- // Disable the default formatter, use eslint instead
63
- "prettier.enable": false,
61
+ "prettier.enable": true,
64
62
  "editor.formatOnSave": false,
65
63
 
66
64
  // Auto fix
67
65
  "editor.codeActionsOnSave": {
68
66
  "source.fixAll": "explicit",
69
- "source.organizeImports": "never"
67
+ "source.organizeImports": "never",
70
68
  },
71
-
72
- // Silent the stylistic rules in you IDE, but still auto fix them
73
- "eslint.rules.customizations": [
74
- { "rule": "style/*", "severity": "off", "fixable": true },
75
- { "rule": "format/*", "severity": "off", "fixable": true },
76
- { "rule": "*-indent", "severity": "off", "fixable": true },
77
- { "rule": "*-spacing", "severity": "off", "fixable": true },
78
- { "rule": "*-spaces", "severity": "off", "fixable": true },
79
- { "rule": "*-order", "severity": "off", "fixable": true },
80
- { "rule": "*-dangle", "severity": "off", "fixable": true },
81
- { "rule": "*-newline", "severity": "off", "fixable": true },
82
- { "rule": "*quotes", "severity": "off", "fixable": true },
83
- { "rule": "*semi", "severity": "off", "fixable": true }
84
- ],
85
-
86
- // Enable eslint for all supported languages
87
- "eslint.validate": [
88
- "html",
89
- "css",
90
- "less",
91
- "scss",
92
- "json",
93
- "jsonc",
94
- "yaml",
95
- "yml",
96
- "markdown",
97
- "toml"
98
- ]
99
69
  }
100
70
  ```
101
71
 
@@ -157,15 +127,6 @@ interface OptionsConfig extends OptionsComponentExts {
157
127
  */
158
128
  typescript?: boolean | OptionsTypescript
159
129
 
160
- /**
161
- * Enable JSX related rules.
162
- *
163
- * Currently only stylistic rules are included.
164
- *
165
- * @default true
166
- */
167
- jsx?: boolean
168
-
169
130
  /**
170
131
  * Enable test support.
171
132
  *
@@ -226,14 +187,6 @@ interface OptionsConfig extends OptionsComponentExts {
226
187
  */
227
188
  unocss?: boolean | OptionsUnoCSS
228
189
 
229
- /**
230
- * Enable stylistic rules.
231
- *
232
- * @see https://eslint.style/
233
- * @default true
234
- */
235
- stylistic?: boolean | (StylisticConfig & OptionsOverrides)
236
-
237
190
  /**
238
191
  * Enable regexp rules.
239
192
  *
@@ -242,23 +195,6 @@ interface OptionsConfig extends OptionsComponentExts {
242
195
  */
243
196
  regexp?: boolean | (OptionsRegExp & OptionsOverrides)
244
197
 
245
- /**
246
- * Use external formatters to format files.
247
- *
248
- * @default
249
- * {
250
- * "html": true,
251
- * "css": true,
252
- * "graphql": false,
253
- * "markdown": false
254
- * "yaml": false
255
- * "toml": false
256
- * }
257
- *
258
- * When set to `true`, it will enable all formatters.
259
- */
260
- formatter?: boolean | OptionsFormatters
261
-
262
198
  /**
263
199
  * Control to disable some rules in editors.
264
200
  * @default auto-detect based on the process.env
package/dist/cli.cjs CHANGED
@@ -37,27 +37,27 @@ var import_helpers = require("yargs/helpers");
37
37
  var import_picocolors = __toESM(require("picocolors"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.7.3";
40
+ var version = "3.1.0";
41
41
  var devDependencies = {
42
42
  "@antfu/ni": "^0.23.0",
43
43
  "@eslint-react/eslint-plugin": "^1.14.2",
44
44
  "@eslint/config-inspector": "^0.5.4",
45
- "@stylistic/eslint-plugin-migrate": "^2.8.0",
45
+ "@types/eslint-config-prettier": "^6.11.3",
46
46
  "@types/fs-extra": "^11.0.4",
47
- "@types/node": "^22.6.1",
47
+ "@types/node": "^22.7.4",
48
48
  "@types/prompts": "^2.4.9",
49
49
  "@types/yargs": "^17.0.33",
50
- "@unocss/eslint-plugin": "^0.62.4",
51
- bumpp: "^9.5.2",
50
+ "@unocss/eslint-plugin": "^0.63.0",
51
+ bumpp: "^9.6.1",
52
52
  eslint: "^9.11.1",
53
53
  "eslint-plugin-react-hooks": "^4.6.2",
54
54
  "eslint-plugin-react-refresh": "^0.4.12",
55
- "eslint-plugin-svelte": "2.43.0",
55
+ "eslint-plugin-svelte": "2.44.1",
56
56
  "eslint-plugin-tailwindcss": "^3.17.4",
57
57
  execa: "^9.4.0",
58
58
  "fast-glob": "^3.3.2",
59
59
  "fs-extra": "^11.2.0",
60
- jiti: "^1.21.6",
60
+ jiti: "^2.0.0",
61
61
  "lint-staged": "^15.2.10",
62
62
  rimraf: "^6.0.1",
63
63
  "simple-git-hooks": "^2.11.1",
@@ -75,46 +75,13 @@ var CROSS = import_picocolors.default.red("\u2718");
75
75
  var WARN = import_picocolors.default.yellow("\u2139");
76
76
  var eslintVersion = devDependencies.eslint;
77
77
  var vscodeSettingsString = `
78
- // Disable the default formatter, use eslint instead
79
- "prettier.enable": false,
80
- "editor.formatOnSave": false,
78
+ "editor.formatOnSave": true,
81
79
 
82
80
  // Auto fix
83
81
  "editor.codeActionsOnSave": {
84
82
  "source.fixAll.eslint": "explicit",
85
83
  "source.organizeImports": "never"
86
84
  },
87
-
88
- // Silent the stylistic rules in you IDE, but still auto fix them
89
- "eslint.rules.customizations": [
90
- { "rule": "style/*", "severity": "off", "fixable": true },
91
- { "rule": "format/*", "severity": "off", "fixable": true },
92
- { "rule": "*-indent", "severity": "off", "fixable": true },
93
- { "rule": "*-spacing", "severity": "off", "fixable": true },
94
- { "rule": "*-spaces", "severity": "off", "fixable": true },
95
- { "rule": "*-order", "severity": "off", "fixable": true },
96
- { "rule": "*-dangle", "severity": "off", "fixable": true },
97
- { "rule": "*-newline", "severity": "off", "fixable": true },
98
- { "rule": "*quotes", "severity": "off", "fixable": true },
99
- { "rule": "*semi", "severity": "off", "fixable": true }
100
- ],
101
-
102
- // Enable eslint for all supported languages
103
- "eslint.validate": [
104
- "svelte",
105
- "html",
106
- "css",
107
- "less",
108
- "scss",
109
- "json",
110
- "jsonc",
111
- "yaml",
112
- "yml",
113
- "markdown",
114
- "toml",
115
- "gql",
116
- "graphql"
117
- ]
118
85
  `;
119
86
 
120
87
  // src/cli/run.ts
@@ -160,16 +127,14 @@ async function run(options = {}) {
160
127
  name: "confirmed",
161
128
  type: "confirm"
162
129
  });
163
- if (!confirmed)
164
- return import_node_process.default.exit(1);
130
+ if (!confirmed) return import_node_process.default.exit(1);
165
131
  }
166
132
  console.log(import_picocolors2.default.cyan(`${ARROW} bumping @coderwyd/eslint-config to v${version}`));
167
133
  const pkgContent = await import_promises.default.readFile(pathPackageJSON, "utf-8");
168
134
  const pkg = JSON.parse(pkgContent);
169
135
  pkg.devDependencies ??= {};
170
136
  pkg.devDependencies["@coderwyd/eslint-config"] = `^${version}`;
171
- if (!pkg.devDependencies.eslint)
172
- pkg.devDependencies.eslint = eslintVersion;
137
+ if (!pkg.devDependencies.eslint) pkg.devDependencies.eslint = eslintVersion;
173
138
  await import_promises.default.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
174
139
  console.log(import_picocolors2.default.green(`${CHECK} changes wrote to package.json`));
175
140
  const eslintIgnores = [];
package/dist/cli.js CHANGED
@@ -8,27 +8,27 @@ import { hideBin } from "yargs/helpers";
8
8
  import c from "picocolors";
9
9
 
10
10
  // package.json
11
- var version = "2.7.3";
11
+ var version = "3.1.0";
12
12
  var devDependencies = {
13
13
  "@antfu/ni": "^0.23.0",
14
14
  "@eslint-react/eslint-plugin": "^1.14.2",
15
15
  "@eslint/config-inspector": "^0.5.4",
16
- "@stylistic/eslint-plugin-migrate": "^2.8.0",
16
+ "@types/eslint-config-prettier": "^6.11.3",
17
17
  "@types/fs-extra": "^11.0.4",
18
- "@types/node": "^22.6.1",
18
+ "@types/node": "^22.7.4",
19
19
  "@types/prompts": "^2.4.9",
20
20
  "@types/yargs": "^17.0.33",
21
- "@unocss/eslint-plugin": "^0.62.4",
22
- bumpp: "^9.5.2",
21
+ "@unocss/eslint-plugin": "^0.63.0",
22
+ bumpp: "^9.6.1",
23
23
  eslint: "^9.11.1",
24
24
  "eslint-plugin-react-hooks": "^4.6.2",
25
25
  "eslint-plugin-react-refresh": "^0.4.12",
26
- "eslint-plugin-svelte": "2.43.0",
26
+ "eslint-plugin-svelte": "2.44.1",
27
27
  "eslint-plugin-tailwindcss": "^3.17.4",
28
28
  execa: "^9.4.0",
29
29
  "fast-glob": "^3.3.2",
30
30
  "fs-extra": "^11.2.0",
31
- jiti: "^1.21.6",
31
+ jiti: "^2.0.0",
32
32
  "lint-staged": "^15.2.10",
33
33
  rimraf: "^6.0.1",
34
34
  "simple-git-hooks": "^2.11.1",
@@ -46,46 +46,13 @@ var CROSS = c.red("\u2718");
46
46
  var WARN = c.yellow("\u2139");
47
47
  var eslintVersion = devDependencies.eslint;
48
48
  var vscodeSettingsString = `
49
- // Disable the default formatter, use eslint instead
50
- "prettier.enable": false,
51
- "editor.formatOnSave": false,
49
+ "editor.formatOnSave": true,
52
50
 
53
51
  // Auto fix
54
52
  "editor.codeActionsOnSave": {
55
53
  "source.fixAll.eslint": "explicit",
56
54
  "source.organizeImports": "never"
57
55
  },
58
-
59
- // Silent the stylistic rules in you IDE, but still auto fix them
60
- "eslint.rules.customizations": [
61
- { "rule": "style/*", "severity": "off", "fixable": true },
62
- { "rule": "format/*", "severity": "off", "fixable": true },
63
- { "rule": "*-indent", "severity": "off", "fixable": true },
64
- { "rule": "*-spacing", "severity": "off", "fixable": true },
65
- { "rule": "*-spaces", "severity": "off", "fixable": true },
66
- { "rule": "*-order", "severity": "off", "fixable": true },
67
- { "rule": "*-dangle", "severity": "off", "fixable": true },
68
- { "rule": "*-newline", "severity": "off", "fixable": true },
69
- { "rule": "*quotes", "severity": "off", "fixable": true },
70
- { "rule": "*semi", "severity": "off", "fixable": true }
71
- ],
72
-
73
- // Enable eslint for all supported languages
74
- "eslint.validate": [
75
- "svelte",
76
- "html",
77
- "css",
78
- "less",
79
- "scss",
80
- "json",
81
- "jsonc",
82
- "yaml",
83
- "yml",
84
- "markdown",
85
- "toml",
86
- "gql",
87
- "graphql"
88
- ]
89
56
  `;
90
57
 
91
58
  // src/cli/run.ts
@@ -131,16 +98,14 @@ async function run(options = {}) {
131
98
  name: "confirmed",
132
99
  type: "confirm"
133
100
  });
134
- if (!confirmed)
135
- return process.exit(1);
101
+ if (!confirmed) return process.exit(1);
136
102
  }
137
103
  console.log(c2.cyan(`${ARROW} bumping @coderwyd/eslint-config to v${version}`));
138
104
  const pkgContent = await fsp.readFile(pathPackageJSON, "utf-8");
139
105
  const pkg = JSON.parse(pkgContent);
140
106
  pkg.devDependencies ??= {};
141
107
  pkg.devDependencies["@coderwyd/eslint-config"] = `^${version}`;
142
- if (!pkg.devDependencies.eslint)
143
- pkg.devDependencies.eslint = eslintVersion;
108
+ if (!pkg.devDependencies.eslint) pkg.devDependencies.eslint = eslintVersion;
144
109
  await fsp.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
145
110
  console.log(c2.green(`${CHECK} changes wrote to package.json`));
146
111
  const eslintIgnores = [];