sveltejs / eslint-plugin-svelte

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

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

Closed jrmajor closed 2 months ago

jrmajor commented 3 months 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 3 months ago
$ npx svelte-migrate self-closing-tags
jrmajor commented 3 months 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.