Disable ESLint no-console In Development

Unexpected console statement (no-console), Enable console.log

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

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.