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 upPurposeful choice between double-quotes and single-quotes #849
Comments
This comment has been minimized.
This comment has been minimized.
nickmessing
commented
Apr 9, 2017
|
You can still use standard as eslint config and add your rules on top |
dcousens
added
the
question
label
Apr 9, 2017
This comment has been minimized.
This comment has been minimized.
Other way around.
Yep. But you'll have to use ESLint and install our shareable ESLint configuration: eslint-config-standard. That will make it easy for you to layer your own rule additions/deletions/changes on top of the base But beware! |
feross
closed this
Apr 10, 2017
This comment has been minimized.
This comment has been minimized.
|
@nickmessing @feross: Thanks! I missed that solution in the readme.
I understand that reasoning. But seeking refuge in the other extreme (having all those choices made for us) feels like an equally unhealthy option to me. (Though I'd be happy to reconsider. Are you aware of any actual studies?) In any case, thanks for offering this compromise! |
mhelvens commentedApr 9, 2017
Hi all,
I found that string literals in code, in 99% of cases, fall under one of two categories:
My team follows the convention that single quotes are used for the former and double quotes are used for the latter. For example:
Of course, the nature of string literals is not always clear from context like that, and using the double-quote / single-quote convention always makes that nature clear to us at a glance.
From what I understand, standard mandates double quotes for all strings that do not include double quotes themselves, and general exceptions are not allowed. So consider this either a question or a feature request. Is there any way for us to have our cake and eat it too?