-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
Description
I'm not sure if this is possible, but I want to throw it out there in case it is.
It would be nice to have the linter catch when you use header levels in a way which is inconsistent with accessibility rules and SEO. A few examples
Example 1 - h1 after h2
Bad
h2 Subheader
h1 HeaderGood
h1 Header
h2 SubheaderExample 2 - skip header levels
Bad
h1 Header
h3 Sub-subheader
Good
h1 Header
h2 Subheader
h3 Sub-subheader
Example 2 - missing h1
Bad
h2 Subheader
h3 Sub-subheader
Good
h1 Header
h2 Subheader
h3 Sub-subheader
Thinking about how this would be implemented, I'm not sure if it's possible because of render. It wouldn't be able to detect if a header is inside of another file. But I think there could at least be a simple version of example 1.