@@ -46,6 +46,8 @@ ruleTester.run("function-call-argument-newline", rule, {
4646 options : [ "always" ] ,
4747 parserOptions : { ecmaVersion : 6 }
4848 } ,
49+ { code : "fn({\n\ta: 1\n},\n\tb,\n\tc)" , options : [ "always" ] } ,
50+ { code : "fn(`\n`,\n\ta)" , options : [ "always" ] , parserOptions : { ecmaVersion : 6 } } ,
4951
5052 /* "never" */
5153 { code : "fn(a, b)" , options : [ "never" ] } ,
@@ -59,10 +61,16 @@ ruleTester.run("function-call-argument-newline", rule, {
5961 options : [ "never" ] ,
6062 parserOptions : { ecmaVersion : 6 }
6163 } ,
64+ { code : "fn({\n\ta: 1\n}, b)" , options : [ "never" ] } ,
65+ { code : "fn(`\n`, a)" , options : [ "never" ] , parserOptions : { ecmaVersion : 6 } } ,
6266
6367 /* "consistent" */
6468 { 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 } }
6674 ] ,
6775 invalid : [
6876
@@ -202,6 +210,35 @@ ruleTester.run("function-call-argument-newline", rule, {
202210 }
203211 ]
204212 } ,
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+ } ,
205242
206243 /* "never" */
207244 {
@@ -324,6 +361,35 @@ ruleTester.run("function-call-argument-newline", rule, {
324361 }
325362 ]
326363 } ,
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+ } ,
327393
328394 /* "consistent" */
329395 {
@@ -381,6 +447,64 @@ ruleTester.run("function-call-argument-newline", rule, {
381447 endColumn : 19
382448 }
383449 ]
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+ ]
384508 }
385509 ]
386510} ) ;
0 commit comments