@@ -12,11 +12,6 @@ const tester = new RuleTester({
1212 languageOptions : { parser : require ( 'vue-eslint-parser' ) , ecmaVersion : 2018 }
1313} )
1414
15- const isOldStylistic =
16- eslintStylisticVersion === undefined ||
17- semver . lt ( eslintStylisticVersion , '3.0.0' ) ||
18- semver . satisfies ( process . version , '<19.0.0 || ^21.0.0' )
19-
2015tester . run ( 'comma-style' , rule , {
2116 valid : [
2217 `<template>
@@ -41,17 +36,6 @@ tester.run('comma-style', rule, {
4136 </template>` ,
4237 options : [ 'first' , { exceptions : { ArrowFunctionExpression : false } } ]
4338 } ,
44- ...( isOldStylistic
45- ? [
46- `
47- <template>
48- <CustomButton v-slot="a,
49- b
50- ,c" />
51- </template>
52- `
53- ]
54- : [ ] ) ,
5539 {
5640 code : `
5741 <template>
@@ -63,35 +47,6 @@ tester.run('comma-style', rule, {
6347 }
6448 ] ,
6549 invalid : [
66- ...( isOldStylistic
67- ? [ ]
68- : [
69- {
70- code : `
71- <template>
72- <CustomButton v-slot="a,
73- b
74- ,c" />
75- </template>
76- ` ,
77- output : `
78- <template>
79- <CustomButton v-slot="a,
80- b,
81- c" />
82- </template>
83- ` ,
84- errors : [
85- {
86- message : "',' should be placed last." ,
87- line : 5 ,
88- column : 13 ,
89- endLine : 5 ,
90- endColumn : 14
91- }
92- ]
93- }
94- ] ) ,
9550 {
9651 code : `
9752 <template>
@@ -213,3 +168,53 @@ tester.run('comma-style', rule, {
213168 }
214169 ]
215170} )
171+
172+ if (
173+ eslintStylisticVersion === undefined ||
174+ semver . lt ( eslintStylisticVersion , '3.0.0' ) ||
175+ semver . satisfies ( process . version , '<19.0.0 || ^21.0.0' )
176+ ) {
177+ tester . run ( 'comma-style' , rule , {
178+ valid : [
179+ `
180+ <template>
181+ <CustomButton v-slot="a,
182+ b
183+ ,c" />
184+ </template>
185+ `
186+ ] ,
187+ invalid : [ ]
188+ } )
189+ } else {
190+ tester . run ( 'comma-style' , rule , {
191+ valid : [ ] ,
192+ invalid : [
193+ {
194+ code : `
195+ <template>
196+ <CustomButton v-slot="a,
197+ b
198+ ,c" />
199+ </template>
200+ ` ,
201+ output : `
202+ <template>
203+ <CustomButton v-slot="a,
204+ b,
205+ c" />
206+ </template>
207+ ` ,
208+ errors : [
209+ {
210+ message : "',' should be placed last." ,
211+ line : 5 ,
212+ column : 13 ,
213+ endLine : 5 ,
214+ endColumn : 14
215+ }
216+ ]
217+ }
218+ ]
219+ } )
220+ }
0 commit comments