Skip to content

no headingless sections

Sid Vishnoi edited this page Jul 8, 2020 · 8 revisions

Guides

Configuration options

W3C Configuration options

Linter rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

WebIDL

HTML attributes

CSS Classes

Special properties

Clone this wiki locally

no-headingless-sections

Enable this lint rule to get a warning if there is some <section> in the document that does not start with a heading element (h1-h6).

For example:

<section id="foo">
  <!-- should've begun with a heading -->
  <p>content begins</p>
</section>

You'll receive a warning pointing you to the heading-less sections.

var respecConfig = {
  lint: {
    "no-headingless-sections": true,
  },
};
example warning for no-headingless-sections developer console with warning for no-headingless-sections