html-eslint
html-eslint copied to clipboard
Preserve single space before self-closing tag
Hello!
I noticed that rule @html-eslint/no-extra-spacing-attrs reports if there a space before self-closing tag.

I think it's more comfortable to be able to customize this behavior. Maybe it's a personal issue, but the rule is in the "style" category, so guess it should be configurable to fit any preferences.
Maybe this can be covered in separate rule because it's also related to this case in terms of style:

What do you think? Can we implement it? How can I help?
@MorevM Thanks for the report. :)
Maybe this can be covered in separate rule
I agree. It would be nice if we can handle it.
What about a new general rule no-extra-spacing which check all extra spaces not only around attributes? Then we can deprecate no-extra-spacing-attrs
@yeonjuan yes, such new rule looks good to me with parameter { spaceBeforeSelfClosing: boolean } or similar.
- I'm not familiar with the ESLint API for plugin developers. While this looks interesting to dig into, I'm a little limited on time so I can't seem to get it done before a week or even two if you don't have time to do it before. :)
@MorevM Sure, :) please let me know if you can't take any time to do it. Then I'll take it. 👍
I tried to off this rule by "@html-eslint/no-extra-spacing-attrs": "off",
but it is still report them as errors.