@@ -46,6 +46,8 @@ ruleTester.run("function-call-argument-newline", rule, {
46
46
options : [ "always" ] ,
47
47
parserOptions : { ecmaVersion : 6 }
48
48
} ,
49
+ { code : "fn({\n\ta: 1\n},\n\tb,\n\tc)" , options : [ "always" ] } ,
50
+ { code : "fn(`\n`,\n\ta)" , options : [ "always" ] , parserOptions : { ecmaVersion : 6 } } ,
49
51
50
52
/* "never" */
51
53
{ code : "fn(a, b)" , options : [ "never" ] } ,
@@ -59,10 +61,16 @@ ruleTester.run("function-call-argument-newline", rule, {
59
61
options : [ "never" ] ,
60
62
parserOptions : { ecmaVersion : 6 }
61
63
} ,
64
+ { code : "fn({\n\ta: 1\n}, b)" , options : [ "never" ] } ,
65
+ { code : "fn(`\n`, a)" , options : [ "never" ] , parserOptions : { ecmaVersion : 6 } } ,
62
66
63
67
/* "consistent" */
64
68
{ code : "fn(a, b, c)" , options : [ "consistent" ] } ,
65
- { code : "fn(a,\n\tb,\n\tc)" , options : [ "consistent" ] }
69
+ { code : "fn(a,\n\tb,\n\tc)" , options : [ "consistent" ] } ,
70
+ { code : "fn({\n\ta: 1\n}, b, c)" , options : [ "consistent" ] } ,
71
+ { code : "fn({\n\ta: 1\n},\n\tb,\n\tc)" , options : [ "consistent" ] } ,
72
+ { code : "fn(`\n`, b, c)" , options : [ "consistent" ] , parserOptions : { ecmaVersion : 6 } } ,
73
+ { code : "fn(`\n`,\n\tb,\n\tc)" , options : [ "consistent" ] , parserOptions : { ecmaVersion : 6 } }
66
74
] ,
67
75
invalid : [
68
76
@@ -202,6 +210,35 @@ ruleTester.run("function-call-argument-newline", rule, {
202
210
}
203
211
]
204
212
} ,
213
+ {
214
+ code : "fn({\n\ta: 1\n}, b)" ,
215
+ output : "fn({\n\ta: 1\n},\nb)" ,
216
+ options : [ "always" ] ,
217
+ errors : [
218
+ {
219
+ messageId : "missingLineBreak" ,
220
+ line : 3 ,
221
+ column : 3 ,
222
+ endLine : 3 ,
223
+ endColumn : 4
224
+ }
225
+ ]
226
+ } ,
227
+ {
228
+ code : "fn(`\n`, b)" ,
229
+ output : "fn(`\n`,\nb)" ,
230
+ options : [ "always" ] ,
231
+ parserOptions : { ecmaVersion : 6 } ,
232
+ errors : [
233
+ {
234
+ messageId : "missingLineBreak" ,
235
+ line : 2 ,
236
+ column : 3 ,
237
+ endLine : 2 ,
238
+ endColumn : 4
239
+ }
240
+ ]
241
+ } ,
205
242
206
243
/* "never" */
207
244
{
@@ -324,6 +361,35 @@ ruleTester.run("function-call-argument-newline", rule, {
324
361
}
325
362
]
326
363
} ,
364
+ {
365
+ code : "fn({\n\ta: 1\n},\nb)" ,
366
+ output : "fn({\n\ta: 1\n}, b)" ,
367
+ options : [ "never" ] ,
368
+ errors : [
369
+ {
370
+ messageId : "unexpectedLineBreak" ,
371
+ line : 3 ,
372
+ column : 3 ,
373
+ endLine : 4 ,
374
+ endColumn : 1
375
+ }
376
+ ]
377
+ } ,
378
+ {
379
+ code : "fn(`\n`,\nb)" ,
380
+ output : "fn(`\n`, b)" ,
381
+ options : [ "never" ] ,
382
+ parserOptions : { ecmaVersion : 6 } ,
383
+ errors : [
384
+ {
385
+ messageId : "unexpectedLineBreak" ,
386
+ line : 2 ,
387
+ column : 3 ,
388
+ endLine : 3 ,
389
+ endColumn : 1
390
+ }
391
+ ]
392
+ } ,
327
393
328
394
/* "consistent" */
329
395
{
@@ -381,6 +447,64 @@ ruleTester.run("function-call-argument-newline", rule, {
381
447
endColumn : 19
382
448
}
383
449
]
450
+ } ,
451
+ {
452
+ code : "fn({\n\ta: 1\n},\nb, c)" ,
453
+ output : "fn({\n\ta: 1\n},\nb,\nc)" ,
454
+ options : [ "consistent" ] ,
455
+ errors : [
456
+ {
457
+ messageId : "missingLineBreak" ,
458
+ line : 4 ,
459
+ column : 3 ,
460
+ endLine : 4 ,
461
+ endColumn : 4
462
+ }
463
+ ]
464
+ } ,
465
+ {
466
+ code : "fn({\n\ta: 1\n}, b,\nc)" ,
467
+ output : "fn({\n\ta: 1\n}, b, c)" ,
468
+ options : [ "consistent" ] ,
469
+ errors : [
470
+ {
471
+ messageId : "unexpectedLineBreak" ,
472
+ line : 3 ,
473
+ column : 6 ,
474
+ endLine : 4 ,
475
+ endColumn : 1
476
+ }
477
+ ]
478
+ } ,
479
+ {
480
+ code : "fn(`\n`,\nb, c)" ,
481
+ output : "fn(`\n`,\nb,\nc)" ,
482
+ options : [ "consistent" ] ,
483
+ parserOptions : { ecmaVersion : 6 } ,
484
+ errors : [
485
+ {
486
+ messageId : "missingLineBreak" ,
487
+ line : 3 ,
488
+ column : 3 ,
489
+ endLine : 3 ,
490
+ endColumn : 4
491
+ }
492
+ ]
493
+ } ,
494
+ {
495
+ code : "fn(`\n`, b,\nc)" ,
496
+ output : "fn(`\n`, b, c)" ,
497
+ options : [ "consistent" ] ,
498
+ parserOptions : { ecmaVersion : 6 } ,
499
+ errors : [
500
+ {
501
+ messageId : "unexpectedLineBreak" ,
502
+ line : 2 ,
503
+ column : 6 ,
504
+ endLine : 3 ,
505
+ endColumn : 1
506
+ }
507
+ ]
384
508
}
385
509
]
386
510
} ) ;
0 commit comments