Skip to content

Conversation

@nicogaldamez
Copy link
Contributor

@nicogaldamez nicogaldamez commented Sep 3, 2025

Add html-body-only-elements rule

This PR adds a new linter rule html-body-only-elements that enforces certain HTML elements are only placed within the <body> tag.

What does this rule do?

This rule prevents content-bearing and interactive HTML elements from being placed in the <head> section or outside the HTML document structure.

Closes #378

@marcoroth marcoroth changed the title Add html-body-only-elements rule Implement html-body-only-elements rule linter rule Sep 16, 2025
@marcoroth marcoroth changed the title Implement html-body-only-elements rule linter rule Linter: Implement html-body-only-elements rule linter rule Oct 8, 2025
@marcoroth marcoroth changed the title Linter: Implement html-body-only-elements rule linter rule Linter: Implement html-body-only-elements linter rule Oct 14, 2025
@marcoroth marcoroth merged commit 09e065e into marcoroth:main Oct 14, 2025
asilano pushed a commit to fac/herb that referenced this pull request Oct 21, 2025
Add `html-body-only-elements` rule

This PR adds a new linter rule `html-body-only-elements` that enforces
certain HTML elements are only placed within the `<body>` tag.

## What does this rule do?

This rule prevents content-bearing and interactive HTML elements from
being placed in the `<head>` section or outside the HTML document
structure.

Closes marcoroth#378

---------

Co-authored-by: Marco Roth <marco.roth@intergga.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter Rule: Restrict certain elements to the <body> section

2 participants