@@ -128,42 +128,106 @@ ruleTester.run('no-multiple-template-root', rule, {
128
128
{
129
129
filename : 'test.vue' ,
130
130
code : '<template><div></div><div></div></template>' ,
131
- errors : [ 'The template root requires exactly one element.' ]
131
+ errors : [
132
+ {
133
+ message : 'The template root requires exactly one element.' ,
134
+ line : 1 ,
135
+ column : 22 ,
136
+ endLine : 1 ,
137
+ endColumn : 33
138
+ }
139
+ ]
132
140
} ,
133
141
{
134
142
filename : 'test.vue' ,
135
143
code : '<template>\n <div></div>\n <div></div>\n</template>' ,
136
- errors : [ 'The template root requires exactly one element.' ]
144
+ errors : [
145
+ {
146
+ message : 'The template root requires exactly one element.' ,
147
+ line : 3 ,
148
+ column : 5 ,
149
+ endLine : 3 ,
150
+ endColumn : 16
151
+ }
152
+ ]
137
153
} ,
138
154
{
139
155
filename : 'test.vue' ,
140
156
code : '<template>{{a b c}}</template>' ,
141
- errors : [ 'The template root requires an element rather than texts.' ]
157
+ errors : [
158
+ {
159
+ message : 'The template root requires an element rather than texts.' ,
160
+ line : 1 ,
161
+ column : 11 ,
162
+ endLine : 1 ,
163
+ endColumn : 20
164
+ }
165
+ ]
142
166
} ,
143
167
{
144
168
filename : 'test.vue' ,
145
169
code : '<template><div></div>aaaaaa</template>' ,
146
- errors : [ 'The template root requires an element rather than texts.' ]
170
+ errors : [
171
+ {
172
+ message : 'The template root requires an element rather than texts.' ,
173
+ line : 1 ,
174
+ column : 22 ,
175
+ endLine : 1 ,
176
+ endColumn : 28
177
+ }
178
+ ]
147
179
} ,
148
180
{
149
181
filename : 'test.vue' ,
150
182
code : '<template>aaaaaa<div></div></template>' ,
151
- errors : [ 'The template root requires an element rather than texts.' ]
183
+ errors : [
184
+ {
185
+ message : 'The template root requires an element rather than texts.' ,
186
+ line : 1 ,
187
+ column : 11 ,
188
+ endLine : 1 ,
189
+ endColumn : 17
190
+ }
191
+ ]
152
192
} ,
153
193
{
154
194
filename : 'test.vue' ,
155
195
code : '<template><div v-for="x in list"></div></template>' ,
156
- errors : [ "The template root disallows 'v-for' directives." ]
196
+ errors : [
197
+ {
198
+ message : "The template root disallows 'v-for' directives." ,
199
+ line : 1 ,
200
+ column : 11 ,
201
+ endLine : 1 ,
202
+ endColumn : 34
203
+ }
204
+ ]
157
205
} ,
158
206
{
159
207
filename : 'test.vue' ,
160
208
code : '<template><slot></slot></template>' ,
161
- errors : [ "The template root disallows '<slot>' elements." ]
209
+ errors : [
210
+ {
211
+ message : "The template root disallows '<slot>' elements." ,
212
+ line : 1 ,
213
+ column : 11 ,
214
+ endLine : 1 ,
215
+ endColumn : 17
216
+ }
217
+ ]
162
218
} ,
163
219
{
164
220
filename : 'test.vue' ,
165
221
code : '<template><template></template></template>' ,
166
- errors : [ "The template root disallows '<template>' elements." ]
222
+ errors : [
223
+ {
224
+ message : "The template root disallows '<template>' elements." ,
225
+ line : 1 ,
226
+ column : 11 ,
227
+ endLine : 1 ,
228
+ endColumn : 21
229
+ }
230
+ ]
167
231
} ,
168
232
{
169
233
code : `
@@ -177,11 +241,17 @@ ruleTester.run('no-multiple-template-root', rule, {
177
241
errors : [
178
242
{
179
243
message : 'The template root disallows comments.' ,
180
- line : 3
244
+ line : 3 ,
245
+ column : 9 ,
246
+ endLine : 3 ,
247
+ endColumn : 26
181
248
} ,
182
249
{
183
250
message : 'The template root disallows comments.' ,
184
- line : 5
251
+ line : 5 ,
252
+ column : 9 ,
253
+ endLine : 5 ,
254
+ endColumn : 26
185
255
}
186
256
]
187
257
} ,
@@ -199,7 +269,10 @@ ruleTester.run('no-multiple-template-root', rule, {
199
269
errors : [
200
270
{
201
271
message : 'The template root disallows comments.' ,
202
- line : 3
272
+ line : 3 ,
273
+ column : 9 ,
274
+ endLine : 3 ,
275
+ endColumn : 26
203
276
}
204
277
]
205
278
} ,
@@ -227,15 +300,24 @@ ruleTester.run('no-multiple-template-root', rule, {
227
300
errors : [
228
301
{
229
302
message : 'The template root disallows comments.' ,
230
- line : 3
303
+ line : 3 ,
304
+ column : 9 ,
305
+ endLine : 3 ,
306
+ endColumn : 26
231
307
} ,
232
308
{
233
309
message : 'The template root disallows comments.' ,
234
- line : 12
310
+ line : 12 ,
311
+ column : 9 ,
312
+ endLine : 12 ,
313
+ endColumn : 26
235
314
} ,
236
315
{
237
316
message : 'The template root disallows comments.' ,
238
- line : 17
317
+ line : 17 ,
318
+ column : 9 ,
319
+ endLine : 17 ,
320
+ endColumn : 26
239
321
}
240
322
]
241
323
} ,
@@ -253,7 +335,10 @@ ruleTester.run('no-multiple-template-root', rule, {
253
335
errors : [
254
336
{
255
337
message : 'The template root disallows comments.' ,
256
- line : 7
338
+ line : 7 ,
339
+ column : 9 ,
340
+ endLine : 7 ,
341
+ endColumn : 26
257
342
}
258
343
]
259
344
} ,
@@ -269,11 +354,17 @@ ruleTester.run('no-multiple-template-root', rule, {
269
354
errors : [
270
355
{
271
356
message : 'The template root disallows comments.' ,
272
- line : 4
357
+ line : 4 ,
358
+ column : 9 ,
359
+ endLine : 4 ,
360
+ endColumn : 26
273
361
} ,
274
362
{
275
363
message : 'The template root requires exactly one element.' ,
276
- line : 5
364
+ line : 5 ,
365
+ column : 9 ,
366
+ endLine : 5 ,
367
+ endColumn : 16
277
368
}
278
369
]
279
370
} ,
@@ -289,7 +380,15 @@ ruleTester.run('no-multiple-template-root', rule, {
289
380
</template>
290
381
` ,
291
382
options : [ { disallowComments : true } ] ,
292
- errors : [ 'The template root disallows comments.' ]
383
+ errors : [
384
+ {
385
+ message : 'The template root disallows comments.' ,
386
+ line : 3 ,
387
+ column : 9 ,
388
+ endLine : 4 ,
389
+ endColumn : 96
390
+ }
391
+ ]
293
392
}
294
393
]
295
394
} )
0 commit comments