question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

html-no-self-closing: Ignore components option

See original GitHub issue

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:

<div />
<ui-dropdown />

This shouldn’t be reported:

<div></div>
<ui-dropdown />

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
molerat619commented, Aug 28, 2018

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 ... />?

2reactions
mysticateacommented, Aug 3, 2017

@armano2 Yeah, I’m working on this. I’m sorry that I didn’t commented.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found