Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Require space between before opening curly brace in loops and conditional statements? #284

Closed
rxin opened this Issue Mar 4, 2014 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

rxin commented Mar 4, 2014

It would be great if there is a flag that checks for the whitespace between ) and { in conditional statements or loops.

For example

for (var l in obj) {        <--- this is valid
  loopbody;
}

for (var l in obj){        <--- this is invalid
  loopbody;
}
Contributor

rxin commented Mar 4, 2014

I would be happy to implement this, if you can suggest a good name or scope for the rule(s).

Contributor

rxin commented Mar 7, 2014

@mikesherov any suggestions on the scope & naming of this? I can submit a patch once it is clear what to expect here.

Contributor

mikesherov commented Mar 8, 2014

@rxin, thanks. Just submit a valid patch first and we can bikeshed the name later. But an immediate suggestion is (require|disallow)SpaceBeforeBlockStatements ?

Contributor

mikesherov commented Mar 8, 2014

Also, this rule should include space between closing parens of function args as well, not just control structures.

@mikesherov mikesherov closed this in #291 Mar 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment