Skip to content
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

enforce no self-closing tags with tag-self-close #311

Closed
ricealexander opened this issue Nov 18, 2018 · 1 comment · Fixed by #696
Closed

enforce no self-closing tags with tag-self-close #311

ricealexander opened this issue Nov 18, 2018 · 1 comment · Fixed by #696
Assignees
Labels
enhancement Functionality that enhances existing features PR needed

Comments

@ricealexander
Copy link

Describe the solution you'd like
The tag-self-close rule, when true, requires empty tags to be self-closed. When false, this rule does not apply.

I would like an option to require tags not to be self-closed. <br/> should always be typed as <br>, <hr /> as <hr>, no self-closing tags for meta, link, ect.

With HTML5 as a standard for the last four years, and self-closing tags being optional in the spec, I feel this is practical to enforce consistent markup.

Describe alternatives you've considered
Simply using "tag-self-close": false does not enforce not having closing tags. I've seen numerous code samples that use a mix of self-closed and unclosed tags, which I feel to be sloppy.

Additional context
HTML5 self-closing tags are optional.
If this feature request is approved, all void elements (link, meta, hr, br, ect) should be able to have no-self-closing enforced on them.
There may need to be an exception for foreign elements such as svg-related tags.

@thedaviddias thedaviddias added enhancement Functionality that enhances existing features PR needed triage An HTMLHint team member will look at this issue labels Jan 10, 2019
@linahsie linahsie self-assigned this Feb 23, 2019
@linahsie linahsie added #status: accepted 👍 and removed triage An HTMLHint team member will look at this issue labels Feb 23, 2019
@stale
Copy link

stale bot commented May 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the bot:stale Issue marked as stale because there was no activity label May 14, 2020
@stale stale bot closed this as completed May 28, 2020
zcorpan added a commit to bocoup/HTMLHint that referenced this issue Oct 26, 2021
@coliff coliff reopened this Oct 27, 2021
@stale stale bot removed the bot:stale Issue marked as stale because there was no activity label Oct 27, 2021
github-actions bot pushed a commit that referenced this issue Oct 29, 2021
# [0.16.0](v0.15.2...v0.16.0) (2021-10-29)

### Features

* **rules:** add empty-tag-not-self-closed rule ([#696](#696)) ([ec171ac](ec171ac)), closes [#311](#311)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Functionality that enhances existing features PR needed
4 participants