G
G
Gagatyn2020-08-10 11:10:49
JSON
Gagatyn, 2020-08-10 11:10:49

How to customize code formatting with Prettier plugin?

Good afternoon!

As in any studio / code editor, there are plugins that format all written code, extra spaces, line breaks, etc.

Use vs code , installed Prettier plugin . I couldn’t understand why media queries didn’t work in css , it turns out that the plugin corrected the formatting in its own way.
It was like this:

@media all and (max-width: 1220px) {
    .container {
        margin: 15px 0 0 0;
        flex: 1 0 100%;
    }
}

After Prettier became:
@media all and(max-width: 1220px) {
    .container {
        margin: 15px 0 0 0;
        flex: 1 0 100%;
    }
}

Noticed? The keyword AND together with the parenthesis have been merged.
Prettier online is fine.

Can you please tell me how to set it up?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question