Skip to content
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

Merged
merged 4 commits into from Sep 18, 2017
Merged

Conversation

astorije
Copy link
Member

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.

@astorije astorije added the Type: Feature Tickets that describe a desired feature or PRs that add them to the project. label Sep 18, 2017
@@ -35,8 +35,6 @@ const socket = io({
});
// Hides the "Send Message" button
$("#submit").remove();

console.error(data);
Copy link
Member Author

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

@@ -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.");
Copy link
Member Author

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.

Copy link
Member

@AlMcKinlay AlMcKinlay left a 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
Copy link
Member

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"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@xPaw xPaw merged commit 2ea57a4 into master Sep 18, 2017
@xPaw xPaw added this to the 2.5.0 milestone Sep 18, 2017
@xPaw xPaw deleted the astorije/eslint-console branch September 18, 2017 10:06
@astorije astorije added the Meta: Internal This is an internal codebase change (testing, linting, etc.). label Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta: Internal This is an internal codebase change (testing, linting, etc.). Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants