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

More configuration options for `html-self-closing` #837

Closed jrmajor closed 2 weeks ago

jrmajor commented 1 month ago

Description

I would like to be able to configure html-self-closing so that it aways produces most compact, yet correct tags. That would mean preferring void > self-closing > separate closing tag, but only within spec limitations.

I was able to accomplish that for HTML/Svelte with { void: 'never', normal: 'never' } settings (example output: <img><div></div><Component/>), but now it changes SVG tags from <path/> to <path></path>.

Shyam-Chen commented 1 month ago
$ npx svelte-migrate self-closing-tags
jrmajor commented 1 month ago

@Shyam-Chen How is that related? Both <svg><path/></svg> and <svg><path></path></svg> are valid in Svetle 5 and migrate button in Svelte 5 REPL doesn't do anything to them.