Warns when a <%# herb:disable ... %> comment doesn't actually suppress any linter offenses on that line, indicating it's unnecessary and should be removed.
Unnecessary <%# herb:disable ... %> comments create noise in the codebase and can mislead developers about which rules are being suppressed. These comments often remain after the code has been refactored and no longer triggers the offense.
Removing unnecessary disable comments keeps the codebase clean and ensures that suppression comments accurately reflect actual rule violations being intentionally ignored.
No offenses from rules `html-tag-name-lowercase`, `html-attribute-double-quotes` on this line. Remove them from the `herb:disable` comment. (herb-disable-comment-unnecessary)
<div id="test-1">content</div> <%# herb:disable all %>
No offenses to disable on this line. Remove the `herb:disable all` comment. (herb-disable-comment-unnecessary)
Linter Rule: Detect unnecessary
herb:disablecomments Rule:
herb-disable-comment-unnecessaryDescription
Warns when a
<%# herb:disable ... %>comment doesn't actually suppress any linter offenses on that line, indicating it's unnecessary and should be removed.Rationale
Unnecessary
<%# herb:disable ... %>comments create noise in the codebase and can mislead developers about which rules are being suppressed. These comments often remain after the code has been refactored and no longer triggers the offense.Removing unnecessary disable comments keeps the codebase clean and ensures that suppression comments accurately reflect actual rule violations being intentionally ignored.
Examples
✅ Good
🚫 Bad
References
-