# `html-cem/no-invalid-attr-value`

Validate attribute values against the type declared in the Custom Elements Manifest.

## Why

If a CEM declares `variant: 'primary' | 'ghost' | 'danger'`, passing `variant="huge"` is meaningless and almost always a bug.

## Supported types

CEM `type.text` is a free-form string; this rule pragmatically handles the common shapes and silently allows anything else (no false positives).

| `type.text` | Accepted attribute values |
| --- | --- |
| `string` | any |
| `number` | any value parseable by `Number()` |
| `boolean` | `""`, the attribute name, `"true"`, or `"false"` |
| `'a' \| 'b' \| 'c'` (string-literal union) | only the listed literals |

A trailing ` \| undefined` or ` \| null` is stripped before matching, since attributes are presence-based.

## Examples

CEM declares `<my-button variant: 'primary' \| 'ghost' \| 'danger', count: number, disabled: boolean>`.

❌ Incorrect

```html
<my-button variant="huge"></my-button>
<my-button count="not-a-number"></my-button>
<my-button disabled="maybe"></my-button>
```

✅ Correct

```html
<my-button variant="primary"></my-button>
<my-button count="42"></my-button>
<my-button disabled></my-button>
<my-button disabled="disabled"></my-button>
```
