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
Stroustrup style braces #219
Comments
I actually agree with this, but I'm thinking it may be too late to change. Making the change now would dramatically affect all of |
This is one of the decisions in standard where we 'just picked something'. Here's what the readme says about this:
You make a good point about comments being a little more readable in Stroustrup style, though. :) This is one of those decisions that we can't revisit. Nearly every repo that uses (If it really matters to you, consider using eslint-shareable-config and overriding this one rule.) Thanks for the thoughtful issue! |
Fair point and thanks for the response. For now I'm just overriding that rule and perhaps I'll adapt later. |
Hey guys, thanks again for the background on this. Forgive me for resurrecting an old question but I can't help but notice one thing you said:
Just to clarify, what I was talking about, at least, would be a rule such as:
This way existing repos would not break, as
To be clear, I'm not trying to make a case -- just trying to clarify that I didn't mean "instead of" the current rule but an additional allowance. If this still doesn't make sense in standard, no worries. In that case, one thing that would be helpful, though, would be guidance on where to put those comments in a consistent way. Some options:
Thanks for taking the time to reply |
// the true case
if (true) {
// the false case
} else {
} Is the convention for comments I follow. if (...) {
}
else {
} syntax is in the spirit of standard (that is, try and enforce only 1 way to do things). |
I concur with @dcousens |
Nice! Hadn't thought of that, thanks |
That looks so ugly and to me the comment looks related to the |
a.k.a.
instead of
My intention isn't to bikeshed here. More curious for an explanation as it doesn't seem like any strong opinion was expressed. My current style matches almost all of Standard except this one. I like this option because I can put comments above and it keeps the keyword on the left side (easier to see).
Thanks for the excellent lib btw!
The text was updated successfully, but these errors were encountered: