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 serve
oryarn serve
.
...
"eslintConfig": {
...
"rules": {
"no-console": "off"
},
}
...