Prettier doesn't format .tsx file

S. Hesam picture S. Hesam · May 11, 2020 · Viewed 7.6k times · Source

I've used the Prettier extension in the visual studio code editor for a long time, but recently I am writing to React with Typescript. So I need to configure for Prettier to format .tsx files.

Answer

iNeelPatel picture iNeelPatel · Aug 15, 2020

edit setting with following in settings.json of VScode

"[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},