@@ -44,43 +44,99 @@ ruleTester.run('max-attributes-per-line', rule, {
44
44
code : `<template><component name="John Doe" age="30"></component></template>` ,
45
45
output : `<template><component name="John Doe"
46
46
age="30"></component></template>` ,
47
- errors : [ "'age' should be on a new line." ]
47
+ errors : [
48
+ {
49
+ message : "'age' should be on a new line." ,
50
+ line : 1 ,
51
+ column : 38 ,
52
+ endLine : 1 ,
53
+ endColumn : 46
54
+ }
55
+ ]
48
56
} ,
49
57
{
50
58
code : `<template><component :name="user.name" :age="user.age"></component></template>` ,
51
59
output : `<template><component :name="user.name"
52
60
:age="user.age"></component></template>` ,
53
- errors : [ "':age' should be on a new line." ]
61
+ errors : [
62
+ {
63
+ message : "':age' should be on a new line." ,
64
+ line : 1 ,
65
+ column : 40 ,
66
+ endLine : 1 ,
67
+ endColumn : 55
68
+ }
69
+ ]
54
70
} ,
55
71
{
56
72
code : `<template><component :is="test" v-bind="user"></component></template>` ,
57
73
output : `<template><component :is="test"
58
74
v-bind="user"></component></template>` ,
59
- errors : [ "'v-bind' should be on a new line." ]
75
+ errors : [
76
+ {
77
+ message : "'v-bind' should be on a new line." ,
78
+ line : 1 ,
79
+ column : 33 ,
80
+ endLine : 1 ,
81
+ endColumn : 46
82
+ }
83
+ ]
60
84
} ,
61
85
{
62
86
code : `<template><component :name="user.name" @buy="buyProduct"></component></template>` ,
63
87
output : `<template><component :name="user.name"
64
88
@buy="buyProduct"></component></template>` ,
65
- errors : [ "'@buy' should be on a new line." ]
89
+ errors : [
90
+ {
91
+ message : "'@buy' should be on a new line." ,
92
+ line : 1 ,
93
+ column : 40 ,
94
+ endLine : 1 ,
95
+ endColumn : 57
96
+ }
97
+ ]
66
98
} ,
67
99
{
68
100
code : `<template><component :name="user.name" @click.stop></component></template>` ,
69
101
output : `<template><component :name="user.name"
70
102
@click.stop></component></template>` ,
71
- errors : [ "'@click.stop' should be on a new line." ]
103
+ errors : [
104
+ {
105
+ message : "'@click.stop' should be on a new line." ,
106
+ line : 1 ,
107
+ column : 40 ,
108
+ endLine : 1 ,
109
+ endColumn : 51
110
+ }
111
+ ]
72
112
} ,
73
113
{
74
114
code : `<template><component :name="user.name" v-if="something"></component></template>` ,
75
115
output : `<template><component :name="user.name"
76
116
v-if="something"></component></template>` ,
77
- errors : [ "'v-if' should be on a new line." ]
117
+ errors : [
118
+ {
119
+ message : "'v-if' should be on a new line." ,
120
+ line : 1 ,
121
+ column : 40 ,
122
+ endLine : 1 ,
123
+ endColumn : 56
124
+ }
125
+ ]
78
126
} ,
79
127
{
80
128
code : `<template><component name="John Doe" v-bind:age="user.age"></component></template>` ,
81
129
output : `<template><component name="John Doe"
82
130
v-bind:age="user.age"></component></template>` ,
83
- errors : [ "'v-bind:age' should be on a new line." ]
131
+ errors : [
132
+ {
133
+ message : "'v-bind:age' should be on a new line." ,
134
+ line : 1 ,
135
+ column : 41 ,
136
+ endLine : 1 ,
137
+ endColumn : 62
138
+ }
139
+ ]
84
140
} ,
85
141
{
86
142
code : `<template><component name="John Doe" age="30" job="Vet"></component></template>` ,
@@ -91,7 +147,10 @@ job="Vet"></component></template>`,
91
147
{
92
148
message : "'job' should be on a new line." ,
93
149
type : 'VAttribute' ,
94
- line : 1
150
+ line : 1 ,
151
+ column : 47 ,
152
+ endLine : 1 ,
153
+ endColumn : 56
95
154
}
96
155
]
97
156
} ,
@@ -112,7 +171,10 @@ age="30"
112
171
{
113
172
message : "'age' should be on a new line." ,
114
173
type : 'VAttribute' ,
115
- line : 2
174
+ line : 2 ,
175
+ column : 25 ,
176
+ endLine : 2 ,
177
+ endColumn : 33
116
178
}
117
179
]
118
180
} ,
@@ -133,7 +195,10 @@ age="30"
133
195
{
134
196
message : "'age' should be on a new line." ,
135
197
type : 'VAttribute' ,
136
- line : 2
198
+ line : 2 ,
199
+ column : 25 ,
200
+ endLine : 2 ,
201
+ endColumn : 33
137
202
}
138
203
]
139
204
}
0 commit comments