Standard: Never start a line with `[` - what about nested arrays?

Created on 19 Jul 2016  路  2Comments  路  Source: standard/standard

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?

question

Most helpful comment

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.

All 2 comments

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

jescalan picture jescalan  路  3Comments

mightyiam picture mightyiam  路  3Comments

jmz7v picture jmz7v  路  3Comments

johannes-z picture johannes-z  路  3Comments