O
O
OWIII2020-05-13 14:14:42
typescript
OWIII, 2020-05-13 14:14:42

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:
5ebbd643954d2061579354.jpeg

Here's how it should format:
5ebbd657762b6840710304.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-05-13
@OWIII

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 question

Ask a Question

731 491 924 answers to any question