New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable no-console
and no-alert
ESLint rules
#1538
Conversation
@@ -35,8 +35,6 @@ const socket = io({ | |||
}); | |||
// Hides the "Send Message" button | |||
$("#submit").remove(); | |||
|
|||
console.error(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really shouldn't be using console.xxx
in the browser...
0075377
to
aa377ee
Compare
@@ -79,8 +79,6 @@ if (process.env.NODE_ENV === "production") { | |||
sourceMap: true, | |||
comments: false | |||
})); | |||
} else { | |||
console.log("Building in development mode, bundles will not be minified."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this is really helpful at this point, might as well not have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve in general, but I think we should switch to a logging framework rather than disabling the console logging whenever we want to log. I use winston on most things.
Then you use the framework for the proper logging, and console.log when developing, that way you don't need all the eslint comments and you don't let dev logging slip through.
But this is good enough for now.
spaced-comment: [error, always] | ||
strict: error | ||
template-curly-spacing: error | ||
yoda: error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "2" equal to "error"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
We almost slipped in a few
console.log
statements so this should make it safer. Outside of the current occurrences we have, we shouldn't need any more in the code, or at least not without explicitly acknowledging them.