R
R
Roma Zvarich2019-04-16 11:24:35
Visual Studio Code
Roma Zvarich, 2019-04-16 11:24:35

Is it possible in VS Code to format the declaration block (in curly braces) to one line when one property is set?

Hello.
For code formatting in VS Code I use Beautify (I tried Prettier )
I did not find a setting in any of the extensions that defines a rule that prohibits formatting a CSS block consisting of a single property.
For example, so that the line
5cb59100c6f8d902399628.jpeg
does not turn into a
5cb5910cb3acb637780766.jpegQuestion:
Please help me find an extension or setting that allows you to prohibit formatting such situations.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Prisyazhnyuk, 2019-04-16
@hisbvdis

Something like stylelint with an option --fixshould solve your problem. See https://stylelint.io/user-guide/rules for documentation on all stylelint rules.
Here, the following stylelint rules will be most relevant:
Relevant stylelint documentation pages:
Also in VSCode there is an extension stylefmt , it can format styles according to the Stylelint config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question