no unused vars - speced/respec GitHub Wiki

no-unused-vars linting rule

Default: false

Warns when a <var> element in an algorithm is defined (first occurrence) but never referenced again. Only checks variables inside <ol class="algorithm"> sections.

Example violation

<ol class="algorithm">
  <li>Let |request| be a new request.</li>
  <li>Let |unused| be null.</li>       <!-- warned: never used again -->
  <li>Set |request|'s URL to the URL.</li>
</ol>

How to enable

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

Suppress for one variable

<var data-ignore-unused>someVar</var>

Notes

  • Only applies inside <ol class="algorithm"> sections
  • The first occurrence of a |variable| is treated as its definition
  • The |variable| shorthand does not support data-ignore-unused — use <var data-ignore-unused> explicitly
⚠️ **GitHub.com Fallback** ⚠️