Update: add options to (dis)allow comma expression in for-loops in no-sequences #14204
Labels
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
Projects
What rule do you want to change?
no-sequences
This is a follow-up of #14197 (Add option to disable the "in-parentheses" exception).
Consequently, the rule should contain an option to decide whether commas are allowed in for-loop heads.
Does this change cause the rule to produce more or fewer warnings?
More.
How will the change be implemented? (New option, new default behavior, etc.)?
Currently, comma expressions are always allowed in for-loop
init
andupdate
part, but not intest
part where it does not make any sense.I have two alternatives in mind:
test
part.init
andupdate
part:allowForLoopInit
(following "ignoreForLoopInit" from init-declarations)allowForLoopAfterthoughts
(as in no-plusplus) (orallowForLoopUpdate
which is shorter and better remarkable?)All options will be
true
by default for compatibility.Please provide some example code that this change will affect:
What does the rule currently do for this code?
Passes.
What will the rule do after it's changed?
Pass or warn according to options.
Are you willing to submit a pull request to implement this change?
Yes.
The text was updated successfully, but these errors were encountered: