I\'m using eslint with Sublime Text 3 and I am writing gulpfile.js
.
/*eslint-env node*/
var gulp = require(\'gulp\');
gulp.task(\'default\', fu
You should update eslint config file to fix this permanently. Else you can temporarily enable or disable eslint check for console like below
/* eslint-disable no-console */
console.log(someThing);
/* eslint-enable no-console */
in "rules", "no-console": [false, "log", "error"]
In package.json you will find an eslintConfig
line. Your 'rules' line can go in there like this:
"eslintConfig": {
...
"extends": [
"eslint:recommended"
],
"rules": {
"no-console": "off"
},
...
},
If you install eslint under your local project, you should have a directory /node_modules/eslint/conf/ and under that directory a file eslint.json. You could edit the file and modify "no-console" entry with the value "off" (although 0 value is supported too):
"rules": {
"no-alert": "off",
"no-array-constructor": "off",
"no-bitwise": "off",
"no-caller": "off",
"no-case-declarations": "error",
"no-catch-shadow": "off",
"no-class-assign": "error",
"no-cond-assign": "error",
"no-confusing-arrow": "off",
"no-console": "off",
....
I hope this "configuration" could help you.
My 2 cents contribution:
Besides removing the console warning (as shown above), it's best to remove yours logs from PROD environments (for security reasons). The best way I found to do so, is by adding this to nuxt.config.js
build: {
terser: {
terserOptions: {
compress: {
//this removes console.log from production environment
drop_console: true
}
}
}
}
How it works: Nuxt already uses terser as minifier. This config will force terser to ignore/remove all console logs commands during compression.