space-in-parens
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"space-in-parens": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
foo( );
foo( 'bar');
foo('bar' );
foo( 'bar' );
foo( /* bar */ );
var foo = ( 1 + 2 ) * 3;
( function () { return 'bar'; }() );foo( 'bar');
foo('bar' );
foo('bar');
foo(/* bar */);
var foo = (1 + 2) * 3;
(function () { return 'bar'; }());foo({bar: 'baz'});
foo(1, {bar: 'baz'});foo();
foo('bar');
foo(/* bar */);
var foo = (1 + 2) * 3;
(function () { return 'bar'; }());foo();
foo( );
foo( 'bar' );
foo( /* bar */ );
var foo = ( 1 + 2 ) * 3;
( function () { return 'bar'; }() );foo( {bar: 'baz'} );
foo(1, {bar: 'baz'} );Examples from the ESLint documentation.
space-in-parens
eslint
export default [
{
rules: {
"space-in-parens": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce consistent spacing inside parentheses in <template>
Require var declarations be placed at the top of their containing scope
Require for-in loops to include an if statement
Enforce the use of variables within the scope they are defined
Require grouped accessor pairs in object literals and classes