requireSpacesInNamedFunctionExpression

Requires space before () or {} in named function expressions.

Types: Object

  • Object (at least one of properties must be present and it must be set to true):
    • 'beforeOpeningRoundBrace'
      • true validates that there is a space before ()
    • 'beforeOpeningCurlyBrace'
      • true validates that there is a space before {}

Example

"requireSpacesInNamedFunctionExpression": {
    "beforeOpeningRoundBrace": true,
    "beforeOpeningCurlyBrace": true
}
"requireSpacesInNamedFunctionExpression": {
    "beforeOpeningRoundBrace": true
}
"requireSpacesInNamedFunctionExpression": {
    "beforeOpeningCurlyBrace": true
}
Valid for mode { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }
var x = function a () {};
Valid for mode { "beforeOpeningRoundBrace": true }
var x = function a (){};
Valid for mode { "beforeOpeningCurlyBrace": true }
var x = function a() {};
Invalid for mode { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }
var x = function a() {};
var x = function a (){};
var x = function a(){};
Rule source
Test source