Commit 999a107
committed
fix(template-require-mandatory-role-attributes): extend native-checked exemption to {{input}} helper
Two changes:
1. `getInputType` now recognises the classic Ember `{{input type=...}}`
helper as an input host, in addition to the native `<input>` element.
The `GlimmerMustacheStatement` handler is updated to pass `node` into
`getMissingRequiredAttributes`, matching the element-node handler.
2. Reverts the defensive `role.toLowerCase()` in the whitelist-key build
from the previous commit — it was dead code. The caller
(`getMissingRequiredAttributes`) short-circuits via aria-query's
case-sensitive `roles.get(role)`, so `role` is guaranteed lowercase
by the time `isNativelyChecked` runs. Rule-wide role case-
insensitivity is not in scope for this PR; that is ember-cli#2728.
Tests adjusted accordingly: drop mixed-case-role valid tests (they
passed for the wrong reason — via the case-sensitivity short-circuit in
aria-query, not via the whitelist). Add coverage for `{{input}}`
helper on both gts and hbs parsers, including off-whitelist pairings
that must still flag.1 parent 7af3c2f commit 999a107
2 files changed
Lines changed: 70 additions & 23 deletions
File tree
- lib/rules
- tests/lib/rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
58 | 74 | | |
59 | | - | |
| 75 | + | |
60 | 76 | | |
61 | 77 | | |
62 | | - | |
63 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
64 | 82 | | |
65 | 83 | | |
66 | 84 | | |
| |||
156 | 174 | | |
157 | 175 | | |
158 | 176 | | |
159 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
160 | 182 | | |
161 | 183 | | |
162 | 184 | | |
| |||
Lines changed: 39 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
| 42 | + | |
40 | 43 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
105 | 119 | | |
106 | 120 | | |
107 | 121 | | |
| |||
163 | 177 | | |
164 | 178 | | |
165 | 179 | | |
| 180 | + | |
166 | 181 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
174 | 187 | | |
175 | 188 | | |
176 | 189 | | |
| |||
240 | 253 | | |
241 | 254 | | |
242 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
243 | 268 | | |
244 | 269 | | |
0 commit comments