Skip to content

no headingless sections

Marcos Caceres edited this page Mar 27, 2026 · 9 revisions

no-headingless-sections linting rule

Default: true

Warns when a <section> element does not begin with a heading element (<h2><h6>).

Example violation

<!-- BAD: no heading -->
<section id="intro">
  <p>Content without a heading.</p>
</section>

How to fix

<section id="intro">
  <h2>Introduction</h2>
  <p>Content with a heading.</p>
</section>

How to disable

var respecConfig = {
  lint: { "no-headingless-sections": false },
};

Notes

  • Sections without headings are inaccessible — screen readers and ToC generation depend on headings
  • The one exception is the <body> element itself, which is not required to start with a heading

Guides

Configuration options

W3C Configuration options

Linting rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

HTML attributes

CSS Classes

Special properties

Clone this wiki locally