Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow quotes around object literal property names that are not str…
…ictly required
- Loading branch information
f2fac9a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@feross , if quotes are "as-needed", why not relax it with consistent-as-needed?
from all the 4 options, this one look the least prettier. with "as-needed" we get mixed object.
I wonder what is the benfit from using as-needed?
f2fac9a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hagaigold with the consistent option, imagine a literal object with many keys where none of them require quotes. Then, a single new key is added which does require quotes. All of the keys now require quotes. I don't like that. It's just a key. It shouldn't affect the other keys. In this case, prettiness is not as important as other considerations (at least this one).
f2fac9a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point, fair enough ;)