@@ -12,11 +12,6 @@ const tester = new RuleTester({
12
12
languageOptions : { parser : require ( 'vue-eslint-parser' ) , ecmaVersion : 2018 }
13
13
} )
14
14
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
-
20
15
tester . run ( 'comma-style' , rule , {
21
16
valid : [
22
17
`<template>
@@ -41,17 +36,6 @@ tester.run('comma-style', rule, {
41
36
</template>` ,
42
37
options : [ 'first' , { exceptions : { ArrowFunctionExpression : false } } ]
43
38
} ,
44
- ...( isOldStylistic
45
- ? [
46
- `
47
- <template>
48
- <CustomButton v-slot="a,
49
- b
50
- ,c" />
51
- </template>
52
- `
53
- ]
54
- : [ ] ) ,
55
39
{
56
40
code : `
57
41
<template>
@@ -63,35 +47,6 @@ tester.run('comma-style', rule, {
63
47
}
64
48
] ,
65
49
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
- ] ) ,
95
50
{
96
51
code : `
97
52
<template>
@@ -213,3 +168,53 @@ tester.run('comma-style', rule, {
213
168
}
214
169
]
215
170
} )
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