sveltejs / prettier-plugin-svelte

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

Disable HTML formatting #102

Open kevinrenskers opened 4 years ago

kevinrenskers commented 4 years ago

I really like this plugin for formatting the JS code inside the script tag, and even for formatting CSS. But there are so many problems with the HTML formatting; can I just disable the HTML formatting completely?

TheComputerM commented 4 years ago

For example this, wrapping the second curly braces to the next line makes the code look ugly and hard to understand.

dummdidumm commented 4 years ago

Related #55

ehrencrona commented 4 years ago

@TheComputerM Thanks for pointing that formatting issue out. It's fixed by #127

TheComputerM commented 4 years ago

Are any changes made here directly integrated into the language-server.

dummdidumm commented 4 years ago

Yes, I bumped the dependency in the language server and a release will happen soon.

benwoodward commented 3 years ago

I really need this option, the HTML formatting does so much wacky stuff. For example:

<Modal
  bind:active
  showHeader={false}
  showFooter={true}
  on:close={resetCurrentFlashcard}>
  <section
    class="block pb-12 leading-6 text-gray-700"
    use:mousetrap={['f', 'x', logForgotten, 'mod+enter', 'r', logRemembered]}>
    {#each $currentFlashcardSides as side}
      <CardSide
        id={side.id}
        content={side.content}
        isFirst={side.isFirst}
        isLast={side.isLast}
        isRevealed={side.isRevealed}
        isLastVisible={side.isLastVisible}
        on:reveal-next={revealNext} />
    {/each}
  </section>

..gets formatted to:

<Modal bind:active showHeader={false} showFooter={true} on:ceach $currentFlashcardSides as side}
      <CardSide
        id={side.id}
        content={side.content}
        isFirst={side.isFirst}
        isLast={side.isLast}
        isRevealed={side.isRevealed}
        isLastVisible={side.isLastVisible}
        on:reveal-next={revealNext} />
    {/each}
  </section>

The JS formatting works perfectly. Will have to disable this plugin until this issue is fixed.

dummdidumm commented 3 years ago

Please open a separate issue for this with a proper reproduction. Your code snippet (appending a </Modal> at the end) is formatted properly for me using the default formatting settings.