mr__scrpt
mr__scrpt

Reputation: 119

Vscode Prettier - No need to remove blank lines

I am working on a project that has its own style formatting rules and the project does not build if the rules are violated. I'm used to working with prettier, but it removes the blank line in front of the nested selector, but there should be a blank line in my project, like this:

.about {
    ==>> There should be a blank line here, but prettier removes it.
    &__inner {
       color: red;
    }
}

I've tried several prettier extensions for vs code and everywhere with these problems. Tell me how can I set my own rules so that the empty line is not deleted?

Upvotes: 3

Views: 4176

Answers (1)

lejlun
lejlun

Reputation: 4419

This isn't and won't be possible using Prettier. Prettier is highly opinionated and no-longer sees the need to add new options.

From the Prettier Option Philosophy.

Option Philosophy

However, the time to stop has come. Now that Prettier is mature enough and we see it adopted by so many organizations and projects, the research phase is over. We have enough confidence to conclude that Prettier reached a point where the set of options should be “frozen”. Option requests aren’t accepted anymore. We’re thankful to everyone who participated in this difficult journey.

Please note that as option requests are out of scope for Prettier, they will be closed without discussion. The same applies to requests to preserve elements of input formatting (e.g. line breaks) since that’s nothing else but an option in disguise with all the downsides of “real” options. There may be situations where adding an option can’t be avoided because of technical necessity (e.g. compatibility), but for formatting-related options, this is final.

Upvotes: 8

Related Questions