# no-redundant-parentheses

Rule `sonarjs/no-redundant-parentheses`. Redundant pairs of parentheses should be removed

- Source: sonarjs
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Deprecated: yes
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2159 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/no-redundant-parentheses` | no | suggestion | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-1110/) |

## Code examples

### Incorrect: the rule reports this

```js
let x = (y / 2 + 1);   //Compliant even if those parenthesis are useless for the compiler

if (a && ((x+y > 0))) {  // Noncompliant
  //...
}

return ((x + 1));  // Noncompliant
```

### Correct: the rule accepts this

```js
let x = (y / 2 + 1);

if (a && (x+y > 0)) {
  //...
}

return (x + 1);
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/no-redundant-parentheses": "error",
    },
  },
];
```

## Related rules

- [sonarjs/no-networkidle-wait](https://lintradar.dev/rules/sonarjs/no-networkidle-wait.md): Playwright "networkidle" waits should not be used
- [sonarjs/no-reference-error](https://lintradar.dev/rules/sonarjs/no-reference-error.md): Variables should be defined before being used
- [sonarjs/no-nested-incdec](https://lintradar.dev/rules/sonarjs/no-nested-incdec.md): Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
- [sonarjs/no-require-or-define](https://lintradar.dev/rules/sonarjs/no-require-or-define.md): "import" should be used to include external code
- [sonarjs/no-return-type-any](https://lintradar.dev/rules/sonarjs/no-return-type-any.md): Primitive return types should be used
- [sonarjs/no-mixed-completion-style](https://lintradar.dev/rules/sonarjs/no-mixed-completion-style.md): Test and hook callbacks should use a single completion style

---

Web page: https://lintradar.dev/rules/sonarjs/no-redundant-parentheses. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
