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

How is “Never start a line with ( or [” ment? #110

Closed
ausi opened this issue Apr 11, 2015 · 1 comment

Comments

@ausi
Copy link

commented Apr 11, 2015

“Never start a line with ( or [” is a very simple rule, but I’m not sure it means the right thing.

standard doesn’t generate errors for code like this:

foo(
  (1 + 2) * 3,
  [1, 2, 3]
)

Is this a bug in standard or is starting a line with ( or [ allowed in this case?

If it is allowed, shouldn’t it say “Never start a statement with ( or [”?

@feross

This comment has been minimized.

Copy link
Member

commented Apr 21, 2015

I think that saying "never start a line" is actually more accurate than "never start a statement", though both are actually incorrect.

The correct rule is "\n ends a statement unless the next line starts with [, (, and a few addition, uncommon binary operators."

Instead of writing all that, I added a longer explanation to RULES.md and linked it from the list of rules in README.md.

@feross feross closed this Apr 21, 2015

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.