File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
packages/@vue/cli-plugin-eslint Expand file tree Collapse file tree 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) => {
6161 usage : 'vue-cli-service lint [options] [...files]' ,
6262 options : {
6363 '--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' ,
6566 '--max-errors [limit]' : 'specify number of errors to make build failed (default: 0)' ,
6667 '--max-warnings [limit]' : 'specify number of warnings to make build failed (default: Infinity)'
6768 } ,
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ module.exports = function lint (args = {}, api) {
3232 cwd
3333 } , argsConfig )
3434
35+ const noFixWarnings = ( argsConfig . fixWarnings === false )
36+ const noFixWarningsPredicate = ( lintResult ) => lintResult . severity === 2
37+ config . fix = config . fix && ( noFixWarnings ? noFixWarningsPredicate : true )
38+
3539 if ( ! fs . existsSync ( api . resolve ( '.eslintignore' ) ) ) {
3640 // .eslintrc.js files (ignored by default)
3741 // 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