-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintruleRelates to ESLint's core rulesRelates to ESLint's core rules
Description
Follow-up for bug report #14184
What rule do you want to change?
no-sequences
Does this change cause the rule to produce more or fewer warnings?
more warnings
How will the change be implemented? (New option, new default behavior, etc.)?
- New option that disables (or enables) the exception that sequences are allowed in parentheses.
Please provide some example code that this change will affect:
if ((x1 === x2) && (y1, y2)) {
Intended was
if ((x1 === x2) && (y1 === y2)) {
This real-life bug sneaked in after replacing a comparison function with the comparison operator
- if (isEqual(x1, x2) && isEqual(y1, y2)) {
+ if ((x1 === x2) && (y1, y2)) {
It was hard to find because the sequence expression was hidden in a short-circuiting AND operator.
What does the rule currently do for this code?
Lets it pass.
What will the rule do after it's changed?
Warns for the sequence.
Are you willing to submit a pull request to implement this change?
No. Yes.
mdjermanovic, nzakas and btmills
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintruleRelates to ESLint's core rulesRelates to ESLint's core rules
Type
Projects
Status
Complete