Prettier-atom: "Single quote" property not working as expected

Created on 30 Jan 2017  路  5Comments  路  Source: prettier/prettier-atom

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?

question

All 5 comments

@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.

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

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

Why No one mentioned this option

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

Because it didn't exist 3 years ago

Was this page helpful?
0 / 5 - 0 ratings