Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upmomentJS var 'not modified' in while loop #770
Comments
This comment has been minimized.
This comment has been minimized.
|
This is a limitation of the In short, what's happening is that the identity of the So, you can work around this rule by explicitly calling while (dateStart.valueOf() < dateEnd.valueOf()) {
}(You could also use |
feross
closed this
Feb 2, 2017
This comment has been minimized.
This comment has been minimized.
|
There is a proposal to eslint that would let us relax this rule a bit so that any reference to the condition variables in the loop body would be treated as a modification. Then it would only be an error to completely omit a condition variable from the body. You can follow this here: eslint/eslint#8021 |
This comment has been minimized.
This comment has been minimized.
I always found the nature of |
benjaminhoffman commentedFeb 1, 2017
•
edited
Noticed that linter yells that my while-loop variable "is not modified in this loop", even though I am (via momentJS). You'll see from the code & screenshot below that I subtract one month with momentJS on each iteration. Here's the relevant part:
Thoughts on this one?