html-eslint icon indicating copy to clipboard operation
html-eslint copied to clipboard

[no-extra-spacing-attrs] Allow last space only on void tags

Open gian1200 opened this issue 3 years ago • 3 comments

Is it possible to enforce "no-extra-spacing-attrs" on all tags, except on those that are void tags?

In other words, make it work when using "@html-eslint/require-closing-tags": ["error", { "selfClosing": "always" }]

image

I found this other issue, bue am not sure if it's related or not https://github.com/yeonjuan/html-eslint/issues/76.

gian1200 avatar Aug 08 '22 14:08 gian1200

Hi @gian1200 :) Thanks for the suggestion. Can you describe the option you suggest more?

it should ignore all other tags which except for void tags ?

<!-- no error -->
<div    id='aa'   class="class"></div>    

<!-- while error -->
<link     rel="stylesheet"   type="text/css"  /> 

yeonjuan avatar Aug 09 '22 14:08 yeonjuan

Oh, my bad. I meant only to allow the last space, the one before "/>". All other current rules/directives should still apply.

gian1200 avatar Aug 09 '22 15:08 gian1200

@gian1200 It seems good to add new options. I'll work on it as soon

yeonjuan avatar Aug 09 '22 15:08 yeonjuan

Hi, again. First of all, thanks for tha awesome work you are doing with this plugin!

~Maybe I missed something, I read the PR and updated my config file accordingly:~

~"@html-eslint/no-extra-spacing-attrs": ["warn", { "enforceBeforeSelfClose": true }],~

~However, I got the following error. Did I miss something?~

image

"@html-eslint/eslint-plugin": "^0.14.1",
"@html-eslint/parser": "^0.14.0",

Update:

I debugged it and it seems that v0.14.1 doesn't have the fix 😄. Looking at the dates it matches. I'll just wait 😃 .

gian1200 avatar Sep 29 '22 02:09 gian1200