Rule: space-before-function-paren
Require or disallow a space before function parenthesis
Notes:
Has Fixer
Config
One argument which is an object which may contain the keys anonymous
, named
, and asyncArrow
These should be set to either "always"
or "never"
.
"anonymous"
checks before the opening paren in anonymous functions"named"
checks before the opening paren in named functions"asyncArrow"
checks before the opening paren in async arrow functions"method"
checks before the opening paren in class methods"constructor"
checks before the opening paren in class constructors
Config examples
"space-before-function-paren": true
"space-before-function-paren": [true, "always"]
"space-before-function-paren": [true, "never"]
"space-before-function-paren": [true, {"anonymous": "always", "named": "never", "asyncArrow": "always"}]
Schema
{ "properties": { "anonymous": { "enum": [ "always", "never" ], "type": "string" }, "asyncArrow": { "enum": [ "always", "never" ], "type": "string" }, "constructor": { "enum": [ "always", "never" ], "type": "string" }, "method": { "enum": [ "always", "never" ], "type": "string" }, "named": { "enum": [ "always", "never" ], "type": "string" } }, "type": "object" }