Fix- 'unexpected console statement (no-console)' Error in Node and Vue
Short article on how to fix "unexpected console statement (no-console)" error in NodeJs and Vue using .eslintrc.js file and eslintConfig.
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:
- Create .eslintrc.js file in the project directory, and
- 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:
- open your package.json file.
- And now under the eslintConfig section, put
"no-console": "off"under rules. - Next, restart your development server using
npm run serveoryarn serve.
... "eslintConfig": { ... "rules": { "no-console": "off" }, } ...
Related Posts
How to Clear npm Cache and Reinstall Dependencies to Fix npm Install Errors
Learn how to clear npm cache, delete node_modules, and reinstall dependencies to fix npm install errors. Step-by-step guide with commands.
Top 40 Git commands with Examples
Check GitHub Account in the Terminal
Solve npm ERR! ENOENT - No Such File or Directory Error
Learn what causes the npm ERR! ENOENT error, steps to troubleshoot it, and how to fix the no such file or directory issue when running npm start or npm install commands on your Node.js project.
