@@ -91,6 +91,8 @@ ruleTester.run('max-attributes-per-line', rule, {
91
91
invalid : [
92
92
{
93
93
code : `<template><component name="John Doe" age="30"></component></template>` ,
94
+ output : `<template><component name="John Doe"
95
+ age="30"></component></template>` ,
94
96
errors : [ 'Attribute "age" should be on a new line.' ]
95
97
} ,
96
98
{
@@ -99,6 +101,12 @@ ruleTester.run('max-attributes-per-line', rule, {
99
101
age="30">
100
102
</component>
101
103
</template>` ,
104
+ output : `<template><component
105
+ job="Vet"
106
+ name="John Doe"
107
+ age="30">
108
+ </component>
109
+ </template>` ,
102
110
errors : [ {
103
111
message : 'Attribute "job" should be on a new line.' ,
104
112
type : 'VAttribute' ,
@@ -108,6 +116,8 @@ ruleTester.run('max-attributes-per-line', rule, {
108
116
{
109
117
code : `<template><component name="John Doe" age="30" job="Vet"></component></template>` ,
110
118
options : [ { singleline : { max : 2 } } ] ,
119
+ output : `<template><component name="John Doe" age="30"
120
+ job="Vet"></component></template>` ,
111
121
errors : [ {
112
122
message : 'Attribute "job" should be on a new line.' ,
113
123
type : 'VAttribute' ,
@@ -117,6 +127,8 @@ ruleTester.run('max-attributes-per-line', rule, {
117
127
{
118
128
code : `<template><component name="John Doe" age="30" job="Vet"></component></template>` ,
119
129
options : [ { singleline : 1 , multiline : { max : 1 , allowFirstLine : false } } ] ,
130
+ output : `<template><component name="John Doe"
131
+ age="30" job="Vet"></component></template>` ,
120
132
errors : [ {
121
133
message : 'Attribute "age" should be on a new line.' ,
122
134
type : 'VAttribute' ,
@@ -133,6 +145,11 @@ ruleTester.run('max-attributes-per-line', rule, {
133
145
</component>
134
146
</template>` ,
135
147
options : [ { singleline : 3 , multiline : { max : 1 , allowFirstLine : false } } ] ,
148
+ output : `<template><component
149
+ name="John Doe"
150
+ age="30">
151
+ </component>
152
+ </template>` ,
136
153
errors : [ {
137
154
message : 'Attribute "name" should be on a new line.' ,
138
155
type : 'VAttribute' ,
@@ -146,6 +163,12 @@ ruleTester.run('max-attributes-per-line', rule, {
146
163
</component>
147
164
</template>` ,
148
165
options : [ { singleline : 3 , multiline : { max : 1 , allowFirstLine : false } } ] ,
166
+ output : `<template><component
167
+ name="John Doe"
168
+ age="30"
169
+ job="Vet">
170
+ </component>
171
+ </template>` ,
149
172
errors : [ {
150
173
message : 'Attribute "age" should be on a new line.' ,
151
174
type : 'VAttribute' ,
@@ -159,6 +182,12 @@ ruleTester.run('max-attributes-per-line', rule, {
159
182
</component>
160
183
</template>` ,
161
184
options : [ { singleline : 3 , multiline : 1 } ] ,
185
+ output : `<template><component
186
+ name="John Doe"
187
+ age="30"
188
+ job="Vet">
189
+ </component>
190
+ </template>` ,
162
191
errors : [ {
163
192
message : 'Attribute "age" should be on a new line.' ,
164
193
type : 'VAttribute' ,
@@ -172,6 +201,12 @@ ruleTester.run('max-attributes-per-line', rule, {
172
201
</component>
173
202
</template>` ,
174
203
options : [ { singleline : 3 , multiline : { max : 2 , allowFirstLine : false } } ] ,
204
+ output : `<template><component
205
+ name="John Doe" age="30"
206
+ job="Vet" pet="dog"
207
+ petname="Snoopy">
208
+ </component>
209
+ </template>` ,
175
210
errors : [ {
176
211
message : 'Attribute "petname" should be on a new line.' ,
177
212
type : 'VAttribute' ,
@@ -185,6 +220,12 @@ ruleTester.run('max-attributes-per-line', rule, {
185
220
</component>
186
221
</template>` ,
187
222
options : [ { singleline : 3 , multiline : { max : 2 , allowFirstLine : false } } ] ,
223
+ output : `<template><component
224
+ name="John Doe" age="30"
225
+ job="Vet" pet="dog"
226
+ petname="Snoopy" extra="foo">
227
+ </component>
228
+ </template>` ,
188
229
errors : [ {
189
230
message : 'Attribute "petname" should be on a new line.' ,
190
231
type : 'VAttribute' ,
0 commit comments