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

Disable HTML formatting

Open kevinrenskers opened this issue 4 years ago • 7 comments

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?

kevinrenskers avatar Jun 15 '20 11:06 kevinrenskers

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

TheComputerM avatar Aug 24 '20 13:08 TheComputerM

Related #55

dummdidumm avatar Aug 27 '20 07:08 dummdidumm

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

ehrencrona avatar Aug 27 '20 12:08 ehrencrona

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

TheComputerM avatar Aug 30 '20 18:08 TheComputerM

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

dummdidumm avatar Aug 30 '20 19:08 dummdidumm

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.

benwoodward avatar Sep 03 '21 06:09 benwoodward

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.

dummdidumm avatar Sep 03 '21 07:09 dummdidumm