0

I am currently working with TypeScript in VS Code and I use Prettier code formatter to format my code. I have my setting configured to use single quotes on format for TS files, but when I format, all my single quotes get turned into double quotes. I’m wondering if this is a Prettier bug or if I’m missing something here. Below I’ll place some images of what’s happening as well as the settings.json file I'm using. Thanks to anyone looking at this post or willing to help!

Before save:

before save

After save:

after save

settings.json:

settings.json

Gama11
  • 31,714
  • 9
  • 78
  • 100

2 Answers2

0

This is likely because you have a prettier configuration file in your project that is overriding the VS Code settings. The VS Code settings are ONLY used if a local prettier configuration is NOT present in your project.

Check the logs to see where the prettier configuration is coming from. For instructions on how to view the logs see the project wiki.

Nate Totten
  • 8,904
  • 1
  • 35
  • 41
0

Probably the .editorconfig file overrides your VS Code settings. Try to add the following line to the .editorconfig file:

quote_type = single
STh
  • 746
  • 9
  • 24