You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I write an infinite loop, I want to write for (;;) {}, but prefer-while gets flagged, forcing me to instead write while (true) but then another linter says "no constant conditions" and I'm back to the for loop.
Could an option for prefer-while be added that allows the infinite for loop to be used?
The text was updated successfully, but these errors were encountered:
I would think it's more like allowing empty for, rather than preferring empty for. Same feel as any exception to other eslint rules. The empty for loop is also not so much "a specific for loop which only has a condition" but rather a for loop without a condition? Since a while loop cannot be without a condition, this is a special ability of the for loop that I would like to allow.
While ignoring constant conditions in loops is an option that allows writing an infinite loop, there is still no way to write the infinite for loop without disabling something.
I agree rule should not trigger if for does not have a condition, the purpose of the rule is to use while(condition) when only condition is defined for for.
I want to request a feature.
When I write an infinite loop, I want to write
for (;;) {}
, butprefer-while
gets flagged, forcing me to instead writewhile (true)
but then another linter says "no constant conditions" and I'm back to the for loop.Could an option for
prefer-while
be added that allows the infinite for loop to be used?The text was updated successfully, but these errors were encountered: