Skip to content

no unused dfns

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

no-unused-dfns linting rule

Default: false

Warns when a definition (<dfn>) is never referenced anywhere in the document and is not exported.

How to enable

var respecConfig = {
  lint: {
    "no-unused-dfns": true,
  },
};

Example violation

<!-- Defined but never linked to anywhere in the document: -->
<dfn>orphaned concept</dfn>

How to fix

Choose one:

  1. Link to it somewhere in the document: [=orphaned concept=]
  2. Export it so other specs can use it: <dfn class="export">orphaned concept</dfn>
  3. Remove the <dfn> if the term is no longer needed
  4. Use a plain element if you want the text styled as a definition but don't need linking: <span class="dfn-paneled">term</span>

How to disable

var respecConfig = {
  lint: { "no-unused-dfns": 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