Commit 54955c2
committed
fix(template-require-iframe-title): flag title={{null|undefined|number}}
Before: the rule only rejected title={{false}} among mustache literals.
title={{null}}, title={{undefined}}, and title={{42}} (any non-string
literal) were silently accepted even though none produces a useful
accessible name for an <iframe>.
Fix: extract isInvalidTitleLiteral(); treat boolean, null, undefined,
and numeric literals as invalid title values in both GlimmerMustacheStatement
and single-part GlimmerConcatStatement positions.
Six new invalid tests (3 literal types × 2 syntax forms).
Note: whitespace-only title values (e.g. title=" ") remain flagged —
the audit suggested upstream jsx-a11y accepts these, but an all-whitespace
title provides no accessible name, so our stricter behavior is kept.1 parent 24882a3 commit 54955c2
2 files changed
Lines changed: 57 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
1 | 20 | | |
2 | 21 | | |
3 | 22 | | |
| |||
93 | 112 | | |
94 | 113 | | |
95 | 114 | | |
96 | | - | |
97 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
98 | 118 | | |
99 | 119 | | |
100 | 120 | | |
101 | 121 | | |
102 | 122 | | |
103 | | - | |
| 123 | + | |
| 124 | + | |
104 | 125 | | |
105 | 126 | | |
106 | 127 | | |
107 | 128 | | |
108 | | - | |
| 129 | + | |
109 | 130 | | |
110 | 131 | | |
111 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
107 | 139 | | |
108 | 140 | | |
109 | 141 | | |
| |||
0 commit comments