@@ -58,6 +58,16 @@ ruleTester.run('attribute-hyphenation', rule, {
5858 filename : 'test.vue' ,
5959 code : '<template><div><slot myProp></slot></div></template>' ,
6060 options : [ 'never' ]
61+ } ,
62+ {
63+ filename : 'test.vue' ,
64+ code : '<template><div><custom :attr_ff="prop"></custom></div></template>' ,
65+ options : [ 'always' ]
66+ } ,
67+ {
68+ filename : 'test.vue' ,
69+ code : '<template><div><custom :attr_ff="prop"></custom></div></template>' ,
70+ options : [ 'never' ]
6171 }
6272 ] ,
6373
@@ -280,6 +290,84 @@ ruleTester.run('attribute-hyphenation', rule, {
280290 line : 1
281291 }
282292 ]
293+ } ,
294+ {
295+ filename : 'test.vue' ,
296+ code : '<template><div><custom :attr_Gg="prop"></custom></div></template>' ,
297+ output : null ,
298+ options : [ 'always' ] ,
299+ errors : [
300+ {
301+ message : "Attribute ':attr_Gg' must be hyphenated." ,
302+ type : 'VDirectiveKey' ,
303+ line : 1
304+ }
305+ ]
306+ } ,
307+ {
308+ filename : 'test.vue' ,
309+ code : '<template><div><custom :Attr_Hh="prop"></custom></div></template>' ,
310+ output : null ,
311+ options : [ 'always' ] ,
312+ errors : [
313+ {
314+ message : "Attribute ':Attr_Hh' must be hyphenated." ,
315+ type : 'VDirectiveKey' ,
316+ line : 1
317+ }
318+ ]
319+ } ,
320+ {
321+ filename : 'test.vue' ,
322+ code : '<template><div><custom :_attr_Jj="prop"></custom></div></template>' ,
323+ output : null ,
324+ options : [ 'always' ] ,
325+ errors : [
326+ {
327+ message : "Attribute ':_attr_Jj' must be hyphenated." ,
328+ type : 'VDirectiveKey' ,
329+ line : 1
330+ }
331+ ]
332+ } ,
333+ {
334+ filename : 'test.vue' ,
335+ code : '<template><div><custom :_attrKk="prop"></custom></div></template>' ,
336+ output : null ,
337+ options : [ 'always' ] ,
338+ errors : [
339+ {
340+ message : "Attribute ':_attrKk' must be hyphenated." ,
341+ type : 'VDirectiveKey' ,
342+ line : 1
343+ }
344+ ]
345+ } ,
346+ {
347+ filename : 'test.vue' ,
348+ code : '<template><div><custom :_AttrLl="prop"></custom></div></template>' ,
349+ output : null ,
350+ options : [ 'always' ] ,
351+ errors : [
352+ {
353+ message : "Attribute ':_AttrLl' must be hyphenated." ,
354+ type : 'VDirectiveKey' ,
355+ line : 1
356+ }
357+ ]
358+ } ,
359+ {
360+ filename : 'test.vue' ,
361+ code : '<template><div><custom :my-custom_prop="prop"></custom></div></template>' ,
362+ output : null ,
363+ options : [ 'never' ] ,
364+ errors : [
365+ {
366+ message : "Attribute ':my-custom_prop' can't be hyphenated." ,
367+ type : 'VDirectiveKey' ,
368+ line : 1
369+ }
370+ ]
283371 }
284372 ]
285373} )
0 commit comments