New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-extra-parens docs do not mention arrow function parameters #8741
no-extra-parens docs do not mention arrow function parameters #8741
Comments
Why is the ignoring of arrow functions intentional? And I second this addition, the current docs are a bit misleading about this. |
@TheGrandmother Because that functionality is already covered by the Of course, this also requires that our documentation explain those design decisions. 😄 When the documentation isn't doing that, that is also confusing to users. Make sense? |
@platinumazure Yes I know that you don't want overlapping rules (which is a good thing!) but why are there two different rules? Intuitive it feels like the |
That reason is simple; parentheses of arrow function parameters are not parenthesized expressions which can change precedence. |
The
no-extra-parens
rule docs don't mention that arrow function parameter parens are always/intentionally ignored by the rule (contrast with regex literals and IIFEs, which are explicitly listed as always ignored).In addition, the Related Rules section does not mention the arrow-parens rule.
Unsure if it might be worth adding a quick paragraph of prose about arrow parameter parens being covered by the other rule as well.
The text was updated successfully, but these errors were encountered: