Require attribute (element-required-attributes)

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

The requirements comes from the element metadata:

  "input": {
    "attributes": {
      "type": {
        "required": true

Rule details

Examples of incorrect code for this rule:

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

1 error found.

Examples of correct code for this rule:

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