question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quotes in JSX are double quotes even if singleQuote is true

See original GitHub issue

image

This is replicable in the demo environment: the singleQuote variable works properly for vanilla JavaScript but does not affect JSX, which is always double-quotes.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

36reactions
vjeuxcommented, Jun 5, 2017

@atombender prettier will not honor the --single-quote option for JSX. This is an explicit decision and we’re not looking into changing it.

35reactions
vjeuxcommented, Jun 5, 2017

Prettier is an opinionated printer, if you do not like the decisions that were made, I’m afraid that you either have to fork it to make them match the way you format code or not use prettier 😦

JSX was designed to be close to HTML and people use double quote to write HTML, so are we at Facebook and a lot of people writing JSX.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Single quote in tsx file with prettier - Stack Overflow
If you're using the settings GUI just search for single quote and check/uncheck the Prettier: Jsx Single quote and Prettier: Single quote.
Read more >
jsx-quotes - ESLint - Pluggable JavaScript Linter
This rule enforces the consistent use of either double or single quotes in JSX attributes. Options. This rule has a string option: "prefer-double"...
Read more >
Prettier single quote setting not respected in .tsx files (VS Code)
The solution is to set the jsxSingleQuote setting to true as well. This will change all double quotes in your .tsx files to...
Read more >
quotemark - Rule
"jsx-double" enforces double quotes for JSX attributes. "avoid-template" forbids single-line untagged template strings that do not contain string interpolations ...
Read more >
Do you use Single Quotes or Double Quotes? : r/learnjavascript
I started learning it with double quote in HTML I think. I dont even know if plain HTML accepts single quotes haha. However,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found