@@ -74,13 +74,17 @@ ruleTester.run('aria-proptypes', rule, {
74
74
{ code : '<div aria-hidden={!"yes"} />' } ,
75
75
{ code : '<div aria-hidden={foo} />' } ,
76
76
{ code : '<div aria-hidden={foo.bar} />' } ,
77
+ { code : '<div aria-hidden={null} />' } ,
78
+ { code : '<div aria-hidden={undefined} />' } ,
77
79
{ code : '<div aria-hidden={<div />} />' } ,
78
80
79
81
// STRING
80
82
{ code : '<div aria-label="Close" />' } ,
81
83
{ code : '<div aria-label={`Close`} />' } ,
82
84
{ code : '<div aria-label={foo} />' } ,
83
85
{ code : '<div aria-label={foo.bar} />' } ,
86
+ { code : '<div aria-label={null} />' } ,
87
+ { code : '<div aria-label={undefined} />' } ,
84
88
{ code : '<input aria-invalid={error ? "true" : "false"} />' } ,
85
89
{ code : '<input aria-invalid={undefined ? "true" : "false"} />' } ,
86
90
@@ -97,6 +101,8 @@ ruleTester.run('aria-proptypes', rule, {
97
101
{ code : '<div aria-checked={foo.bar} />' } ,
98
102
{ code : '<div aria-checked="mixed" />' } ,
99
103
{ code : '<div aria-checked={`mixed`} />' } ,
104
+ { code : '<div aria-checked={null} />' } ,
105
+ { code : '<div aria-checked={undefined} />' } ,
100
106
101
107
// INTEGER
102
108
{ code : '<div aria-level={123} />' } ,
@@ -108,6 +114,8 @@ ruleTester.run('aria-proptypes', rule, {
108
114
{ code : '<div aria-level="123" />' } ,
109
115
{ code : '<div aria-level={foo} />' } ,
110
116
{ code : '<div aria-level={foo.bar} />' } ,
117
+ { code : '<div aria-level={null} />' } ,
118
+ { code : '<div aria-level={undefined} />' } ,
111
119
112
120
// NUMBER
113
121
{ code : '<div aria-valuemax={123} />' } ,
@@ -119,6 +127,8 @@ ruleTester.run('aria-proptypes', rule, {
119
127
{ code : '<div aria-valuemax="123" />' } ,
120
128
{ code : '<div aria-valuemax={foo} />' } ,
121
129
{ code : '<div aria-valuemax={foo.bar} />' } ,
130
+ { code : '<div aria-valuemax={null} />' } ,
131
+ { code : '<div aria-valuemax={undefined} />' } ,
122
132
123
133
// TOKEN
124
134
{ code : '<div aria-sort="ascending" />' } ,
@@ -142,6 +152,8 @@ ruleTester.run('aria-proptypes', rule, {
142
152
{ code : '<div aria-invalid="false" />' } ,
143
153
{ code : '<div aria-invalid="grammar" />' } ,
144
154
{ code : '<div aria-invalid="spelling" />' } ,
155
+ { code : '<div aria-invalid={null} />' } ,
156
+ { code : '<div aria-invalid={undefined} />' } ,
145
157
146
158
// TOKENLIST
147
159
{ code : '<div aria-relevant="additions" />' } ,
@@ -159,6 +171,8 @@ ruleTester.run('aria-proptypes', rule, {
159
171
{ code : '<div aria-relevant={`removals additions text all`} />' } ,
160
172
{ code : '<div aria-relevant={foo} />' } ,
161
173
{ code : '<div aria-relevant={foo.bar} />' } ,
174
+ { code : '<div aria-relevant={null} />' } ,
175
+ { code : '<div aria-relevant={undefined} />' } ,
162
176
163
177
// ID
164
178
{ code : '<div aria-activedescendant="ascending" />' } ,
@@ -176,6 +190,8 @@ ruleTester.run('aria-proptypes', rule, {
176
190
{ code : '<div aria-activedescendant={`other`} />' } ,
177
191
{ code : '<div aria-activedescendant={foo} />' } ,
178
192
{ code : '<div aria-activedescendant={foo.bar} />' } ,
193
+ { code : '<div aria-activedescendant={null} />' } ,
194
+ { code : '<div aria-activedescendant={undefined} />' } ,
179
195
180
196
// IDLIST
181
197
{ code : '<div aria-labelledby="additions" />' } ,
@@ -193,13 +209,11 @@ ruleTester.run('aria-proptypes', rule, {
193
209
{ code : '<div aria-labelledby={`removals additions text all`} />' } ,
194
210
{ code : '<div aria-labelledby={foo} />' } ,
195
211
{ code : '<div aria-labelledby={foo.bar} />' } ,
212
+ { code : '<div aria-labelledby={null} />' } ,
213
+ { code : '<div aria-labelledby={undefined} />' } ,
196
214
] . map ( parserOptionsMapper ) ,
197
215
invalid : [
198
216
// BOOLEAN
199
- {
200
- code : '<div aria-hidden={undefined} />' ,
201
- errors : [ errorMessage ( 'aria-hidden' ) ] ,
202
- } ,
203
217
{ code : '<div aria-hidden="yes" />' , errors : [ errorMessage ( 'aria-hidden' ) ] } ,
204
218
{ code : '<div aria-hidden="no" />' , errors : [ errorMessage ( 'aria-hidden' ) ] } ,
205
219
{ code : '<div aria-hidden={1234} />' , errors : [ errorMessage ( 'aria-hidden' ) ] } ,
@@ -209,18 +223,13 @@ ruleTester.run('aria-proptypes', rule, {
209
223
} ,
210
224
211
225
// STRING
212
- { code : '<div aria-label={undefined} />' , errors : [ errorMessage ( 'aria-label' ) ] } ,
213
226
{ code : '<div aria-label />' , errors : [ errorMessage ( 'aria-label' ) ] } ,
214
227
{ code : '<div aria-label={true} />' , errors : [ errorMessage ( 'aria-label' ) ] } ,
215
228
{ code : '<div aria-label={false} />' , errors : [ errorMessage ( 'aria-label' ) ] } ,
216
229
{ code : '<div aria-label={1234} />' , errors : [ errorMessage ( 'aria-label' ) ] } ,
217
230
{ code : '<div aria-label={!true} />' , errors : [ errorMessage ( 'aria-label' ) ] } ,
218
231
219
232
// TRISTATE
220
- {
221
- code : '<div aria-checked={undefined} />' ,
222
- errors : [ errorMessage ( 'aria-checked' ) ] ,
223
- } ,
224
233
{ code : '<div aria-checked="yes" />' , errors : [ errorMessage ( 'aria-checked' ) ] } ,
225
234
{ code : '<div aria-checked="no" />' , errors : [ errorMessage ( 'aria-checked' ) ] } ,
226
235
{ code : '<div aria-checked={1234} />' , errors : [ errorMessage ( 'aria-checked' ) ] } ,
@@ -230,7 +239,6 @@ ruleTester.run('aria-proptypes', rule, {
230
239
} ,
231
240
232
241
// INTEGER
233
- { code : '<div aria-level={undefined} />' , errors : [ errorMessage ( 'aria-level' ) ] } ,
234
242
{ code : '<div aria-level="yes" />' , errors : [ errorMessage ( 'aria-level' ) ] } ,
235
243
{ code : '<div aria-level="no" />' , errors : [ errorMessage ( 'aria-level' ) ] } ,
236
244
{ code : '<div aria-level={`abc`} />' , errors : [ errorMessage ( 'aria-level' ) ] } ,
@@ -240,10 +248,6 @@ ruleTester.run('aria-proptypes', rule, {
240
248
{ code : '<div aria-level={!"false"} />' , errors : [ errorMessage ( 'aria-level' ) ] } ,
241
249
242
250
// NUMBER
243
- {
244
- code : '<div aria-valuemax={undefined} />' ,
245
- errors : [ errorMessage ( 'aria-valuemax' ) ] ,
246
- } ,
247
251
{ code : '<div aria-valuemax="yes" />' , errors : [ errorMessage ( 'aria-valuemax' ) ] } ,
248
252
{ code : '<div aria-valuemax="no" />' , errors : [ errorMessage ( 'aria-valuemax' ) ] } ,
249
253
{
@@ -268,7 +272,6 @@ ruleTester.run('aria-proptypes', rule, {
268
272
{ code : '<div aria-sort="" />' , errors : [ errorMessage ( 'aria-sort' ) ] } ,
269
273
{ code : '<div aria-sort="descnding" />' , errors : [ errorMessage ( 'aria-sort' ) ] } ,
270
274
{ code : '<div aria-sort />' , errors : [ errorMessage ( 'aria-sort' ) ] } ,
271
- { code : '<div aria-sort={undefined} />' , errors : [ errorMessage ( 'aria-sort' ) ] } ,
272
275
{ code : '<div aria-sort={true} />' , errors : [ errorMessage ( 'aria-sort' ) ] } ,
273
276
{ code : '<div aria-sort={"false"} />' , errors : [ errorMessage ( 'aria-sort' ) ] } ,
274
277
{
@@ -283,10 +286,6 @@ ruleTester.run('aria-proptypes', rule, {
283
286
errors : [ errorMessage ( 'aria-relevant' ) ] ,
284
287
} ,
285
288
{ code : '<div aria-relevant />' , errors : [ errorMessage ( 'aria-relevant' ) ] } ,
286
- {
287
- code : '<div aria-relevant={undefined} />' ,
288
- errors : [ errorMessage ( 'aria-relevant' ) ] ,
289
- } ,
290
289
{
291
290
code : '<div aria-relevant={true} />' ,
292
291
errors : [ errorMessage ( 'aria-relevant' ) ] ,
0 commit comments