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

Feature request: new linter to enforce heading order #123

Open
dkniffin opened this issue Jan 27, 2021 · 0 comments
Open

Feature request: new linter to enforce heading order #123

dkniffin opened this issue Jan 27, 2021 · 0 comments

Comments

@dkniffin
Copy link
Contributor

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 Header

Good

h1 Header
h2 Subheader

Example 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.

@sds sds added the enhancement label Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants