Boolean attribute style (attribute-boolean-style)

Require a specific style when writing boolean attributes.

Rule details

Examples of incorrect code for this rule:

<input required="">
<input required="required">
error: Attribute "required" should omit value (attribute-boolean-style) at inline:1:8:
> 1 | <input required="">
    |        ^^^^^^^^
  2 | <input required="required">


error: Attribute "required" should omit value (attribute-boolean-style) at inline:2:8:
  1 | <input required="">
> 2 | <input required="required">
    |        ^^^^^^^^


2 errors found.

Examples of correct code for this rule:

<input required>

Options

This rule takes an optional object:

{
    "style": "omit"
}

Style