Skip to content
Marcos Caceres edited this page Mar 27, 2026 · 11 revisions

local-refs-exist linting rule

Default: true

Warns when an href="#fragment" link points to an anchor that doesn't exist in the document.

Example violation

<section id="foo">...</section>

<!-- BAD: #bar doesn't exist in the document -->
<a href="#bar">link</a>

How to fix

Either fix the href to point to an existing ID, or add the missing ID to the target element.

How to disable

var respecConfig = {
  lint: { "local-refs-exist": 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