@mpxjs/vue-cli-plugin-mpx-eslint 2.1.30 → 2.1.31
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/index.js +3 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3,21 +3,16 @@ const ESLintPlugin = require('eslint-webpack-plugin')
|
|
|
3
3
|
module.exports = function (api, options, webpackConfig) {
|
|
4
4
|
if (options.lintOnSave) {
|
|
5
5
|
api.chainWebpack((webpackConfig) => {
|
|
6
|
-
const { lintOnSave } = options
|
|
7
6
|
const extensions = ['js', 'ts', 'mpx']
|
|
8
|
-
const treatAllAsWarnings = lintOnSave === true || lintOnSave === 'warning'
|
|
9
|
-
const treatAllAsErrors = lintOnSave === 'error'
|
|
10
|
-
|
|
11
|
-
const failOnWarning = treatAllAsErrors
|
|
12
|
-
const failOnError = !treatAllAsWarnings
|
|
13
7
|
|
|
14
8
|
/** @type {import('eslint-webpack-plugin').Options & import('eslint').ESLint.Options} */
|
|
15
9
|
const eslintWebpackPluginOptions = {
|
|
16
10
|
// common to both plugin and ESlint
|
|
17
11
|
extensions,
|
|
18
12
|
// ESlint options
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
// 5.x的eslint-webpack-plugin这两个选项是控制是否退出构建的,但是eslint错误上不应该退出构建,所以这里全部禁用
|
|
14
|
+
failOnWarning: false,
|
|
15
|
+
failOnError: false,
|
|
21
16
|
cache: false
|
|
22
17
|
}
|
|
23
18
|
|