vue cli eslint no-console error when no prod mode
See original GitHub issueVersion
3.0.0-rc.3
Reproduction link
https://github.com/acgotaku/vue-cli-issue
Node and OS info
yarn 1.9.4 node 8.11.3 Archlinux
Steps to reproduce
First , clone repo and run yarn serve command to start project.
after, uncomment https://github.com/acgotaku/vue-cli-issue/blob/master/src/components/HelloWorld.vue#L35
console.log(msg) the terminal will output error: Unexpected console statement (no-console)
But if you stop yarn serve command and run again, the eslint error will disappear.
What is expected?
Only production mode output on console eslint error.
What is actually happening?
Add console.log to file will trigger eslint error. But if you rerun the command,the eslint error will disappear.
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (3 by maintainers)
Top Results From Across the Web
no-console - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to disable "unexpected console statement" in Node.js ...
For vue-cli 3 open package.json and under section eslintConfig put no-console under rules and restart dev server ( npm run serve or yarn ......
Read more >vue/cli-plugin-eslint
Vue CLI is in Maintenance Mode! For new projects, it is now recommended to use create-vue to scaffold Vite-based projects.
Read more >Console logging in dev mode, not in prod - Vue Forum
Vuejs integrated or otherwise? Stay safe, TIA. Edit: Just to clarify, vuejs-logger Typescript integration is the real problem. It throws up so many...
Read more >Unexpected console statement despite "no-console": "off"
src/views/Approve.vue 183:21 error Unexpected console statement no-con… ... statement even though I think I configured eslint properly.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Make this modification to your package.json file, under “eslintConfig”:
You need to restart “npm run serve” in order for it to honor your new change.
Lazy quickfix for those who don’t want to tamper with anything: just use
window.console.log