@ivanmaxlogiudice/eslint-config 1.0.14 → 1.0.15
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 +6 -6
- package/dist/cli.cjs +19 -12
- package/dist/cli.js +19 -12
- package/dist/index.cjs +3 -6
- package/dist/index.js +3 -6
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -91,14 +91,14 @@ For example:
|
|
|
91
91
|
### Migration
|
|
92
92
|
|
|
93
93
|
We provided an experimental CLI tool to help you migrate from the legacy config to the new flat config.
|
|
94
|
-
You can use the `-y` / `--yes` flag to skip the promps and use the default values.
|
|
95
94
|
|
|
96
95
|
```bash
|
|
97
|
-
# npm
|
|
98
|
-
npx @ivanmaxlogiudice/eslint-config@latest -y
|
|
99
|
-
|
|
100
96
|
# pnpm
|
|
101
|
-
|
|
97
|
+
pnpx @ivanmaxlogiudice/eslint-config@latest
|
|
98
|
+
|
|
99
|
+
Options:
|
|
100
|
+
-y, --yes Skip prompts and use default values
|
|
101
|
+
-i, --ignore-git Skip uncommitted changes
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
Before running the migration, make sure to commit your unsaved changes first.
|
|
@@ -417,7 +417,7 @@ export default config({
|
|
|
417
417
|
})
|
|
418
418
|
```
|
|
419
419
|
|
|
420
|
-
Running `
|
|
420
|
+
Running `pnpx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
|
|
421
421
|
|
|
422
422
|
```bash
|
|
423
423
|
pnpm add -D @unocss/eslint-plugin
|
package/dist/cli.cjs
CHANGED
|
@@ -35,15 +35,15 @@ var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
|
35
35
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
36
36
|
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "1.0.
|
|
38
|
+
var version = "1.0.15";
|
|
39
39
|
var devDependencies = {
|
|
40
|
-
"@stylistic/eslint-plugin-migrate": "^1.5.
|
|
40
|
+
"@stylistic/eslint-plugin-migrate": "^1.5.1",
|
|
41
41
|
"@types/eslint": "^8.44.8",
|
|
42
42
|
"@types/fs-extra": "^11.0.4",
|
|
43
|
-
"@types/node": "^20.10.
|
|
43
|
+
"@types/node": "^20.10.4",
|
|
44
44
|
"@types/prompts": "^2.4.9",
|
|
45
45
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
46
|
-
bumpp: "^9.2.
|
|
46
|
+
bumpp: "^9.2.1",
|
|
47
47
|
eslint: "^8.55.0",
|
|
48
48
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
49
49
|
"eslint-plugin-format": "^0.1.0",
|
|
@@ -53,8 +53,8 @@ var devDependencies = {
|
|
|
53
53
|
"lint-staged": "^15.2.0",
|
|
54
54
|
"simple-git-hooks": "^2.9.0",
|
|
55
55
|
tsup: "^8.0.1",
|
|
56
|
-
typescript: "^5.3.
|
|
57
|
-
vitest: "^1.0.
|
|
56
|
+
typescript: "^5.3.3",
|
|
57
|
+
vitest: "^1.0.4",
|
|
58
58
|
vue: "^3.3.11"
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -137,16 +137,25 @@ function isGitClean() {
|
|
|
137
137
|
|
|
138
138
|
// src/cli/run.ts
|
|
139
139
|
async function run(options = {}) {
|
|
140
|
+
console.log(options);
|
|
140
141
|
const SKIP_PROMPT = !!import_node_process2.default.env.SKIP_PROMPT || options.yes;
|
|
141
|
-
const SKIP_GIT_CHECK = !!import_node_process2.default.env.SKIP_GIT_CHECK;
|
|
142
|
+
const SKIP_GIT_CHECK = !!import_node_process2.default.env.SKIP_GIT_CHECK || options.ignoreGit;
|
|
142
143
|
const cwd = import_node_process2.default.cwd();
|
|
143
144
|
const pathPackageJSON = import_node_path.default.join(import_node_process2.default.cwd(), "package.json");
|
|
144
145
|
const pathESLintConfig = import_node_path.default.join(import_node_process2.default.cwd(), "eslint.config.js");
|
|
145
146
|
const pathESLintIngore = import_node_path.default.join(import_node_process2.default.cwd(), ".eslintignore");
|
|
146
147
|
if (import_node_fs.default.existsSync(pathESLintConfig))
|
|
147
148
|
throwError(WARN, "eslint.config.js already exists, migration wizard exited.");
|
|
148
|
-
if (!SKIP_GIT_CHECK && !isGitClean())
|
|
149
|
-
|
|
149
|
+
if (!SKIP_GIT_CHECK && !isGitClean()) {
|
|
150
|
+
const { confirmed } = await (0, import_prompts.default)({
|
|
151
|
+
initial: false,
|
|
152
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?",
|
|
153
|
+
name: "confirmed",
|
|
154
|
+
type: "confirm"
|
|
155
|
+
});
|
|
156
|
+
if (!confirmed)
|
|
157
|
+
throwError(CROSS, "There are uncommitted changes in the current repository, please commit them and try again.");
|
|
158
|
+
}
|
|
150
159
|
console.log(`
|
|
151
160
|
${ARROW} Installing ${import_picocolors3.default.green("@ivanmaxlogiudice/eslint-config")} to v${import_picocolors3.default.yellow(version)}.
|
|
152
161
|
`);
|
|
@@ -283,9 +292,7 @@ ${WARN} You can now remove those dependencies: `);
|
|
|
283
292
|
var cli = (0, import_cac.cac)(
|
|
284
293
|
import_picocolors4.default.green("@ivanmaxlogiudice/eslint-config")
|
|
285
294
|
);
|
|
286
|
-
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).action(run);
|
|
295
|
+
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).option("-i, --ignore-git", "Skip uncommitted changes", { type: [Boolean] }).action(run);
|
|
287
296
|
cli.help();
|
|
288
297
|
cli.version(`${import_picocolors4.default.bold(version)}`);
|
|
289
298
|
cli.parse();
|
|
290
|
-
if (!cli.matchedCommand)
|
|
291
|
-
cli.outputHelp();
|
package/dist/cli.js
CHANGED
|
@@ -6,15 +6,15 @@ import c4 from "picocolors";
|
|
|
6
6
|
import c from "picocolors";
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
|
-
var version = "1.0.
|
|
9
|
+
var version = "1.0.15";
|
|
10
10
|
var devDependencies = {
|
|
11
|
-
"@stylistic/eslint-plugin-migrate": "^1.5.
|
|
11
|
+
"@stylistic/eslint-plugin-migrate": "^1.5.1",
|
|
12
12
|
"@types/eslint": "^8.44.8",
|
|
13
13
|
"@types/fs-extra": "^11.0.4",
|
|
14
|
-
"@types/node": "^20.10.
|
|
14
|
+
"@types/node": "^20.10.4",
|
|
15
15
|
"@types/prompts": "^2.4.9",
|
|
16
16
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
17
|
-
bumpp: "^9.2.
|
|
17
|
+
bumpp: "^9.2.1",
|
|
18
18
|
eslint: "^8.55.0",
|
|
19
19
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
20
20
|
"eslint-plugin-format": "^0.1.0",
|
|
@@ -24,8 +24,8 @@ var devDependencies = {
|
|
|
24
24
|
"lint-staged": "^15.2.0",
|
|
25
25
|
"simple-git-hooks": "^2.9.0",
|
|
26
26
|
tsup: "^8.0.1",
|
|
27
|
-
typescript: "^5.3.
|
|
28
|
-
vitest: "^1.0.
|
|
27
|
+
typescript: "^5.3.3",
|
|
28
|
+
vitest: "^1.0.4",
|
|
29
29
|
vue: "^3.3.11"
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -108,16 +108,25 @@ function isGitClean() {
|
|
|
108
108
|
|
|
109
109
|
// src/cli/run.ts
|
|
110
110
|
async function run(options = {}) {
|
|
111
|
+
console.log(options);
|
|
111
112
|
const SKIP_PROMPT = !!process2.env.SKIP_PROMPT || options.yes;
|
|
112
|
-
const SKIP_GIT_CHECK = !!process2.env.SKIP_GIT_CHECK;
|
|
113
|
+
const SKIP_GIT_CHECK = !!process2.env.SKIP_GIT_CHECK || options.ignoreGit;
|
|
113
114
|
const cwd = process2.cwd();
|
|
114
115
|
const pathPackageJSON = path.join(process2.cwd(), "package.json");
|
|
115
116
|
const pathESLintConfig = path.join(process2.cwd(), "eslint.config.js");
|
|
116
117
|
const pathESLintIngore = path.join(process2.cwd(), ".eslintignore");
|
|
117
118
|
if (fs.existsSync(pathESLintConfig))
|
|
118
119
|
throwError(WARN, "eslint.config.js already exists, migration wizard exited.");
|
|
119
|
-
if (!SKIP_GIT_CHECK && !isGitClean())
|
|
120
|
-
|
|
120
|
+
if (!SKIP_GIT_CHECK && !isGitClean()) {
|
|
121
|
+
const { confirmed } = await prompts({
|
|
122
|
+
initial: false,
|
|
123
|
+
message: "There are uncommitted changes in the current repository, are you sure to continue?",
|
|
124
|
+
name: "confirmed",
|
|
125
|
+
type: "confirm"
|
|
126
|
+
});
|
|
127
|
+
if (!confirmed)
|
|
128
|
+
throwError(CROSS, "There are uncommitted changes in the current repository, please commit them and try again.");
|
|
129
|
+
}
|
|
121
130
|
console.log(`
|
|
122
131
|
${ARROW} Installing ${c3.green("@ivanmaxlogiudice/eslint-config")} to v${c3.yellow(version)}.
|
|
123
132
|
`);
|
|
@@ -254,9 +263,7 @@ ${WARN} You can now remove those dependencies: `);
|
|
|
254
263
|
var cli = cac(
|
|
255
264
|
c4.green("@ivanmaxlogiudice/eslint-config")
|
|
256
265
|
);
|
|
257
|
-
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).action(run);
|
|
266
|
+
cli.command("", "Run the initialization or migration").option("-y, --yes", "Skip prompts and use default values", { type: [Boolean] }).option("-i, --ignore-git", "Skip uncommitted changes", { type: [Boolean] }).action(run);
|
|
258
267
|
cli.help();
|
|
259
268
|
cli.version(`${c4.bold(version)}`);
|
|
260
269
|
cli.parse();
|
|
261
|
-
if (!cli.matchedCommand)
|
|
262
|
-
cli.outputHelp();
|
package/dist/index.cjs
CHANGED
|
@@ -1107,15 +1107,11 @@ function sortPackageJson() {
|
|
|
1107
1107
|
},
|
|
1108
1108
|
{
|
|
1109
1109
|
order: { type: "asc" },
|
|
1110
|
-
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies
|
|
1110
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
1111
1111
|
},
|
|
1112
1112
|
{
|
|
1113
1113
|
order: { type: "asc" },
|
|
1114
|
-
pathPattern: "^resolutions$"
|
|
1115
|
-
},
|
|
1116
|
-
{
|
|
1117
|
-
order: { type: "asc" },
|
|
1118
|
-
pathPattern: "^pnpm.overrides$"
|
|
1114
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
1119
1115
|
},
|
|
1120
1116
|
{
|
|
1121
1117
|
order: [
|
|
@@ -1293,6 +1289,7 @@ async function test(options = {}) {
|
|
|
1293
1289
|
"node/prefer-global/process": "off",
|
|
1294
1290
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1295
1291
|
"test/no-identical-title": "error",
|
|
1292
|
+
"test/no-import-node-test": "error",
|
|
1296
1293
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
|
1297
1294
|
"test/prefer-hooks-in-order": "error",
|
|
1298
1295
|
"test/prefer-lowercase-title": "error",
|
package/dist/index.js
CHANGED
|
@@ -1019,15 +1019,11 @@ function sortPackageJson() {
|
|
|
1019
1019
|
},
|
|
1020
1020
|
{
|
|
1021
1021
|
order: { type: "asc" },
|
|
1022
|
-
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies
|
|
1022
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
1023
1023
|
},
|
|
1024
1024
|
{
|
|
1025
1025
|
order: { type: "asc" },
|
|
1026
|
-
pathPattern: "^resolutions$"
|
|
1027
|
-
},
|
|
1028
|
-
{
|
|
1029
|
-
order: { type: "asc" },
|
|
1030
|
-
pathPattern: "^pnpm.overrides$"
|
|
1026
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
1031
1027
|
},
|
|
1032
1028
|
{
|
|
1033
1029
|
order: [
|
|
@@ -1205,6 +1201,7 @@ async function test(options = {}) {
|
|
|
1205
1201
|
"node/prefer-global/process": "off",
|
|
1206
1202
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1207
1203
|
"test/no-identical-title": "error",
|
|
1204
|
+
"test/no-import-node-test": "error",
|
|
1208
1205
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
|
1209
1206
|
"test/prefer-hooks-in-order": "error",
|
|
1210
1207
|
"test/prefer-lowercase-title": "error",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ivanmaxlogiudice/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"packageManager": "pnpm@8.
|
|
3
|
+
"version": "1.0.15",
|
|
4
|
+
"packageManager": "pnpm@8.12.0",
|
|
5
5
|
"description": "Personal ESLint config",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"eslint-plugin-format": "^0.0.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
|
-
"eslint-plugin
|
|
41
|
+
"@unocss/eslint-plugin": {
|
|
42
42
|
"optional": true
|
|
43
43
|
},
|
|
44
|
-
"
|
|
44
|
+
"eslint-plugin-format": {
|
|
45
45
|
"optional": true
|
|
46
46
|
}
|
|
47
47
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@eslint-types/jsdoc": "46.9.0",
|
|
52
52
|
"@eslint-types/typescript-eslint": "^6.12.0",
|
|
53
53
|
"@eslint-types/unicorn": "^49.0.0",
|
|
54
|
-
"@stylistic/eslint-plugin": "^1.5.
|
|
54
|
+
"@stylistic/eslint-plugin": "^1.5.1",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
56
56
|
"@typescript-eslint/parser": "^6.13.2",
|
|
57
57
|
"cac": "^6.7.14",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
"eslint-plugin-jsdoc": "^46.9.0",
|
|
66
66
|
"eslint-plugin-jsonc": "^2.10.0",
|
|
67
67
|
"eslint-plugin-markdown": "^3.0.1",
|
|
68
|
-
"eslint-plugin-n": "^16.
|
|
68
|
+
"eslint-plugin-n": "^16.4.0",
|
|
69
69
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
70
70
|
"eslint-plugin-perfectionist": "^2.5.0",
|
|
71
71
|
"eslint-plugin-promise": "^6.1.1",
|
|
72
72
|
"eslint-plugin-unicorn": "^49.0.0",
|
|
73
73
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
74
|
-
"eslint-plugin-vitest": "^0.3.
|
|
74
|
+
"eslint-plugin-vitest": "^0.3.15",
|
|
75
75
|
"eslint-plugin-vue": "^9.19.2",
|
|
76
76
|
"eslint-plugin-yml": "^1.10.0",
|
|
77
77
|
"eslint-processor-vue-blocks": "^0.1.1",
|
|
78
|
-
"globals": "^13.
|
|
78
|
+
"globals": "^13.24.0",
|
|
79
79
|
"jsonc-eslint-parser": "^2.4.0",
|
|
80
80
|
"local-pkg": "^0.5.0",
|
|
81
81
|
"parse-gitignore": "^2.0.0",
|
|
@@ -85,13 +85,13 @@
|
|
|
85
85
|
"yaml-eslint-parser": "^1.2.2"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@stylistic/eslint-plugin-migrate": "^1.5.
|
|
88
|
+
"@stylistic/eslint-plugin-migrate": "^1.5.1",
|
|
89
89
|
"@types/eslint": "^8.44.8",
|
|
90
90
|
"@types/fs-extra": "^11.0.4",
|
|
91
|
-
"@types/node": "^20.10.
|
|
91
|
+
"@types/node": "^20.10.4",
|
|
92
92
|
"@types/prompts": "^2.4.9",
|
|
93
93
|
"@unocss/eslint-plugin": "^0.58.0",
|
|
94
|
-
"bumpp": "^9.2.
|
|
94
|
+
"bumpp": "^9.2.1",
|
|
95
95
|
"eslint": "^8.55.0",
|
|
96
96
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
97
97
|
"eslint-plugin-format": "^0.1.0",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"lint-staged": "^15.2.0",
|
|
102
102
|
"simple-git-hooks": "^2.9.0",
|
|
103
103
|
"tsup": "^8.0.1",
|
|
104
|
-
"typescript": "^5.3.
|
|
105
|
-
"vitest": "^1.0.
|
|
104
|
+
"typescript": "^5.3.3",
|
|
105
|
+
"vitest": "^1.0.4",
|
|
106
106
|
"vue": "^3.3.11"
|
|
107
107
|
},
|
|
108
108
|
"engines": {
|