The extended herb:disable syntax accepts a per-rule count or all suffix, turning the disable comment into a file-scoped ratchet:
erb
<%# herb:disable html-tag-name-lowercase 3 %>
`herb:disable` entry for `html-tag-name-lowercase` expects 3 offenses but the file has none. Remove the count (or the entry). (herb-disable-comment-out-of-date)
This rule fires whenever the count in such an entry disagrees with the number of offenses the linter actually finds:
N > E — the count over-promises. Every actual offense is still reported; this rule additionally flags the drift so you can lower the count.
0 < N < E — the count under-promises. The linter suppresses the first N offenses and lets the rest surface; this rule flags the drift so you can raise the count.
N > 0 and E == 0 — the rule no longer offends. This rule flags the entry so you can drop it (or run --update-disable-counts).
the rule is not enabled in your configuration, so its offenses cannot be counted at all. This rule flags the entry, and autofix leaves the count alone so the baseline survives re-enabling the rule.
herb:disable rule all entries opt out of drift tracking and never emit this rule.
The whole point of the counted disable is that the count ratchets down as you fix offenses and holds the line against new ones. A stale count silently defeats both directions of that guarantee.
The autofix rewrites N in the source to match the actual count. Use --fix to apply, or --update-disable-counts to bulk-refresh across the project without dragging in other autofixes.
Linter Rule: Detect out-of-date
herb:disablecounts Rule:
herb-disable-comment-out-of-dateDescription
The extended
herb:disablesyntax accepts a per-rule count orallsuffix, turning the disable comment into a file-scoped ratchet:This rule fires whenever the count in such an entry disagrees with the number of offenses the linter actually finds:
N > E— the count over-promises. Every actual offense is still reported; this rule additionally flags the drift so you can lower the count.0 < N < E— the count under-promises. The linter suppresses the firstNoffenses and lets the rest surface; this rule flags the drift so you can raise the count.N > 0andE == 0— the rule no longer offends. This rule flags the entry so you can drop it (or run--update-disable-counts).herb:disable rule allentries opt out of drift tracking and never emit this rule.Rationale
The whole point of the counted disable is that the count ratchets down as you fix offenses and holds the line against new ones. A stale count silently defeats both directions of that guarantee.
Autofix
The autofix rewrites
Nin the source to match the actual count. Use--fixto apply, or--update-disable-countsto bulk-refresh across the project without dragging in other autofixes.Examples
Bad
The comment expects three offenses but the file only produces two. Autofix rewrites the count to
2.Good
References
herb-disable-comment-unnecessaryherb-disable-comment-malformed