Edit .eslintrc.js
in your project directory.
module.exports = { ... // add your custom rules here 'rules': { 'no-console': process.env.NODE_ENV === 'production' ? 2 : 0 }}
Note: process.env.NODE_ENV
is defined in Vue.js Webpack Template.
You can selective enable console.log
// eslint-disable-next-line no-consoleconsole.log('hello');
or
console.log('hello'); // eslint-disable-line no-console
or
// eslint-disable no-consoleconsole.log('hello');console.log('world');// eslint-enable no-console