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
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.
How to Clear Cache in NPM?
In this tutorial we will learn how to clean or remove npm cache from Windows, linux and Mac using npm cache clean command.
