Skip to content

Lint rule: heading level skips #18

Description

@roxspring

Implement a lint rule that reports when heading levels skip a level (e.g. H1 → H3 without H2).

Scope

  • Walk all Heading nodes in document order
  • Report a violation if the heading level increases by more than 1 from the previous heading
  • Report file path and line number

Example violation

guide/editor.md:12: heading level skip — H1 followed by H3 (expected H2)

Acceptance criteria

  • H1 → H2 → H3: no violation
  • H1 → H3: violation reported
  • H1 → H2 → H1 → H2: no violation (level can decrease freely)
  • Document with no headings: no violation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions