-
Notifications
You must be signed in to change notification settings - Fork 74
JS Style Guide: Drop onevar as a requirement #105
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
Conversation
I'm good with this, it just makes onevar optional so we can continue to use it and still be in compliance with the style guide? That said, I've started to come around to the "one var per variable" because of the diff issue. |
I highly support one var per variable, and keeping with the "all at the On Thu, Feb 5, 2015 at 11:54 AM, Dave Methvin [email protected]
|
Yes, but ideally all of the jQuery projects (not all of the jQuery Foundation projects) have the exact same styles. There's an important distinction there and I think consistency in the former is important. See also jquery/content#8. |
@jzaefferer No objections in a month. I'd say this is safe to land :-) |
Sure! |
There are various reasons why onevar is bad, like always changing unrelated lines when adding or removing variables. jshint actually remove the onevar option recently. Instead of specifying how variables should be declared without onevar, I've removed the entire Assignments section. We can bring it back in the future when there is consensus, if its needed at all. Also removes two unnecessary blank lines in unrelated code example. Closes jquery#105
3194b97
to
a1fbe20
Compare
Merged. We can still add more specific |
We need a replacement for this and I think it should be for all projects. I'd like to be able to enforce some value for http://jscs.info/rule/requireMultipleVarDecl.html or http://jscs.info/rule/disallowMultipleVarDecl.html and that should probably be included in the jquery preset. |
There are various reasons why onevar is bad, like always changing unrelated lines when adding or removing variables. jshint actually remove the onevar option recently. Instead of specifying how variables should be declared without onevar, I've removed the entire Assignments section. We can bring it back in the future when there is consensus, if its needed at all.