Answer the question
In order to leave comments, you need to log in
Prettier VsCode Typescript-React settings?
Hi all. Tell me, who knows, I will be grateful. I didn't find anything on the internet.
How to configure Prettier so that it:
1. In interfaces (in objects) at the end of the line, put not a semicolon, but a comma.
2. At the same time, at the end of all other lines, he put a semicolon.
3. And all strings must be with single quotes.
Here's how it formats now:
Here's how it should format:
Answer the question
In order to leave comments, you need to log in
Points 1 and 2 conflict with each other. To execute them at the same time, you will have to abandon Prettier and use the linter rule from typescript-eslint . Well, or vice versa, abandon the idea of using a comma as a separator in interfaces.
For point 3 there is a setting in the Prettier config .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question