File tree 2 files changed +6
-1
lines changed
packages/@vue/cli-plugin-eslint
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ module.exports = (api, options) => {
61
61
usage : 'vue-cli-service lint [options] [...files]' ,
62
62
options : {
63
63
'--format [formatter]' : 'specify formatter (default: codeframe)' ,
64
- '--no-fix' : 'do not fix errors' ,
64
+ '--no-fix' : 'do not fix errors or warnings' ,
65
+ '--no-fix-warnings' : 'fix errors, but do not fix warnings' ,
65
66
'--max-errors [limit]' : 'specify number of errors to make build failed (default: 0)' ,
66
67
'--max-warnings [limit]' : 'specify number of warnings to make build failed (default: Infinity)'
67
68
} ,
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ module.exports = function lint (args = {}, api) {
32
32
cwd
33
33
} , argsConfig )
34
34
35
+ const noFixWarnings = ( argsConfig . fixWarnings === false )
36
+ const noFixWarningsPredicate = ( lintResult ) => lintResult . severity === 2
37
+ config . fix = config . fix && ( noFixWarnings ? noFixWarningsPredicate : true )
38
+
35
39
if ( ! fs . existsSync ( api . resolve ( '.eslintignore' ) ) ) {
36
40
// .eslintrc.js files (ignored by default)
37
41
// However, we need to lint & fix them so as to make the default generated project's
You can’t perform that action at this time.
0 commit comments