-
-
Notifications
You must be signed in to change notification settings - Fork 679
html-self-closing
with --fix
doesn't normalise whitespace in opening tag
#199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Good catch @axelboc , thank you for posting this issue :) |
Yes, the rule does not consider spacing. Another rule should handle spacing. Maybe "vue/space-before-tag-closing": ["error", {
"normal": {
"afterTagName": "always"/"never",
"afterAttributeName": "always"/"never",
"afterEqual": "always"/"never",
"afterAttributeValue": "always"/"never",
},
"selfClosing": {
"afterTagName": "always"/"never",
"afterAttributeName": "always"/"never",
"afterEqual": "always"/"never",
"afterAttributeValue": "always"/"never",
}
}] |
Sounds like a good idea to me @mysticatea. Each rule should fix what it reports, but if we'd change the fix method here to apply proper spacing it would additionally fix something it wouldn't normally report. Seems like there is a similar rule for JSX: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md I think we should do the same :) I'll create a dedicated proposal in separate issue. I also think it can land in 4.1 |
Input
Expected output
Actual output
The rule just replaces
/>
with>
(or>
with/>
) in the opening tag without considering that a space may need to be removed or added.The text was updated successfully, but these errors were encountered: