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

Never start a line with `[` - what about nested arrays? #569

Closed
PaulKiddle opened this issue Jul 19, 2016 · 2 comments

Comments

@PaulKiddle
Copy link

commented Jul 19, 2016

The one potential edge case of this rule that I can see causing a problem:

var matrix = [
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 0]
]

In this case, does the standard have any recommendations for styling this code?

@PaulKiddle PaulKiddle changed the title Never start a _line_ with `[` or never start a _statement_ with it? Never start a line with `[` - what about nested arrays? Jul 19, 2016

@qzb

This comment has been minimized.

Copy link

commented Jul 19, 2016

It's not a problem, standard doesn't raise any errors for this example. This rule was made to prevent some situations when omitting semicolons could cause errors, this isn't one of these situations.

@feross

This comment has been minimized.

Copy link
Member

commented Jul 19, 2016

Yep, there's nothing wrong with the code you posted!

@feross feross closed this Jul 19, 2016

@dcousens dcousens added the question label Jul 22, 2016

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

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