heading level (heading-level)

Validates heading level increments and order. Headings must start at h1 and can only increase one level at a time.

Rule details

Examples of incorrect code for this rule:

<h1>Heading 1</h1>
<h3>Subheading</h3>
error: Heading level can only increase by one, expected h2 (heading-level) at inline:2:2:
  1 | <h1>Heading 1</h1>
> 2 | <h3>Subheading</h3>
    |  ^^


1 error found.

Examples of correct code for this rule:

<h1>Heading 1</h1>
<h2>Subheading</h2>