Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upInconsistent spacing between objects and arrays #1335
Comments
This comment has been minimized.
This comment has been minimized.
|
I think the motivation was mostly that that is how the majority of the eco-system does it. Enforcing arrays with spacing broke a ton of repositories, and enforcing objects without spacing also broke a ton of repositories. For what it's worth, prettier also defaults to this. XO seems to enforce no spacing in both array and object. I agree that it's a bit weird that it's not the same, but this has been the style that I've personally always used, and it's the one I've seen most used in the wild as well... |
This comment has been minimized.
This comment has been minimized.
|
What @LinusU said :) We tried both ways and no spaces felt more natural and would cause the least ecosystem breakage when updating to the latest version of Also, anecdotally speaking, It's actually a great style once you get used to it. :) |
mafintosh commentedJul 18, 2019
On the latest version of standard when writing objects I have to write them like this:
But when I make arrays I now have to do it like this
Whilst
[ 'foo', 'bar' ]is now disallowed.I personally find this confusing so I was wondering if there was any motivation behind this change? :)