Skip to content

empty-attr-value

Added in 0.2.9 · Related issues · View source

Fix is always available.

What it does

Checks for empty id or class attribute values on HTML elements.

Why is this bad?

An id="" or class="" attribute is almost always unintentional: no CSS class selector matches an element with an empty class, and document.getElementById("") returns nothing. Removing the attribute reduces template noise.

Example

<div id="" class="">content</div>

Use instead:

<div>content</div>