@@ -84,27 +84,92 @@ tester.run('attributes-order', rule, {
84
84
} ,
85
85
{
86
86
filename : 'test.vue' ,
87
- code : '<template><div v-model="toggle" :bindingProp="foo" propOne="bar" model="baz"></div></template>'
87
+ code :
88
+ `<template>
89
+ <div
90
+ v-model="toggle"
91
+ :bindingProp="foo"
92
+ propOne="bar"
93
+ model="baz">
94
+ </div>
95
+ </template>`
88
96
} ,
89
97
{
90
98
filename : 'test.vue' ,
91
- code : '<template><div @ click="functionCall"></div></template>'
99
+ code : '<template><div click="functionCall"></div></template>'
92
100
} ,
93
101
{
94
102
filename : 'test.vue' ,
95
103
code : '<template><div myProp="prop"></div></template>'
96
104
} ,
97
105
{
98
106
filename : 'test.vue' ,
99
- code : '<template><div is="header" v-for="item in items" v-if="!visible" v-once id="uniqueID" ref="header" v-model="headerData" myProp="prop" @click="functionCall" v-text="textContent"></div></template>'
107
+ code :
108
+ `<template>
109
+ <div
110
+ is="header"
111
+ v-for="item in items"
112
+ v-if="!visible"
113
+ v-once
114
+ id="uniqueID"
115
+ ref="header"
116
+ v-model="headerData"
117
+ myProp="prop"
118
+ @click="functionCall"
119
+ v-text="textContent">
120
+ </div>
121
+ </template>`
100
122
} ,
101
123
{
102
124
filename : 'test.vue' ,
103
- code : '<template><div is="header" v-for="item in items" v-if="!visible" v-once id="uniqueID" ref="header" :prop="headerData" myProp="prop" v-on:click="functionCall" v-text="textContent"></div></template>'
125
+ code :
126
+ `<template>
127
+ <div
128
+ is="header"
129
+ v-for="item in items"
130
+ v-if="!visible"
131
+ v-once
132
+ id="uniqueID"
133
+ ref="header"
134
+ v-model="headerData"
135
+ :myProp="prop"
136
+ v-on="functionCall"
137
+ v-text="textContent">
138
+ </div>
139
+ </template>`
104
140
} ,
105
141
{
106
142
filename : 'test.vue' ,
107
- code : '<template><div v-for="item in items" v-if="!visible" propone="prop" proptwo="prop" propthree="prop" @click="functionCall" v-text="textContent"></div></template>'
143
+ code :
144
+ `<template>
145
+ <div
146
+ is="header"
147
+ v-for="item in items"
148
+ v-if="!visible"
149
+ v-once
150
+ id="uniqueID"
151
+ ref="header"
152
+ :prop="headerData"
153
+ myProp="prop"
154
+ v-on:click="functionCall"
155
+ v-text="textContent">
156
+ </div>
157
+ </template>`
158
+ } ,
159
+ {
160
+ filename : 'test.vue' ,
161
+ code :
162
+ `<template>
163
+ <div
164
+ v-for="item in items"
165
+ v-if="!visible"
166
+ propone="prop"
167
+ proptwo="prop"
168
+ propthree="prop"
169
+ @click="functionCall"
170
+ v-text="textContent">
171
+ </div>
172
+ </template>`
108
173
} ,
109
174
{
110
175
filename : 'test.vue' ,
@@ -113,12 +178,36 @@ tester.run('attributes-order', rule, {
113
178
{
114
179
filename : 'test.vue' ,
115
180
code : '<template><div propone="prop" proptwo="prop" is="header"></div></template>' ,
116
- options : [ { order : [ 'LIST_RENDERING' , 'CONDITIONALS' , 'RENDER_MODIFIERS' , 'GLOBAL' , 'UNIQUE' , 'BINDING' , 'OTHER_ATTR' , 'EVENTS' , 'CONTENT' , 'DEFINITION' ] } ]
181
+ options : [
182
+ { order :
183
+ [ 'LIST_RENDERING' ,
184
+ 'CONDITIONALS' ,
185
+ 'RENDER_MODIFIERS' ,
186
+ 'GLOBAL' ,
187
+ 'UNIQUE' ,
188
+ 'BINDING' ,
189
+ 'OTHER_ATTR' ,
190
+ 'EVENTS' ,
191
+ 'CONTENT' ,
192
+ 'DEFINITION' ]
193
+ } ]
117
194
} ,
118
195
{
119
196
filename : 'test.vue' ,
120
197
code : '<template><div ref="header" is="header" propone="prop" proptwo="prop"></div></template>' ,
121
- options : [ { order : [ 'LIST_RENDERING' , 'CONDITIONALS' , 'RENDER_MODIFIERS' , 'GLOBAL' , 'UNIQUE' , 'BINDING' , 'DEFINITION' , 'OTHER_ATTR' , 'EVENTS' , 'CONTENT' ] } ]
198
+ options : [
199
+ { order :
200
+ [ 'LIST_RENDERING' ,
201
+ 'CONDITIONALS' ,
202
+ 'RENDER_MODIFIERS' ,
203
+ 'GLOBAL' ,
204
+ 'UNIQUE' ,
205
+ 'BINDING' ,
206
+ 'DEFINITION' ,
207
+ 'OTHER_ATTR' ,
208
+ 'EVENTS' ,
209
+ 'CONTENT' ]
210
+ } ]
122
211
}
123
212
] ,
124
213
@@ -141,7 +230,15 @@ tester.run('attributes-order', rule, {
141
230
} ,
142
231
{
143
232
filename : 'test.vue' ,
144
- code : '<template><div model="baz" v-model="toggle" propOne="bar" :bindingProp="foo"></div></template>' ,
233
+ code :
234
+ `<template>
235
+ <div
236
+ model="baz"
237
+ v-model="toggle"
238
+ propOne="bar"
239
+ :bindingProp="foo">
240
+ </div>
241
+ </template>` ,
145
242
errors : [ {
146
243
message : 'Attribute "v-model" should go before "model".' ,
147
244
type : 'VDirectiveKey'
@@ -151,6 +248,27 @@ tester.run('attributes-order', rule, {
151
248
type : 'VDirectiveKey'
152
249
} ]
153
250
} ,
251
+ {
252
+ filename : 'test.vue' ,
253
+ code :
254
+ `<template>
255
+ <div
256
+ :bindingProp="foo"
257
+ model="baz"
258
+ v-on="functionCall"
259
+ v-model="toggle"
260
+ propOne="bar">
261
+ </div>
262
+ </template>` ,
263
+ errors : [ {
264
+ message : 'Attribute "v-model" should go before "v-on".' ,
265
+ type : 'VDirectiveKey'
266
+ } ,
267
+ {
268
+ message : 'Attribute "propOne" should go before "v-on".' ,
269
+ type : 'VIdentifier'
270
+ } ]
271
+ } ,
154
272
{
155
273
filename : 'test.vue' ,
156
274
code : '<template><div data-id="foo" aria-test="bar" is="custom" myProp="prop"></div></template>' ,
@@ -162,7 +280,19 @@ tester.run('attributes-order', rule, {
162
280
{
163
281
filename : 'test.vue' ,
164
282
code : '<template><div ref="header" propone="prop" is="header" ></div></template>' ,
165
- options : [ { order : [ 'LIST_RENDERING' , 'CONDITIONALS' , 'RENDER_MODIFIERS' , 'GLOBAL' , 'UNIQUE' , 'BINDING' , 'DEFINITION' , 'OTHER_ATTR' , 'EVENTS' , 'CONTENT' ] } ] ,
283
+ options : [
284
+ { order :
285
+ [ 'LIST_RENDERING' ,
286
+ 'CONDITIONALS' ,
287
+ 'RENDER_MODIFIERS' ,
288
+ 'GLOBAL' ,
289
+ 'UNIQUE' ,
290
+ 'BINDING' ,
291
+ 'DEFINITION' ,
292
+ 'OTHER_ATTR' ,
293
+ 'EVENTS' ,
294
+ 'CONTENT' ]
295
+ } ] ,
166
296
errors : [ {
167
297
message : 'Attribute "is" should go before "propone".' ,
168
298
type : 'VIdentifier'
0 commit comments