sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
745 stars 97 forks source link

How to disable or change style autoformat on vscode? #295

Closed oggnimodd closed 2 years ago

oggnimodd commented 2 years ago

I am using tailwind @apply in my svelte file like this

 .title {
    @apply text-red-500;
 }

It's not a problem if I am not using a lot of tailwind classes. But if I need more complex styling , it will become hard to read in one line, so I will write something like this to improve readibility :

 .title {
    @apply 
        flex 
        items-center
        font-bold
        text-3xl
        uppercase
        dark:text-accent;
 }

The problem is svelte vscode formatter will format it again into one line. Is there any setting i can tweak to prevent auto-format or change formatting settings?

dummdidumm commented 2 years ago

There is not AFAIK. Also, the Svelte plugin doesn't format this part of the code, it's the core Prettier CSS formatter which does this (we delegate to it) - therefore closing as unactionable on our side.