question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vue cli eslint no-console error when no prod mode

See original GitHub issue

Version

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:open
  • Created 5 years ago
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

172reactions
mzoe1330commented, Mar 11, 2019

Make this modification to your package.json file, under “eslintConfig”:

...
    "rules": {
        "no-console": "off"
    },
...

You need to restart “npm run serve” in order for it to honor your new change.

41reactions
freedmandcommented, Aug 24, 2019

Lazy quickfix for those who don’t want to tamper with anything: just use window.console.log

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found