Commit 7af3c2f
committed
fix(template-require-mandatory-role-attributes): lowercase role in input-pair whitelist
ARIA role tokens compare ASCII-case-insensitively, so
`<input type="checkbox" role="SWITCH">` should qualify for the same
aria-checked exemption as `role="switch"`. Lowercases the role at the
whitelist-key boundary, matching the case-handling that already exists
for the `type` attribute. Mirrors jsx-a11y (`getExplicitRole` lowercases
role) and stays internally consistent with template-no-redundant-role.
Tests cover SWITCH/Switch/MENUITEMCHECKBOX/Radio/menuitemRadio on the
documented input-role pairings.1 parent e8822db commit 7af3c2f
2 files changed
Lines changed: 19 additions & 2 deletions
File tree
- lib/rules
- tests/lib/rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
| |||
155 | 163 | | |
156 | 164 | | |
157 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
158 | 174 | | |
159 | 175 | | |
160 | 176 | | |
| |||
0 commit comments