1 # require or disallow spacing between function identifiers and their invocations (func-call-spacing)
3 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:
18 This rule requires or disallows spaces between the function name and the opening parenthesis that calls it.
22 This rule has a string option:
24 - `"never"` (default) disallows space between the function name and the opening parenthesis.
25 - `"always"` requires space between the function name and the opening parenthesis.
27 Further, in `"always"` mode, a second object option is available that contains a single boolean `allowNewlines` property.
31 Examples of **incorrect** code for this rule with the default `"never"` option:
34 /*eslint func-call-spacing: ["error", "never"]*/
42 Examples of **correct** code for this rule with the default `"never"` option:
45 /*eslint func-call-spacing: ["error", "never"]*/
52 Examples of **incorrect** code for this rule with the `"always"` option:
55 /*eslint func-call-spacing: ["error", "always"]*/
63 Examples of **correct** code for this rule with the `"always"` option:
66 /*eslint func-call-spacing: ["error", "always"]*/
73 By default, `"always"` does not allow newlines. To permit newlines when in `"always"` mode, set the `allowNewlines` option to `true`. Newlines are never required.
75 Examples of **incorrect** code for this rule with `allowNewlines` option enabled:
78 /*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
83 Examples of **correct** code for this rule with the `allowNewlines` option enabled:
86 /*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
88 fn (); // Newlines are never required.
96 This rule can safely be turned off if your project does not care about enforcing a consistent style for spacing within function calls.
100 - [no-spaced-func](no-spaced-func.md) (deprecated)
104 - **JSCS**: [disallowSpacesInCallExpression](https://jscs-dev.github.io/rule/disallowSpacesInCallExpression)
105 - **JSCS**: [requireSpacesInCallExpression](https://jscs-dev.github.io/rule/requireSpacesInCallExpression)