@@ -129,6 +129,17 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
129
129
options : [ 'multiline-multiprop' ] ,
130
130
parser : 'babel-eslint'
131
131
} ,
132
+ {
133
+ code : [
134
+ '<Foo ' ,
135
+ ' foo={{' ,
136
+ ' }}' ,
137
+ ' bar' ,
138
+ '/>'
139
+ ] . join ( '\n' ) ,
140
+ options : [ 'multiline-multiprop' ] ,
141
+ parser : 'typescript-eslint-parser'
142
+ } ,
132
143
{
133
144
code : '<Foo />' ,
134
145
options : [ 'always' ] ,
@@ -167,6 +178,16 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
167
178
errors : [ { message : 'Property should be placed on a new line' } ] ,
168
179
parser : 'babel-eslint'
169
180
} ,
181
+ {
182
+ code : '<Foo propOne="one" propTwo="two" />' ,
183
+ output : [
184
+ '<Foo' ,
185
+ 'propOne="one" propTwo="two" />'
186
+ ] . join ( '\n' ) ,
187
+ options : [ 'always' ] ,
188
+ errors : [ { message : 'Property should be placed on a new line' } ] ,
189
+ parser : 'typescript-eslint-parser'
190
+ } ,
170
191
{
171
192
code : [
172
193
'<Foo propOne="one"' ,
@@ -183,6 +204,22 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
183
204
errors : [ { message : 'Property should be placed on a new line' } ] ,
184
205
parser : 'babel-eslint'
185
206
} ,
207
+ {
208
+ code : [
209
+ '<Foo propOne="one"' ,
210
+ ' propTwo="two"' ,
211
+ '/>'
212
+ ] . join ( '\n' ) ,
213
+ output : [
214
+ '<Foo' ,
215
+ 'propOne="one"' ,
216
+ ' propTwo="two"' ,
217
+ '/>'
218
+ ] . join ( '\n' ) ,
219
+ options : [ 'always' ] ,
220
+ errors : [ { message : 'Property should be placed on a new line' } ] ,
221
+ parser : 'typescript-eslint-parser'
222
+ } ,
186
223
{
187
224
code : [
188
225
'<Foo' ,
@@ -199,6 +236,22 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
199
236
errors : [ { message : 'Property should be placed on the same line as the component declaration' } ] ,
200
237
parser : 'babel-eslint'
201
238
} ,
239
+ {
240
+ code : [
241
+ '<Foo' ,
242
+ ' propOne="one"' ,
243
+ ' propTwo="two"' ,
244
+ '/>'
245
+ ] . join ( '\n' ) ,
246
+ output : [
247
+ '<Foo propOne="one"' ,
248
+ ' propTwo="two"' ,
249
+ '/>'
250
+ ] . join ( '\n' ) ,
251
+ options : [ 'never' ] ,
252
+ errors : [ { message : 'Property should be placed on the same line as the component declaration' } ] ,
253
+ parser : 'typescript-eslint-parser'
254
+ } ,
202
255
{
203
256
code : [
204
257
'<Foo prop={{' ,
@@ -213,6 +266,20 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
213
266
errors : [ { message : 'Property should be placed on a new line' } ] ,
214
267
parser : 'babel-eslint'
215
268
} ,
269
+ {
270
+ code : [
271
+ '<Foo prop={{' ,
272
+ '}} />'
273
+ ] . join ( '\n' ) ,
274
+ output : [
275
+ '<Foo' ,
276
+ 'prop={{' ,
277
+ '}} />'
278
+ ] . join ( '\n' ) ,
279
+ options : [ 'multiline' ] ,
280
+ errors : [ { message : 'Property should be placed on a new line' } ] ,
281
+ parser : 'typescript-eslint-parser'
282
+ } ,
216
283
{
217
284
code : [
218
285
'<Foo bar={{' ,
@@ -226,6 +293,20 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
226
293
options : [ 'multiline-multiprop' ] ,
227
294
errors : [ { message : 'Property should be placed on a new line' } ] ,
228
295
parser : 'babel-eslint'
296
+ } ,
297
+ {
298
+ code : [
299
+ '<Foo bar={{' ,
300
+ '}} baz />'
301
+ ] . join ( '\n' ) ,
302
+ output : [
303
+ '<Foo' ,
304
+ 'bar={{' ,
305
+ '}} baz />'
306
+ ] . join ( '\n' ) ,
307
+ options : [ 'multiline-multiprop' ] ,
308
+ errors : [ { message : 'Property should be placed on a new line' } ] ,
309
+ parser : 'typescript-eslint-parser'
229
310
}
230
311
]
231
312
} ) ;
0 commit comments