html-no-self-closing: Ignore components option
See original GitHub issueI 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:
<div />
<ui-dropdown />
This shouldn’t be reported:
<div></div>
<ui-dropdown />
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Are (non-void) self-closing tags valid in HTML5?
In these cases, the / is optional and ignored, so <hr> and <hr /> are identical. The HTML spec calls these "void elements",...
Read more >Disallow self-closing elements (no-self-closing) - HTML-validate
By default foreign elements are ignored by this rule. By setting ignoreForeign to false foreign elements must not be self-closed either.
Read more >vue/html-self-closing
This rule aims to enforce the self-closing sign as the configured style. In Vue.js template, we can use either two styles for elements...
Read more >Self-closing syntax (“/>”) used on a non-void HTML element ...
A slash character ( / ), normally used for self-closing tags, has been found in an unexpected place for a tag, and the...
Read more >Self Closing Tags in HTML (With Examples) - Tutorials Tonight
self closing tags also known as void tags need not be close as they are understood to be self closing in HTML5, even...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I generally like
<div></div>
over</div>
so I would like to use the rule accordingly. How can I turn that check off for certain tags like<img .../>
,<br />
or<input ... />
?@armano2 Yeah, I’m working on this. I’m sorry that I didn’t commented.