Fix- 'unexpected console statement (no-console)' Error in Node and Vue


In this short post, we will see how we can fix the "unexpected console statement" error from node and vue.

In Nodejs:

If you are using NodeJs, then to fix this error, follow these steps:

  1. Create .eslintrc.js file in the project directory, and
  2. And set 'no-console': 'off' in the rules section.
module.exports = {
    rules: {
        'no-console': 'off',
    },
};

In Vue:

To fix the "unexpected error statement" error in your Vue project, follow these steps:

  1. open your package.json file.
  2. And now under the eslintConfig section, put "no-console": "off" under rules.
  3. Next, restart your development server using npm run serve or yarn serve .
...
"eslintConfig": {
  ...
  "rules": {
    "no-console": "off"
  },
}
...

💾 Recommended Articles