2 title: func-call-spacing
11 When calling a function, developers may insert optional whitespace between the function's name and the parentheses that invoke it. The following pairs of function calls are equivalent:
26 This rule requires or disallows spaces between the function name and the opening parenthesis that calls it.
30 This rule has a string option:
32 * `"never"` (default) disallows space between the function name and the opening parenthesis.
33 * `"always"` requires space between the function name and the opening parenthesis.
35 Further, in `"always"` mode, a second object option is available that contains a single boolean `allowNewlines` property.
39 Examples of **incorrect** code for this rule with the default `"never"` option:
44 /*eslint func-call-spacing: ["error", "never"]*/
54 Examples of **correct** code for this rule with the default `"never"` option:
59 /*eslint func-call-spacing: ["error", "never"]*/
68 Examples of **incorrect** code for this rule with the `"always"` option:
73 /*eslint func-call-spacing: ["error", "always"]*/
83 Examples of **correct** code for this rule with the `"always"` option:
88 /*eslint func-call-spacing: ["error", "always"]*/
97 By default, `"always"` does not allow newlines. To permit newlines when in `"always"` mode, set the `allowNewlines` option to `true`. Newlines are never required.
99 Examples of **incorrect** code for this rule with `allowNewlines` option enabled:
104 /*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
111 Examples of **correct** code for this rule with the `allowNewlines` option enabled:
116 /*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
118 fn (); // Newlines are never required.
126 ## When Not To Use It
128 This rule can safely be turned off if your project does not care about enforcing a consistent style for spacing within function calls.
132 * **JSCS**: [disallowSpacesInCallExpression](https://jscs-dev.github.io/rule/disallowSpacesInCallExpression)
133 * **JSCS**: [requireSpacesInCallExpression](https://jscs-dev.github.io/rule/requireSpacesInCallExpression)