@@ -82,144 +82,312 @@ tester.run('html-quotes', rule, {
82
82
filename : 'test.vue' ,
83
83
code : '<template><div class=foo></div></template>' ,
84
84
output : '<template><div class="foo"></div></template>' ,
85
- errors : [ 'Expected to be enclosed by double quotes.' ]
85
+ errors : [
86
+ {
87
+ message : 'Expected to be enclosed by double quotes.' ,
88
+ line : 1 ,
89
+ column : 22 ,
90
+ endLine : 1 ,
91
+ endColumn : 25
92
+ }
93
+ ]
86
94
} ,
87
95
{
88
96
filename : 'test.vue' ,
89
97
code : "<template><div class='foo'></div></template>" ,
90
98
output : '<template><div class="foo"></div></template>' ,
91
- errors : [ 'Expected to be enclosed by double quotes.' ]
99
+ errors : [
100
+ {
101
+ message : 'Expected to be enclosed by double quotes.' ,
102
+ line : 1 ,
103
+ column : 22 ,
104
+ endLine : 1 ,
105
+ endColumn : 27
106
+ }
107
+ ]
92
108
} ,
93
109
{
94
110
filename : 'test.vue' ,
95
111
code : '<template><div :class=foo></div></template>' ,
96
112
output : '<template><div :class="foo"></div></template>' ,
97
- errors : [ 'Expected to be enclosed by double quotes.' ]
113
+ errors : [
114
+ {
115
+ message : 'Expected to be enclosed by double quotes.' ,
116
+ line : 1 ,
117
+ column : 23 ,
118
+ endLine : 1 ,
119
+ endColumn : 26
120
+ }
121
+ ]
98
122
} ,
99
123
{
100
124
filename : 'test.vue' ,
101
125
code : "<template><div :class='foo'></div></template>" ,
102
126
output : '<template><div :class="foo"></div></template>' ,
103
- errors : [ 'Expected to be enclosed by double quotes.' ]
127
+ errors : [
128
+ {
129
+ message : 'Expected to be enclosed by double quotes.' ,
130
+ line : 1 ,
131
+ column : 23 ,
132
+ endLine : 1 ,
133
+ endColumn : 28
134
+ }
135
+ ]
104
136
} ,
105
137
{
106
138
filename : 'test.vue' ,
107
139
code : '<template><div :class=foo+"bar"></div></template>' ,
108
140
output : '<template><div :class="foo+"bar""></div></template>' ,
109
- errors : [ 'Expected to be enclosed by double quotes.' ]
141
+ errors : [
142
+ {
143
+ message : 'Expected to be enclosed by double quotes.' ,
144
+ line : 1 ,
145
+ column : 23 ,
146
+ endLine : 1 ,
147
+ endColumn : 32
148
+ }
149
+ ]
110
150
} ,
111
151
{
112
152
filename : 'test.vue' ,
113
153
code : '<template><div class=foo></div></template>' ,
114
154
output : '<template><div class="foo"></div></template>' ,
115
155
options : [ 'double' ] ,
116
- errors : [ 'Expected to be enclosed by double quotes.' ]
156
+ errors : [
157
+ {
158
+ message : 'Expected to be enclosed by double quotes.' ,
159
+ line : 1 ,
160
+ column : 22 ,
161
+ endLine : 1 ,
162
+ endColumn : 25
163
+ }
164
+ ]
117
165
} ,
118
166
{
119
167
filename : 'test.vue' ,
120
168
code : "<template><div class='foo'></div></template>" ,
121
169
output : '<template><div class="foo"></div></template>' ,
122
170
options : [ 'double' ] ,
123
- errors : [ 'Expected to be enclosed by double quotes.' ]
171
+ errors : [
172
+ {
173
+ message : 'Expected to be enclosed by double quotes.' ,
174
+ line : 1 ,
175
+ column : 22 ,
176
+ endLine : 1 ,
177
+ endColumn : 27
178
+ }
179
+ ]
124
180
} ,
125
181
{
126
182
filename : 'test.vue' ,
127
183
code : '<template><div :class=foo></div></template>' ,
128
184
output : '<template><div :class="foo"></div></template>' ,
129
185
options : [ 'double' ] ,
130
- errors : [ 'Expected to be enclosed by double quotes.' ]
186
+ errors : [
187
+ {
188
+ message : 'Expected to be enclosed by double quotes.' ,
189
+ line : 1 ,
190
+ column : 23 ,
191
+ endLine : 1 ,
192
+ endColumn : 26
193
+ }
194
+ ]
131
195
} ,
132
196
{
133
197
filename : 'test.vue' ,
134
198
code : "<template><div :class='foo'></div></template>" ,
135
199
output : '<template><div :class="foo"></div></template>' ,
136
200
options : [ 'double' ] ,
137
- errors : [ 'Expected to be enclosed by double quotes.' ]
201
+ errors : [
202
+ {
203
+ message : 'Expected to be enclosed by double quotes.' ,
204
+ line : 1 ,
205
+ column : 23 ,
206
+ endLine : 1 ,
207
+ endColumn : 28
208
+ }
209
+ ]
138
210
} ,
139
211
{
140
212
filename : 'test.vue' ,
141
213
code : '<template><div :class=foo+"bar"></div></template>' ,
142
214
output : '<template><div :class="foo+"bar""></div></template>' ,
143
215
options : [ 'double' ] ,
144
- errors : [ 'Expected to be enclosed by double quotes.' ]
216
+ errors : [
217
+ {
218
+ message : 'Expected to be enclosed by double quotes.' ,
219
+ line : 1 ,
220
+ column : 23 ,
221
+ endLine : 1 ,
222
+ endColumn : 32
223
+ }
224
+ ]
145
225
} ,
146
226
{
147
227
filename : 'test.vue' ,
148
228
code : '<template><div class=foo></div></template>' ,
149
229
output : "<template><div class='foo'></div></template>" ,
150
230
options : [ 'single' ] ,
151
- errors : [ 'Expected to be enclosed by single quotes.' ]
231
+ errors : [
232
+ {
233
+ message : 'Expected to be enclosed by single quotes.' ,
234
+ line : 1 ,
235
+ column : 22 ,
236
+ endLine : 1 ,
237
+ endColumn : 25
238
+ }
239
+ ]
152
240
} ,
153
241
{
154
242
filename : 'test.vue' ,
155
243
code : '<template><div class="foo"></div></template>' ,
156
244
output : "<template><div class='foo'></div></template>" ,
157
245
options : [ 'single' ] ,
158
- errors : [ 'Expected to be enclosed by single quotes.' ]
246
+ errors : [
247
+ {
248
+ message : 'Expected to be enclosed by single quotes.' ,
249
+ line : 1 ,
250
+ column : 22 ,
251
+ endLine : 1 ,
252
+ endColumn : 27
253
+ }
254
+ ]
159
255
} ,
160
256
{
161
257
filename : 'test.vue' ,
162
258
code : '<template><div :class=foo></div></template>' ,
163
259
output : "<template><div :class='foo'></div></template>" ,
164
260
options : [ 'single' ] ,
165
- errors : [ 'Expected to be enclosed by single quotes.' ]
261
+ errors : [
262
+ {
263
+ message : 'Expected to be enclosed by single quotes.' ,
264
+ line : 1 ,
265
+ column : 23 ,
266
+ endLine : 1 ,
267
+ endColumn : 26
268
+ }
269
+ ]
166
270
} ,
167
271
{
168
272
filename : 'test.vue' ,
169
273
code : '<template><div :class="foo"></div></template>' ,
170
274
output : "<template><div :class='foo'></div></template>" ,
171
275
options : [ 'single' ] ,
172
- errors : [ 'Expected to be enclosed by single quotes.' ]
276
+ errors : [
277
+ {
278
+ message : 'Expected to be enclosed by single quotes.' ,
279
+ line : 1 ,
280
+ column : 23 ,
281
+ endLine : 1 ,
282
+ endColumn : 28
283
+ }
284
+ ]
173
285
} ,
174
286
{
175
287
filename : 'test.vue' ,
176
288
code : "<template><div :class=foo+'bar'></div></template>" ,
177
289
output : "<template><div :class='foo+'bar''></div></template>" ,
178
290
options : [ 'single' ] ,
179
- errors : [ 'Expected to be enclosed by single quotes.' ]
291
+ errors : [
292
+ {
293
+ message : 'Expected to be enclosed by single quotes.' ,
294
+ line : 1 ,
295
+ column : 23 ,
296
+ endLine : 1 ,
297
+ endColumn : 32
298
+ }
299
+ ]
180
300
} ,
181
301
// avoidEscape
182
302
{
183
303
filename : 'test.vue' ,
184
304
code : "<template><div attr='foo'></div></template>" ,
185
305
output : '<template><div attr="foo"></div></template>' ,
186
306
options : [ 'double' , { avoidEscape : true } ] ,
187
- errors : [ 'Expected to be enclosed by double quotes.' ]
307
+ errors : [
308
+ {
309
+ message : 'Expected to be enclosed by double quotes.' ,
310
+ line : 1 ,
311
+ column : 21 ,
312
+ endLine : 1 ,
313
+ endColumn : 26
314
+ }
315
+ ]
188
316
} ,
189
317
{
190
318
filename : 'test.vue' ,
191
319
code : '<template><div attr="bar"></div></template>' ,
192
320
output : "<template><div attr='bar'></div></template>" ,
193
321
options : [ 'single' , { avoidEscape : true } ] ,
194
- errors : [ 'Expected to be enclosed by single quotes.' ]
322
+ errors : [
323
+ {
324
+ message : 'Expected to be enclosed by single quotes.' ,
325
+ line : 1 ,
326
+ column : 21 ,
327
+ endLine : 1 ,
328
+ endColumn : 26
329
+ }
330
+ ]
195
331
} ,
196
332
{
197
333
filename : 'test.vue' ,
198
334
code : '<template><div attr=foo"bar></div></template>' ,
199
335
output : "<template><div attr='foo\"bar'></div></template>" ,
200
336
options : [ 'double' , { avoidEscape : true } ] ,
201
- errors : [ 'Expected to be enclosed by double quotes.' ]
337
+ errors : [
338
+ {
339
+ message : 'Expected to be enclosed by double quotes.' ,
340
+ line : 1 ,
341
+ column : 21 ,
342
+ endLine : 1 ,
343
+ endColumn : 28
344
+ }
345
+ ]
202
346
} ,
203
347
{
204
348
filename : 'test.vue' ,
205
349
code : "<template><div attr=foo'bar></div></template>" ,
206
350
output : '<template><div attr="foo\'bar"></div></template>' ,
207
351
options : [ 'single' , { avoidEscape : true } ] ,
208
- errors : [ 'Expected to be enclosed by single quotes.' ]
352
+ errors : [
353
+ {
354
+ message : 'Expected to be enclosed by single quotes.' ,
355
+ line : 1 ,
356
+ column : 21 ,
357
+ endLine : 1 ,
358
+ endColumn : 28
359
+ }
360
+ ]
209
361
} ,
210
362
{
211
363
filename : 'test.vue' ,
212
364
code : '<template><div attr=foo"bar\'baz></div></template>' ,
213
365
output : '<template><div attr="foo"bar\'baz"></div></template>' ,
214
366
options : [ 'double' , { avoidEscape : true } ] ,
215
- errors : [ 'Expected to be enclosed by double quotes.' ]
367
+ errors : [
368
+ {
369
+ message : 'Expected to be enclosed by double quotes.' ,
370
+ line : 1 ,
371
+ column : 21 ,
372
+ endLine : 1 ,
373
+ endColumn : 32
374
+ }
375
+ ]
216
376
} ,
217
377
{
218
378
filename : 'test.vue' ,
219
379
code : '<template><div attr=foo"bar\'baz></div></template>' ,
220
380
output : "<template><div attr='foo\"bar'baz'></div></template>" ,
221
381
options : [ 'single' , { avoidEscape : true } ] ,
222
- errors : [ 'Expected to be enclosed by single quotes.' ]
382
+ errors : [
383
+ {
384
+ message : 'Expected to be enclosed by single quotes.' ,
385
+ line : 1 ,
386
+ column : 21 ,
387
+ endLine : 1 ,
388
+ endColumn : 32
389
+ }
390
+ ]
223
391
}
224
392
]
225
393
} )
0 commit comments