Makopo/lslint

Report condition always false in loops

Closed this issue · 1 comments

A loop with a constant false condition doesn't execute, which may be a bad thing. Currently lslint warns about conditions being constant true or false in if statements, but not in loops. It would be nice if it did, at least for false.

It's an open question whether a constant true condition is also worth reporting. It's another open question whether it should be reported in do...while loops. I guess there can be a setting for that. Thoughts?

For now, I've implemented it only for false conditions, and added no option for do...while loops, pending further comments.