sveltejs / eslint-plugin-svelte

ESLint plugin for Svelte using AST
https://sveltejs.github.io/eslint-plugin-svelte/
MIT License
296 stars 35 forks source link

Tag braces style #833

Open coldfeudal opened 2 months ago

coldfeudal commented 2 months ago

Is there any way to enforce tag < /> linebreak style?

E.g. transform this

<div
  class="device-image bc"
  style:background-image="url('/devices/{backgroundImage}')" />

into this

<div
  class="device-image bc"
  style:background-image="url('/devices/{backgroundImage}')"
/>

Ideally only for tags with multiple lines/arguments

Shyam-Chen commented 1 month ago
<div
  class="device-image bc"
  style:background-image="url('/devices/{backgroundImage}')"
></div>
<FooBar
  class="device-image bc"
  style:background-image="url('/devices/{backgroundImage}')"
/>

Use prettier-plugin-svelte.


$ npx svelte-migrate self-closing-tags