Allowed attribute values (attribute-allowed-values)

Validates attributes for allowed values. Use element-required-attributes tog validate presence of attributes.

The requirements comes from the element metadata:

{
  "input": {
    "attributes": {
      "type": ["text", "email", "..."]
    }
  }
}

Rule details

Examples of incorrect code for this rule:

<input type="foobar">
error: Attribute "type" has invalid value "foobar" (attribute-allowed-values) at inline:1:14:
> 1 | <input type="foobar">
    |              ^^^^^^


1 error found.

Examples of correct code for this rule:

<input type="text">