-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
html-no-self-closing: Ignore components option #31
Comments
Thank you for this issue. Sounds good to me. Note: in beta, |
@mysticatea are we good to fix this now with the new parser? |
Yes, we can go ahead. As my comment before, I think a rule which has the option like below: {
"vue/html-self-closing": ["error", {
"html": {
"normal": "never", // HTML elements. E.g. <div></div>
"void": "never", // HTML void elements. E.g. <img>
"components": "always", // Vue.js components.
},
"svg": "always",
"math": "always",
}]
}
|
schema for this options [
{
type: 'object',
properties: {
html: {
type: 'object',
properties: {
normal: { // HTML elements. E.g. <div></div>
enum: ['always', 'never', 'any'] // never
},
void: { // HTML void elements. E.g. <img>
enum: ['always', 'never', 'any'] // never
},
components: { // Vue.js components.
enum: ['always', 'never', 'any'] // always
}
},
additionalProperties: false
},
svg: {
enum: ['always', 'never', 'any'] // always
},
math: {
enum: ['always', 'never', 'any'] // always
}
},
additionalProperties: false
}
] |
@mysticatea are you planing to work on this or should i do that? i seen: vuejs/vue-eslint-parser@50814b3 - this is going to simplified this rule a lot 👍 |
@armano2 Yeah, I'm working on this. I'm sorry that I didn't commented. |
I generally like |
…npm_and_yarn/javascript-package/core-js-3.22.0 Bump core-js from 3.21.1 to 3.22.0 in /javascript-package
I think it is pretty common in Vue templates (for example inside
.vue
files, not in HTML page) to write self-closing component, for example:<ui-dropdown :options="options" />
. It also don't cause any potential issue since the component will be rendered in HTML even before being put in the DOM thanks to the template compiler.It would be nice if the recommended config had an option set to the
html-no-self-closing
rule to ignore non-HTML tags.This should then be reported:
This shouldn't be reported:
The text was updated successfully, but these errors were encountered: