prettier-plugin-svelte icon indicating copy to clipboard operation
prettier-plugin-svelte copied to clipboard

Add option to have custom separator between styles, markup and scripts

Open MananTank opened this issue 5 years ago • 1 comments

Why Add this ? sometimes it becomes very hard to separate sections when the component is complicated. I usually prefer 2-3 newlines between each section, so that I can easily differentiate sections.

Example 1: : Put 2 new lines between sections

{
 "svelteSectionSeperator": "\n\n" 
}
<script> ..... </script>


<abc> ....</abc>
<xyz> ....</xyz>


<style> ..... </style>

Example 2: :

{
 "svelteSectionSeperator": "\n <!------------- > \n" 
}
<script> ..... </script>

<!------------- >

<abc> ....</abc>
<xyz> ....</xyz>

<!------------- >

<style> ..... </style>

MananTank avatar Jul 20 '20 13:07 MananTank

Looking for same feature but to separate redux actions/types/other stuff to make it readable. Any info on this exists? Like general use plugin for same purpose?

oleksii-lukin avatar Apr 26 '21 09:04 oleksii-lukin

With #314 implemented you can chose svelteSortOrder: none and put any number of comments between the script/style/html sections to get what you want. I don't think a separate option for this specific use case would be good, we need to keep the number of options lean - therefore closing this.

dummdidumm avatar Oct 10 '22 10:10 dummdidumm