Skip to content

Commit 9b3cfcf

Browse files
committed
fix(cli-plugin-eslint): make eslint deps optional
1. In @vue/cli-plugin-eslint 3.1.0+, eslint will be explicitly added to the project's package.json, so it is **optional**. 2. `optionalDependencies` will still be installed by npm by default, just no longer cause installation to fail when error happens. 3. ESLint v4 did cause weird errors sometimes, like `npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed.` Though this warning never caused any errors on my machine, I think it's good to make the plugin fail-safe.
1 parent 554670b commit 9b3cfcf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/@vue/cli-plugin-eslint/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
"dependencies": {
2525
"@vue/cli-shared-utils": "^3.2.0",
2626
"babel-eslint": "^10.0.1",
27-
"eslint": "^4.19.1",
2827
"eslint-loader": "^2.1.1",
29-
"eslint-plugin-vue": "^4.7.1",
3028
"globby": "^8.0.1"
29+
},
30+
"optionalDependencies": {
31+
"eslint": "^4.19.1",
32+
"eslint-plugin-vue": "^4.7.1"
3133
}
3234
}

packages/@vue/cli-service-global/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
"@vue/cli-service": "^3.2.0",
2828
"babel-eslint": "^10.0.1",
2929
"chalk": "^2.4.1",
30+
"eslint": "^4.19.1",
31+
"eslint-plugin-vue": "^4.7.1",
3032
"resolve": "^1.8.1",
3133
"vue": "^2.5.17",
3234
"vue-template-compiler": "^2.5.17"

0 commit comments

Comments
 (0)