@@ -44,6 +44,32 @@ tester.run('v-on-event-hyphenation', rule, {
44
44
</template>
45
45
` ,
46
46
options : [ 'never' , { ignore : [ 'custom' ] } ]
47
+ } ,
48
+ {
49
+ code : `
50
+ <template>
51
+ <VueComponent v-on:custom-event="events"/>
52
+ </template>
53
+ ` ,
54
+ options : [ 'never' , { ignore : [ 'custom-event' ] } ]
55
+ } ,
56
+ {
57
+ code : `
58
+ <template>
59
+ <VueComponent v-on:custom-event="events"/>
60
+ <custom-component v-on:custom-event="events"/>
61
+ </template>
62
+ ` ,
63
+ options : [ 'never' , { ignoreTags : [ '/^Vue/' , 'custom-component' ] } ]
64
+ } ,
65
+ {
66
+ code : `
67
+ <template>
68
+ <VueComponent v-on:customEvent="events"/>
69
+ <custom-component v-on:customEvent="events"/>
70
+ </template>
71
+ ` ,
72
+ options : [ 'always' , { ignoreTags : [ '/^Vue/' , 'custom-component' ] } ]
47
73
}
48
74
] ,
49
75
invalid : [
@@ -179,6 +205,50 @@ tester.run('v-on-event-hyphenation', rule, {
179
205
"v-on event '@upDate:model-value' can't be hyphenated." ,
180
206
"v-on event '@up-date:model-value' can't be hyphenated."
181
207
]
208
+ } ,
209
+ {
210
+ code : `
211
+ <template>
212
+ <VueComponent v-on:custom-event="events"/>
213
+ <CustomComponent v-on:custom-event="events"/>
214
+ </template>
215
+ ` ,
216
+ output : `
217
+ <template>
218
+ <VueComponent v-on:customEvent="events"/>
219
+ <CustomComponent v-on:custom-event="events"/>
220
+ </template>
221
+ ` ,
222
+ options : [ 'never' , { autofix : true , ignoreTags : [ 'CustomComponent' ] } ] ,
223
+ errors : [
224
+ {
225
+ message : "v-on event 'v-on:custom-event' can't be hyphenated." ,
226
+ line : 3 ,
227
+ column : 23
228
+ }
229
+ ]
230
+ } ,
231
+ {
232
+ code : `
233
+ <template>
234
+ <VueComponent v-on:customEvent="events"/>
235
+ <CustomComponent v-on:customEvent="events"/>
236
+ </template>
237
+ ` ,
238
+ output : `
239
+ <template>
240
+ <VueComponent v-on:custom-event="events"/>
241
+ <CustomComponent v-on:customEvent="events"/>
242
+ </template>
243
+ ` ,
244
+ options : [ 'always' , { autofix : true , ignoreTags : [ 'CustomComponent' ] } ] ,
245
+ errors : [
246
+ {
247
+ message : "v-on event 'v-on:customEvent' must be hyphenated." ,
248
+ line : 3 ,
249
+ column : 23
250
+ }
251
+ ]
182
252
}
183
253
]
184
254
} )
0 commit comments