diff --git a/packages/@vue/cli-plugin-eslint/index.js b/packages/@vue/cli-plugin-eslint/index.js index 22f028cb60..c8f247ad67 100644 --- a/packages/@vue/cli-plugin-eslint/index.js +++ b/packages/@vue/cli-plugin-eslint/index.js @@ -25,8 +25,11 @@ module.exports = (api, options) => { api.chainWebpack(webpackConfig => { const { lintOnSave } = options - const allWarnings = lintOnSave === true || lintOnSave === 'warning' - const allErrors = lintOnSave === 'error' + const treatAllAsWarnings = lintOnSave === true || lintOnSave === 'warning' + const treatAllAsErrors = lintOnSave === 'error' + + const failOnWarning = treatAllAsErrors + const failOnError = !treatAllAsWarnings /** @type {import('eslint-webpack-plugin').Options & import('eslint').ESLint.Options} */ const eslintWebpackPluginOptions = { @@ -44,10 +47,10 @@ module.exports = (api, options) => { }), // plugin options context: cwd, - // https://github.com/webpack-contrib/eslint-webpack-plugin/issues/56 - threads: false, - emitWarning: allWarnings, - emitError: allErrors, + + failOnWarning, + failOnError, + eslintPath: path.dirname( resolveModule('eslint/package.json', cwd) || resolveModule('eslint/package.json', __dirname) diff --git a/packages/@vue/cli-plugin-eslint/package.json b/packages/@vue/cli-plugin-eslint/package.json index 1fba1a3a5e..9ef1eae886 100644 --- a/packages/@vue/cli-plugin-eslint/package.json +++ b/packages/@vue/cli-plugin-eslint/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@vue/cli-shared-utils": "^5.0.0-beta.7", - "eslint-webpack-plugin": "2.4.3", + "eslint-webpack-plugin": "^3.1.0", "globby": "^11.0.2", "inquirer": "^8.0.0", "webpack": "^5.22.0", diff --git a/yarn.lock b/yarn.lock index 55a16a56fb..6873da4360 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3238,7 +3238,7 @@ "@types/eslint" "*" "@types/estree" "*" -"@types/eslint@*", "@types/eslint@^7.2.4": +"@types/eslint@*": version "7.28.1" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.28.1.tgz#50b07747f1f84c2ba8cd394cf0fe0ba07afce320" integrity sha512-XhZKznR3i/W5dXqUhgU9fFdJekufbeBd5DALmkuXoeFcjbQcPk+2cL+WLHf6Q81HWAnM2vrslIHpGVyCAviRwg== @@ -3246,6 +3246,14 @@ "@types/estree" "*" "@types/json-schema" "*" +"@types/eslint@^7.28.2": + version "7.28.2" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.28.2.tgz#0ff2947cdd305897c52d5372294e8c76f351db68" + integrity sha512-KubbADPkfoU75KgKeKLsFHXnU4ipH7wYg0TRT33NK3N3yiu7jlFAAoygIWBV+KbuHx/G+AvuGX6DllnK35gfJA== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + "@types/estree@*", "@types/estree@^0.0.50": version "0.0.50" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" @@ -9787,16 +9795,16 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-webpack-plugin@2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-2.4.3.tgz#59afc76ab747e47fcc3ccd05375b58cbc5a034d5" - integrity sha512-+15ifHFkGn0gB7lQBe+xgyKcjelxv9xlTutGHEPYBUUj+1Rjrjq3+1REJLJpyAHgpQTatpqkRY1z8gQuyn3Aww== +eslint-webpack-plugin@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-3.1.0.tgz#86ee426f076e2d82f9d9eaab12db1de4311c35b2" + integrity sha512-1UTDzwN5br3z3E2bzhuNtjbSsW2EJiIEGdxH8uWRbOsTEEY0zw8QYGHLeQQrClMWO0gD9QuB5uDh6uQ8tbbv5A== dependencies: - "@types/eslint" "^7.2.4" - arrify "^2.0.1" - jest-worker "^26.6.2" - micromatch "^4.0.2" - schema-utils "^3.0.0" + "@types/eslint" "^7.28.2" + jest-worker "^27.3.1" + micromatch "^4.0.4" + normalize-path "^3.0.0" + schema-utils "^3.1.1" eslint@^7.32.0: version "7.32.0" @@ -10447,14 +10455,6 @@ file-loader@^3.0.1: loader-utils "^1.0.2" schema-utils "^1.0.0" -file-loader@^6.1.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" - integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== - dependencies: - loader-utils "^2.0.0" - schema-utils "^3.0.0" - file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" @@ -13680,7 +13680,7 @@ jest-watcher@^27.0.0, jest-watcher@^27.2.5: jest-util "^27.2.5" string-length "^4.0.1" -jest-worker@^26.2.1, jest-worker@^26.6.2: +jest-worker@^26.2.1: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== @@ -13698,6 +13698,15 @@ jest-worker@^27.0.2, jest-worker@^27.0.6, jest-worker@^27.2.5: merge-stream "^2.0.0" supports-color "^8.0.0" +jest-worker@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" + integrity sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + jest@^27.0.6, jest@^27.1.0: version "27.2.5" resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.5.tgz#7d8a5c8781a160f693beeb7c68e46c16ef948148" @@ -21716,15 +21725,6 @@ url-loader@^1.0.1: mime "^2.0.3" schema-utils "^1.0.0" -url-loader@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.1.tgz#28505e905cae158cf07c92ca622d7f237e70a4e2" - integrity sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA== - dependencies: - loader-utils "^2.0.0" - mime-types "^2.1.27" - schema-utils "^3.0.0" - url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73"