Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

"Single quote" property not working as expected #35

Closed
jjwyse opened this issue Jan 30, 2017 · 5 comments
Closed

"Single quote" property not working as expected #35

jjwyse opened this issue Jan 30, 2017 · 5 comments
Labels

Comments

@jjwyse
Copy link

jjwyse commented Jan 30, 2017

I currently have the "Single Quote" property in Atom set to true, however when I format the code using prettier, it is changing all single quotes to double quotes.

Properties

Formatting code:
GIF

Anyone else experiencing this or did I screw something up somewhere?

@robwise
Copy link
Collaborator

robwise commented Jan 31, 2017

@jjwyse I think this is an issue relating to Prettier itself as it's treating JSX attributes specially. You will notice that Prettier is not changing the single quotes at the top in your imports, so it is respecting the option that the atom plugin has set.

@bnjmnt4n
Copy link

Yep, since JSX was designed to be similar to HTML, the convention is to use double quotes for JSX attributes.

@jjwyse
Copy link
Author

jjwyse commented Jan 31, 2017

@robwise @demoneaux - Ah, nice - thanks for the response and insight, appreciate it. I'll go ahead and close this. Thanks again. 👍

@Imran-Haider313
Copy link

Imran-Haider313 commented May 17, 2020

Why No one mentioned this option

{
  "singleQuote": true,
  "jsxSingleQuote": true
}

@robwise
Copy link
Collaborator

robwise commented Jun 3, 2020

Because it didn't exist 3 years ago

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants