Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Require block comments to be balanced #572
This rule (which is already enabled in
For example, this would be an error:
/* This is a block comment*/
It would be need to be rewritten like this:
/* This is a block comment */
As part of this change, I propose that we remove the exceptions that allow the keywords "global", "global", "eslint", and "eslint-disable" to be used without a space:
/*global myVar */
It's odd to enforce a space at the end while making it optional at the beginning for these keywords. With these exceptions removed, this is how these comments would need to be written:
/* global myVar */
Eslint handles space or no-space versions of these directives without issue.
The number of affected repos is moderate (2%):
I kinda like being able to write eslint directives in a "style-violating" way (and wish I could do it with more of them, like
@Kovensky Interesting point. Your last point is correct. If the rule isn't getting picked up (due to a typo) then you'll get a warning because the rule you were trying to disable wasn't actually disabled.
I think this rule change is a good move since there were 2 ways to do something, and now there will be only one.