Add a --fix option for no-extra-parens #6944
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
enhancement
This change enhances an existing feature of ESLint
rule
Relates to ESLint's core rules
I'm using Node v6.4.0 and ESLint v3.3.1.
I think it would be useful to have an autofix option for the
no-extra-parens
rule. I think the fixer would be fairly simple; it would just remove the offending parens from the source code.Presumably, the fixer would follow the same options as the rule itself to determine whether parentheses are gratuitous. For example:
One special case for
no-extra-parens
is when a parenthesized expression is immediately preceded by a keyword:If this issue gets accepted, I would be happy to send a PR for it.
edit: Added a special case that I noticed
The text was updated successfully, but these errors were encountered: