@antfu/eslint-config 2.4.2 → 2.4.4
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 +3 -0
- package/dist/cli.cjs +17 -8
- package/dist/cli.js +17 -8
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -46,6 +46,9 @@ const antfu = require('@antfu/eslint-config').default
|
|
|
46
46
|
module.exports = antfu()
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
> [!TIP]
|
|
50
|
+
> ESLint only detects `eslint.config.js` as the flat config entry, meaning you need to put `type: module` in your `package.json` or you have to use CJS in `eslint.config.js`. If you want explicit extension like `.mjs` or `.cjs`, or even `eslint.config.ts`, you can install [`eslint-ts-patch`](https://github.com/antfu/eslint-ts-patch) to fix it.
|
|
51
|
+
|
|
49
52
|
Combined with legacy config:
|
|
50
53
|
|
|
51
54
|
```js
|
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.4.
|
|
49
|
+
var version = "2.4.4";
|
|
50
50
|
var devDependencies = {
|
|
51
51
|
"@antfu/eslint-config": "workspace:*",
|
|
52
52
|
"@antfu/eslint-plugin-prettier": "^5.0.1-1",
|
|
@@ -58,13 +58,14 @@ var devDependencies = {
|
|
|
58
58
|
"@types/prompts": "^2.4.9",
|
|
59
59
|
"@types/yargs": "^17.0.32",
|
|
60
60
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
61
|
-
bumpp: "^9.2.
|
|
62
|
-
eslint: "
|
|
61
|
+
bumpp: "^9.2.1",
|
|
62
|
+
eslint: "npm:eslint-ts-patch@^8.55.0-1",
|
|
63
63
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
64
64
|
"eslint-plugin-format": "^0.1.0",
|
|
65
65
|
"eslint-plugin-react": "^7.33.2",
|
|
66
66
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
67
|
"eslint-plugin-react-refresh": "^0.4.5",
|
|
68
|
+
"eslint-ts-patch": "^8.55.0-1",
|
|
68
69
|
esno: "^4.0.0",
|
|
69
70
|
execa: "^8.0.1",
|
|
70
71
|
"fast-glob": "^3.3.2",
|
|
@@ -74,8 +75,8 @@ var devDependencies = {
|
|
|
74
75
|
"simple-git-hooks": "^2.9.0",
|
|
75
76
|
tsup: "^8.0.1",
|
|
76
77
|
typescript: "^5.3.3",
|
|
77
|
-
vitest: "^1.0.
|
|
78
|
-
vue: "^3.3.
|
|
78
|
+
vitest: "^1.0.4",
|
|
79
|
+
vue: "^3.3.11"
|
|
79
80
|
};
|
|
80
81
|
|
|
81
82
|
// src/cli/constants.ts
|
|
@@ -148,10 +149,18 @@ async function run(options = {}) {
|
|
|
148
149
|
const pathESLintIgnore = import_node_path.default.join(cwd, ".eslintignore");
|
|
149
150
|
if (import_node_fs.default.existsSync(pathFlatConfig)) {
|
|
150
151
|
console.log(import_picocolors2.default.yellow(`${WARN} eslint.config.js already exists, migration wizard exited.`));
|
|
151
|
-
return;
|
|
152
|
+
return import_node_process.default.exit(1);
|
|
153
|
+
}
|
|
154
|
+
if (!SKIP_GIT_CHECK && !isGitClean()) {
|
|
155
|
+
const { confirmed } = await (0, import_prompts.default)({
|
|
156
|
+
initial: false,
|
|
157
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?",
|
|
158
|
+
name: "confirmed",
|
|
159
|
+
type: "confirm"
|
|
160
|
+
});
|
|
161
|
+
if (!confirmed)
|
|
162
|
+
return import_node_process.default.exit(1);
|
|
152
163
|
}
|
|
153
|
-
if (!SKIP_GIT_CHECK && !isGitClean())
|
|
154
|
-
throw new Error("There are uncommitted changes in the current repository, please commit them and try again");
|
|
155
164
|
console.log(import_picocolors2.default.cyan(`${ARROW} bumping @antfu/eslint-config to v${version}`));
|
|
156
165
|
const pkgContent = await import_promises.default.readFile(pathPackageJSON, "utf-8");
|
|
157
166
|
const pkg = JSON.parse(pkgContent);
|
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.4.
|
|
20
|
+
var version = "2.4.4";
|
|
21
21
|
var devDependencies = {
|
|
22
22
|
"@antfu/eslint-config": "workspace:*",
|
|
23
23
|
"@antfu/eslint-plugin-prettier": "^5.0.1-1",
|
|
@@ -29,13 +29,14 @@ var devDependencies = {
|
|
|
29
29
|
"@types/prompts": "^2.4.9",
|
|
30
30
|
"@types/yargs": "^17.0.32",
|
|
31
31
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
32
|
-
bumpp: "^9.2.
|
|
33
|
-
eslint: "
|
|
32
|
+
bumpp: "^9.2.1",
|
|
33
|
+
eslint: "npm:eslint-ts-patch@^8.55.0-1",
|
|
34
34
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
35
35
|
"eslint-plugin-format": "^0.1.0",
|
|
36
36
|
"eslint-plugin-react": "^7.33.2",
|
|
37
37
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
38
38
|
"eslint-plugin-react-refresh": "^0.4.5",
|
|
39
|
+
"eslint-ts-patch": "^8.55.0-1",
|
|
39
40
|
esno: "^4.0.0",
|
|
40
41
|
execa: "^8.0.1",
|
|
41
42
|
"fast-glob": "^3.3.2",
|
|
@@ -45,8 +46,8 @@ var devDependencies = {
|
|
|
45
46
|
"simple-git-hooks": "^2.9.0",
|
|
46
47
|
tsup: "^8.0.1",
|
|
47
48
|
typescript: "^5.3.3",
|
|
48
|
-
vitest: "^1.0.
|
|
49
|
-
vue: "^3.3.
|
|
49
|
+
vitest: "^1.0.4",
|
|
50
|
+
vue: "^3.3.11"
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
// src/cli/constants.ts
|
|
@@ -119,10 +120,18 @@ async function run(options = {}) {
|
|
|
119
120
|
const pathESLintIgnore = path.join(cwd, ".eslintignore");
|
|
120
121
|
if (fs.existsSync(pathFlatConfig)) {
|
|
121
122
|
console.log(c2.yellow(`${WARN} eslint.config.js already exists, migration wizard exited.`));
|
|
122
|
-
return;
|
|
123
|
+
return process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
if (!SKIP_GIT_CHECK && !isGitClean()) {
|
|
126
|
+
const { confirmed } = await prompts({
|
|
127
|
+
initial: false,
|
|
128
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?",
|
|
129
|
+
name: "confirmed",
|
|
130
|
+
type: "confirm"
|
|
131
|
+
});
|
|
132
|
+
if (!confirmed)
|
|
133
|
+
return process.exit(1);
|
|
123
134
|
}
|
|
124
|
-
if (!SKIP_GIT_CHECK && !isGitClean())
|
|
125
|
-
throw new Error("There are uncommitted changes in the current repository, please commit them and try again");
|
|
126
135
|
console.log(c2.cyan(`${ARROW} bumping @antfu/eslint-config to v${version}`));
|
|
127
136
|
const pkgContent = await fsp.readFile(pathPackageJSON, "utf-8");
|
|
128
137
|
const pkg = JSON.parse(pkgContent);
|
package/dist/index.cjs
CHANGED
|
@@ -1574,9 +1574,9 @@ async function vue(options = {}) {
|
|
|
1574
1574
|
rules: {
|
|
1575
1575
|
...pluginVue.configs.base.rules,
|
|
1576
1576
|
...vueVersion === 2 ? {
|
|
1577
|
-
...pluginVue.configs
|
|
1578
|
-
...pluginVue.configs["
|
|
1579
|
-
...pluginVue.configs
|
|
1577
|
+
...pluginVue.configs.essential.rules,
|
|
1578
|
+
...pluginVue.configs["strongly-recommended"].rules,
|
|
1579
|
+
...pluginVue.configs.recommended.rules
|
|
1580
1580
|
} : {
|
|
1581
1581
|
...pluginVue.configs["vue3-essential"].rules,
|
|
1582
1582
|
...pluginVue.configs["vue3-strongly-recommended"].rules,
|
package/dist/index.js
CHANGED
|
@@ -1488,9 +1488,9 @@ async function vue(options = {}) {
|
|
|
1488
1488
|
rules: {
|
|
1489
1489
|
...pluginVue.configs.base.rules,
|
|
1490
1490
|
...vueVersion === 2 ? {
|
|
1491
|
-
...pluginVue.configs
|
|
1492
|
-
...pluginVue.configs["
|
|
1493
|
-
...pluginVue.configs
|
|
1491
|
+
...pluginVue.configs.essential.rules,
|
|
1492
|
+
...pluginVue.configs["strongly-recommended"].rules,
|
|
1493
|
+
...pluginVue.configs.recommended.rules
|
|
1494
1494
|
} : {
|
|
1495
1495
|
...pluginVue.configs["vue3-essential"].rules,
|
|
1496
1496
|
...pluginVue.configs["vue3-strongly-recommended"].rules,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antfu/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
5
|
-
"packageManager": "pnpm@8.
|
|
4
|
+
"version": "2.4.4",
|
|
5
|
+
"packageManager": "pnpm@8.12.0",
|
|
6
6
|
"description": "Anthony's ESLint config",
|
|
7
7
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"eslint-plugin-perfectionist": "^2.5.0",
|
|
73
73
|
"eslint-plugin-unicorn": "^49.0.0",
|
|
74
74
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
75
|
-
"eslint-plugin-vitest": "^0.3.
|
|
75
|
+
"eslint-plugin-vitest": "^0.3.13",
|
|
76
76
|
"eslint-plugin-vue": "^9.19.2",
|
|
77
77
|
"eslint-plugin-yml": "^1.10.0",
|
|
78
78
|
"eslint-processor-vue-blocks": "^0.1.1",
|
|
79
|
-
"globals": "^13.
|
|
79
|
+
"globals": "^13.24.0",
|
|
80
80
|
"jsonc-eslint-parser": "^2.4.0",
|
|
81
81
|
"local-pkg": "^0.5.0",
|
|
82
82
|
"parse-gitignore": "^2.0.0",
|
|
@@ -96,13 +96,14 @@
|
|
|
96
96
|
"@types/prompts": "^2.4.9",
|
|
97
97
|
"@types/yargs": "^17.0.32",
|
|
98
98
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
99
|
-
"bumpp": "^9.2.
|
|
100
|
-
"eslint": "
|
|
99
|
+
"bumpp": "^9.2.1",
|
|
100
|
+
"eslint": "npm:eslint-ts-patch@^8.55.0-1",
|
|
101
101
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
102
102
|
"eslint-plugin-format": "^0.1.0",
|
|
103
103
|
"eslint-plugin-react": "^7.33.2",
|
|
104
104
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
105
105
|
"eslint-plugin-react-refresh": "^0.4.5",
|
|
106
|
+
"eslint-ts-patch": "^8.55.0-1",
|
|
106
107
|
"esno": "^4.0.0",
|
|
107
108
|
"execa": "^8.0.1",
|
|
108
109
|
"fast-glob": "^3.3.2",
|
|
@@ -112,9 +113,9 @@
|
|
|
112
113
|
"simple-git-hooks": "^2.9.0",
|
|
113
114
|
"tsup": "^8.0.1",
|
|
114
115
|
"typescript": "^5.3.3",
|
|
115
|
-
"vitest": "^1.0.
|
|
116
|
-
"vue": "^3.3.
|
|
117
|
-
"@antfu/eslint-config": "2.4.
|
|
116
|
+
"vitest": "^1.0.4",
|
|
117
|
+
"vue": "^3.3.11",
|
|
118
|
+
"@antfu/eslint-config": "2.4.4"
|
|
118
119
|
},
|
|
119
120
|
"simple-git-hooks": {
|
|
120
121
|
"pre-commit": "pnpm lint-staged"
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
"stub": "tsup --format esm",
|
|
128
129
|
"dev": "tsup --format esm,cjs --watch & eslint-flat-config-viewer",
|
|
129
130
|
"watch": "tsup --format esm,cjs --watch",
|
|
130
|
-
"lint": "
|
|
131
|
+
"lint": "eslint .",
|
|
131
132
|
"release": "bumpp && pnpm publish",
|
|
132
133
|
"test": "vitest",
|
|
133
134
|
"typecheck": "tsc --noEmit"
|