Prettier single quote setting not respected in .tsx files (VS Code)

This was an odd one, but luckily fairly straightforward to fix. It is one of those problems I’ve fixed multiple times but never wrote down the solution for next time I run into it.

Problem

{
"singleQuote": true
}
No errors when running Prettier

Solution

In addition to the singleQuote setting, there’s also a setting called jsxSingleQuote. And, of course, the default value for that is false.

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store