0

I want to use only backticks. I want that every time I click save, the formatter will change all my quotes type to backticks. I tried the built-in VSCode formatter for JS and prettier, and I didn't see this setting. I prefer the build-in formatter.

I also tried some extensions, but the automatic the replace only after pressing ${, but I want it to be replaced always.

You can see this question: VSCode single to double quote automatic replace

There is not settings for backtick, only single or double.

Aminadav Glickshtein
  • 23,232
  • 12
  • 77
  • 117

1 Answers1

1

I have looked at this a little bit, it seems like Prettier decided not to implement this feature.

dprint-plugin-typescript supports this, but not sure about the default VSCode formatter.

You can, however, enforce this as an ESLint rule as seen here by

  1. adding "quotes": ["backtick"] to your .eslintrc
  2. run eslint --fix.

I assume there is a way to automate this on save document, format document, etc..

cSharp
  • 2,884
  • 1
  • 6
  • 23