function-call-argument-newline 
许多风格指南要求或禁止在函数调用参数之间换行。
规则详情 
此规则强制在函数调用参数之间换行。
选项 
此规则有一个字符串选项
- "always"(默认) 要求参数之间换行
- "never"禁止参数之间换行
- "consistent"要求参数之间换行使用一致的方式
always 
使用默认 "always" 选项时,此规则的错误代码示例
js
/*eslint @stylistic/js/function-call-argument-newline: ["error", "always"]*/
foo("one", "two", "three");
bar("one", "two", {
    one: 1,
    two: 2
});
baz("one", "two", (x) => {
    console.log(x);
}); 错误 
使用默认 "always" 选项时,此规则的正确代码示例
js
/*eslint @stylistic/js/function-call-argument-newline: ["error", "always"]*/
foo(
    "one",
    "two",
    "three"
);
bar(
    "one",
    "two",
    { one: 1, two: 2 }
);
// or
bar(
    "one",
    "two",
    {
        one: 1,
        two: 2
    }
);
baz(
    "one",
    "two",
    (x) => {
        console.log(x);
    }
); 正确 
never 
使用 "never" 选项时,此规则的错误代码示例
js
/*eslint @stylistic/js/function-call-argument-newline: ["error", "never"]*/
foo(
    "one",
        "two", "three"
);
bar(
    "one",
        "two", {
        one: 1,
        two: 2
    }
);
baz(
    "one",
        "two", (x) => {
        console.log(x);
    }
); 错误 
使用 "never" 选项时,此规则的正确代码示例
js
/*eslint @stylistic/js/function-call-argument-newline: ["error", "never"]*/
foo("one", "two", "three");
// or
foo(
    "one", "two", "three"
);
bar("one", "two", { one: 1, two: 2 });
// or
bar("one", "two", {
    one: 1,
    two: 2
});
baz("one", "two", (x) => {
    console.log(x);
}); 正确 
consistent 
使用 "consistent" 选项时,此规则的错误代码示例
js
/*eslint @stylistic/js/function-call-argument-newline: ["error", "consistent"]*/
foo("one", "two",
        "three");
//or
foo("one",
    "two", "three");
bar("one", "two",
        { one: 1, two: 2}
);
baz("one", "two",
        (x) => { console.log(x); }
); 错误 
使用 "consistent" 选项时,此规则的正确代码示例
js
/*eslint @stylistic/js/function-call-argument-newline: ["error", "consistent"]*/
foo("one", "two", "three");
// or
foo(
    "one",
    "two",
    "three"
);
bar("one", "two", {
    one: 1,
    two: 2
});
// or
bar(
    "one",
    "two",
    { one: 1, two: 2 }
);
// or
bar(
    "one",
    "two",
    {
        one: 1,
        two: 2
    }
);
baz("one", "two", (x) => {
    console.log(x);
});
// or
baz(
    "one",
    "two",
    (x) => {
        console.log(x);
    }
); 正确 
何时不使用它 
如果您不想强制在参数之间换行,请不要启用此规则。