Require attribute (element-required-attributes)

Ensures required attributes are present but may be empty. Use attribute-allowed-values to disallow certain values.

The requirements comes from the element metadata:

  "input": {
    "requiredAttributes": ["type"]

Rule details

Examples of incorrect code for this rule:

error: <input> is missing required attribute "type" (element-required-attributes) at inline:1:2:
> 1 | <input>
    |  ^^^^^

1 error found.

Examples of correct code for this rule:

<input type="">
<input type="text">