Skip to content

no-extra-parens new option to avoid conflicts with no-sequences #11916

@mdjermanovic

Description

@mdjermanovic

What rule do you want to change?

no-extra-parens

Does this change cause the rule to produce more or fewer warnings?

fewer

How will the change be implemented? (New option, new default behavior, etc.)?

new option

Please provide some example code that this change will affect:

/* eslint  no-extra-parens: "error" */
/* eslint  no-sequences: "error" */

(a, b); // 'no-extra-parens' warning

if ((a, b)); // 'no-extra-parens' warning

while((a, b)); // 'no-extra-parens' warning

What does the rule currently do for this code?

Fixes it to:

/* eslint  no-extra-parens: "error" */
/* eslint  no-sequences: "error" */

a, b; // 'no-sequences' warning

if (a, b); // 'no-sequences' warning

while(a, b); // 'no-sequences' warning

What will the rule do after it's changed?

/* eslint  no-extra-parens: ["error", "all", { "sequenceExpressions": false }] */
/* eslint  no-sequences: "error" */

(a, b); // no warnings

if ((a, b)); // no warnings

while((a, b)); // no warnings

Are you willing to submit a pull request to implement this change?

Yes

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionenhancementThis change enhances an existing feature of ESLintruleRelates to ESLint's core rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions