1 # enforce line breaks between arguments of a function call (function-call-argument-newline)
3 A number of style guides require or disallow line breaks between arguments of a function call.
7 This rule enforces line breaks between arguments of a function call.
11 This rule has a string option:
13 * `"always"` (default) requires line breaks between arguments
14 * `"never"` disallows line breaks between arguments
15 * `"consistent"` requires consistent usage of line breaks between arguments
20 Examples of **incorrect** code for this rule with the default `"always"` option:
23 /*eslint function-call-argument-newline: ["error", "always"]*/
25 foo("one", "two", "three");
32 baz("one", "two", (x) => {
37 Examples of **correct** code for this rule with the default `"always"` option:
40 /*eslint function-call-argument-newline: ["error", "always"]*/
75 Examples of **incorrect** code for this rule with the `"never"` option:
78 /*eslint function-call-argument-newline: ["error", "never"]*/
101 Examples of **correct** code for this rule with the `"never"` option:
104 /*eslint function-call-argument-newline: ["error", "never"]*/
106 foo("one", "two", "three");
109 "one", "two", "three"
112 bar("one", "two", { one: 1, two: 2 });
119 baz("one", "two", (x) => {
126 Examples of **incorrect** code for this rule with the `"consistent"` option:
129 /*eslint function-call-argument-newline: ["error", "consistent"]*/
142 (x) => { console.log(x); }
146 Examples of **correct** code for this rule with the `"consistent"` option:
149 /*eslint function-call-argument-newline: ["error", "consistent"]*/
151 foo("one", "two", "three");
179 baz("one", "two", (x) => {
193 ## When Not To Use It
195 If you don't want to enforce line breaks between arguments, don't enable this rule.
199 * [function-paren-newline](function-paren-newline.md)
200 * [func-call-spacing](func-call-spacing.md)
201 * [object-property-newline](object-property-newline.md)
202 * [array-element-newline](array-element-newline.md)