-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(eslint-plugin): [no-unnece-cond] Add allowConstantLoopConditions #1029
feat(eslint-plugin): [no-unnece-cond] Add allowConstantLoopConditions #1029
Conversation
Thanks for the PR, @a-tarasyuk! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
Codecov Report
@@ Coverage Diff @@
## master #1029 +/- ##
==========================================
+ Coverage 94.23% 94.24% +<.01%
==========================================
Files 126 126
Lines 5377 5384 +7
Branches 1510 1513 +3
==========================================
+ Hits 5067 5074 +7
Misses 177 177
Partials 133 133
|
…an-option-to-allow-while-true
I haven't reviewed the code yet - but I think I'd rather it if the option was named "allowConstantLoopConditions". To me "checkLoops" implies that you're turning off checks for loops entirely. |
Do we need to have this behavior behind an option? I know it's consistent with Certainly, some people would like a linter error on that line, because they want the linter to forbid infinite loops; but that seems like a stylistic preference that's a bit tangential to the purpose of this rule. (Which is intended to be a correctness rule, more than stylistic) Maybe forbidding infinite loops should be the purview of some other rule - maybe a rule specific to that purpose. |
Enhancements need to be backward compatible. |
…an-option-to-allow-while-true
…an-option-to-allow-while-true
…an-option-to-allow-while-true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code and test mostly LGTM.
one comment to address and then we can merge this in.
…ipt-eslint into feature/1015-no-unnecessary-condition-add-an-option-to-allow-while-true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for this!
Fixes #1015