UNPKG

776 BMarkdownView Raw
1# `no-extra-parens`
2
3Disallow unnecessary parentheses.
4
5## Rule Details
6
7This rule extends the base [`eslint/no-extra-parens`](https://eslint.org/docs/rules/no-extra-parens) rule.
8It adds support for TypeScript type assertions.
9
10## How to Use
11
12```jsonc
13{
14 // note you must disable the base rule as it can report incorrect errors
15 "no-extra-parens": "off",
16 "@typescript-eslint/no-extra-parens": ["error"]
17}
18```
19
20## Options
21
22See [`eslint/no-extra-parens` options](https://eslint.org/docs/rules/no-extra-parens#options).
23
24<sup>
25
26Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-extra-parens.md)
27
28</sup>
29
30## Attributes
31
32- Configs:
33 - [ ] ✅ Recommended
34 - [ ] 🔒 Strict
35- [x] 🔧 Fixable
36- [ ] 💭 Requires type information