Skip to content
Marcos Caceres edited this page Mar 28, 2026 · 15 revisions

a11y linting rule

Default: false

Runs accessibility checks using axe-core. Reports violations as ReSpec warnings, highlighting the offending elements in the document.

How to enable

var respecConfig = {
  lint: {
    a11y: true,
  },
};
var respecConfig = {
  lint: {
    a11y: {
      runOnly: ["image-alt", "link-name"],
    },
  },
};
var respecConfig = {
  lint: {
    a11y: {
      rules: {
        "color-contrast": { enabled: true },  // slow — disabled by default
        "image-alt": { enabled: false },
      },
    },
  },
};

Rules disabled by default

These axe-core rules run if you enable a11y: true, except the following, which are disabled because they are slow or produce false positives on spec documents:

Rule Reason disabled
color-contrast Too slow — enable explicitly when needed
landmark-one-main Spec pages often lack <main>; would mark entire page as errored
landmark-unique Causes false positives in spec document structure
region Similar false-positive issue with spec layout

All other axe-core default rules run. For the full list, see axe-core rule descriptions.

Quick enable via URL

Add ?a11y=true to any spec URL to enable all default rules temporarily, without changing config.

Notes

  • Violations appear as yellow warnings in the ReSpec pill counter; click to see the offending elements highlighted
  • Running on hosted documents (GitHub Pages, W3C servers) may slow load time — enable selectively
  • See axe options documentation for the full configuration API

How to disable

var respecConfig = {
  lint: { a11y: false },
};

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