Skip to content

Commit 413470d

Browse files
haoqunjiangpksunkara
authored andcommitted
feat: don't throw on console/debugger statements for vue serve (#5029)
1. they're useful in development 2. to be in line with the default preset
1 parent 2531d10 commit 413470d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/@vue/cli-service-global/lib/globalConfigPlugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ module.exports = function createConfigPlugin (context, entry, asLib) {
112112
],
113113
parserOptions: {
114114
parser: 'babel-eslint'
115+
},
116+
rules: {
117+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
118+
'no-debugger': `process.env.NODE_ENV === 'production' ? 'error' : 'off'`
115119
}
116120
}
117121
}))

0 commit comments

Comments
 (0)