requireSpacesInsideParenthesizedExpression

Requires space after opening and before closing grouping parentheses.

Types: Boolean or Object

Values:

  • true: always require spaces inside grouping parentheses
  • Object:
    • "allExcept": [ "{", "}", "function" ] Ignore parenthesized objects and functions

Example

"requireSpacesInsideParenthesizedExpression": true

// or

"requireSpacesInsideParenthesizedExpression": {
    "allExcept": [ "{", "}" ]
}
Valid for mode true
var x = ( 1 + obj.size ) * ( 2 );
Valid for mode { allExcept": [ "{", "}", "function" ] }
var x = ( options || { x: true }).x;
var global = (function() { return this; })();
Invalid
var x = (1 + obj.size) * (2);
Rule source
Test source