@@ -81,11 +81,7 @@ tester.run('v-on-handler-style', rule, {
81
81
<button @click="foo()" />
82
82
<button @click="() => foo()" />
83
83
</template>` ,
84
- output : `<template>
85
- <button @click="foo" />
86
- <button @click="foo" />
87
- <button @click="foo" />
88
- </template>` ,
84
+ output : null ,
89
85
options : [ [ 'method' , 'inline-function' ] ] ,
90
86
errors : [
91
87
{
@@ -107,11 +103,7 @@ tester.run('v-on-handler-style', rule, {
107
103
<button @click="foo()" />
108
104
<button @click="() => foo()" />
109
105
</template>` ,
110
- output : `<template>
111
- <button @click="foo" />
112
- <button @click="foo" />
113
- <button @click="foo" />
114
- </template>` ,
106
+ output : null ,
115
107
errors : [
116
108
{
117
109
message : 'Prefer method handler over inline handler in v-on.' ,
@@ -181,7 +173,7 @@ tester.run('v-on-handler-style', rule, {
181
173
{
182
174
filename : 'test.vue' ,
183
175
code : '<template><div @click="foo( )" /></template>' ,
184
- output : `<template><div @click="foo" /></template>` ,
176
+ output : null ,
185
177
options : [ [ 'method' , 'inline-function' ] ] ,
186
178
errors : [
187
179
{
@@ -266,13 +258,7 @@ tester.run('v-on-handler-style', rule, {
266
258
<button @click="{ fn(); }" />
267
259
<button @click="{(fn());;;}" />
268
260
</template>` ,
269
- output : `
270
- <template>
271
- <button @click="fn" />
272
- <button @click="fn" />
273
- <button @click="fn" />
274
- <button @click="fn" />
275
- </template>` ,
261
+ output : null ,
276
262
options : [ [ 'method' , 'inline-function' ] ] ,
277
263
errors : [
278
264
{
@@ -304,11 +290,7 @@ tester.run('v-on-handler-style', rule, {
304
290
<div @click=" beforeSpace()" />
305
291
<div @click='afterSpace() ' />
306
292
</template>` ,
307
- output : `
308
- <template>
309
- <div @click="beforeSpace" />
310
- <div @click='afterSpace' />
311
- </template>` ,
293
+ output : null ,
312
294
options : [ [ 'method' , 'inline-function' ] ] ,
313
295
errors : [
314
296
{
@@ -329,10 +311,7 @@ tester.run('v-on-handler-style', rule, {
329
311
<template>
330
312
<button @click=" foo ( ) " />
331
313
</template>` ,
332
- output : `
333
- <template>
334
- <button @click="foo" />
335
- </template>` ,
314
+ output : null ,
336
315
options : [ [ 'method' , 'inline-function' ] ] ,
337
316
errors : [
338
317
{
@@ -353,15 +332,7 @@ tester.run('v-on-handler-style', rule, {
353
332
}
354
333
}
355
334
</script>` ,
356
- output : `
357
- <template><button @click="foo" /></template>
358
- <script>
359
- export default {
360
- methods: {
361
- foo() {}
362
- }
363
- }
364
- </script>` ,
335
+ output : null ,
365
336
options : [ [ 'method' , 'inline-function' ] ] ,
366
337
errors : [
367
338
{
@@ -382,15 +353,7 @@ tester.run('v-on-handler-style', rule, {
382
353
}
383
354
}
384
355
</script>` ,
385
- output : `
386
- <template><button @click="foo" /></template>
387
- <script>
388
- export default {
389
- methods: {
390
- foo: () => {}
391
- }
392
- }
393
- </script>` ,
356
+ output : null ,
394
357
options : [ [ 'method' , 'inline-function' ] ] ,
395
358
errors : [
396
359
{
@@ -545,11 +508,7 @@ tester.run('v-on-handler-style', rule, {
545
508
<button @click="e()" />
546
509
</template>
547
510
</template>` ,
548
- output : `<template>
549
- <template v-for="e in list">
550
- <button @click="e" />
551
- </template>
552
- </template>` ,
511
+ output : null ,
553
512
options : [ [ 'method' , 'inline-function' ] ] ,
554
513
errors : [
555
514
{
@@ -716,9 +675,9 @@ tester.run('v-on-handler-style', rule, {
716
675
<button @click="() => { foo() }" />
717
676
</template>` ,
718
677
output : `<template>
678
+ <button @click="() => foo()" />
719
679
<button @click="foo" />
720
- <button @click="foo" />
721
- <button @click="foo" />
680
+ <button @click="() => { foo() }" />
722
681
</template>` ,
723
682
options : [ [ 'method' , 'inline' ] ] ,
724
683
errors : [
@@ -1008,7 +967,7 @@ tester.run('v-on-handler-style', rule, {
1008
967
</template>` ,
1009
968
output : `<template>
1010
969
<template v-for="e in list">
1011
- <button @click="e " />
970
+ <button @click="() => e() " />
1012
971
<button @click="e" />
1013
972
<button @click="e" />
1014
973
</template>
0 commit comments