@@ -161,15 +161,69 @@ ruleTester.run("space-infix-ops", rule, {
161161 } ,
162162 {
163163 code : "a?b:c" ,
164- output : "a ? b:c" ,
165- errors : [ {
166- messageId : "missingSpace" ,
167- data : { operator : "?" } ,
168- type : "ConditionalExpression" ,
169- line : 1 ,
170- column : 2 ,
171- endColumn : 3
172- } ]
164+ output : "a ? b : c" ,
165+ errors : [
166+ {
167+ messageId : "missingSpace" ,
168+ data : { operator : "?" } ,
169+ type : "ConditionalExpression" ,
170+ line : 1 ,
171+ column : 2 ,
172+ endColumn : 3
173+ } ,
174+ {
175+ messageId : "missingSpace" ,
176+ data : { operator : ":" } ,
177+ type : "ConditionalExpression" ,
178+ line : 1 ,
179+ column : 4 ,
180+ endColumn : 5
181+ }
182+ ]
183+ } ,
184+ {
185+ code : "a? b :c" ,
186+ output : "a ? b : c" ,
187+ errors : [
188+ {
189+ messageId : "missingSpace" ,
190+ data : { operator : "?" } ,
191+ type : "ConditionalExpression" ,
192+ line : 1 ,
193+ column : 2 ,
194+ endColumn : 3
195+ } ,
196+ {
197+ messageId : "missingSpace" ,
198+ data : { operator : ":" } ,
199+ type : "ConditionalExpression" ,
200+ line : 1 ,
201+ column : 6 ,
202+ endColumn : 7
203+ }
204+ ]
205+ } ,
206+ {
207+ code : "a ?b: c" ,
208+ output : "a ? b : c" ,
209+ errors : [
210+ {
211+ messageId : "missingSpace" ,
212+ data : { operator : "?" } ,
213+ type : "ConditionalExpression" ,
214+ line : 1 ,
215+ column : 3 ,
216+ endColumn : 4
217+ } ,
218+ {
219+ messageId : "missingSpace" ,
220+ data : { operator : ":" } ,
221+ type : "ConditionalExpression" ,
222+ line : 1 ,
223+ column : 5 ,
224+ endColumn : 6
225+ }
226+ ]
173227 } ,
174228 {
175229 code : "a?b : c" ,
0 commit comments