Empty attribute style
- Rule ID:
- attribute-empty-style
- Category:
- Style
- Standards:
- HTML5
Attributes without a value is implied to be an empty string by the HTML5 standard, e.g. <a download>
and <a download="">
are equal.
This rule requires a specific style when writing empty attributes.
Default is to omit the empty string ""
.
This rule does not have an effect on boolean attributes, see attribute-boolean-style
instead.
Rule details
Examples of incorrect code for this rule:
<a download=""></a>
Examples of correct code for this rule:
<a download></a>
Options
This rule takes an optional object:
{
"style": "omit"
}
Style
omit
require empty attributes to omit value, e.g.<a download></a>
empty
require empty attributes to be empty string, e.g.<a download=""></a>