-
-
Notifications
You must be signed in to change notification settings - Fork 681
Incorrect default values for html-self-closing rule (inverted for html.void and html.normal) #905
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
The documentation for the defaults is also showing the "incorrect" defaults (https://eslint.vuejs.org/rules/html-self-closing.html#rule-details):
The |
@mysticatea And, i think, that html.component should be never or any by default, because by Vue docs (https://vuejs.org/v2/style-guide/#Self-closing-components-strongly-recommended) Components with no content should be self-closing in single-file components, string templates, and JSX - but never in DOM templates. temporary fix into eslint config: rules: {
"vue/html-self-closing": ["error", {
"html": {
"void": "always",
"normal": "never",
"component": "any"
}
}]
} |
I wouldn't argue about where components are more likely to be found, but that And recommended eslint rules should never break stuff (this is at least good practice). Either removing this rule as being recommended, or setting Might also help #876 Later one, handling this rule differently in each context could be added as a feature. |
thanks worked |
Old but still valid today 😅 |
Everyone can change the defaults in their own ESLint config 😉 https://vuejs.org/style-guide/rules-strongly-recommended.html#self-closing-components:
I read this as |
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen?
No linting errors
What actually happened?
The text was updated successfully, but these errors were encountered: