Allow `while(true)` loops (#1495)
The eslint no-constant-condition rule disallows while(true) loops, since the true is a constant condition. However, I find the allowed alternative (`for (;;)`) less readable, so I am adding the sub-rule that allows constant conditions for loops. Test plan: A followon commit uses a while(true) loop, and, assuming this patch is applied, it does not result in a lint error. Co-authored-by: Robin van Boven <497556+Beanow@users.noreply.github.com>
This commit is contained in:
parent
8f32912270
commit
507091a976
|
@ -29,6 +29,7 @@ module.exports = {
|
|||
caughtErrorsIgnorePattern: "^_$|^_unused_",
|
||||
},
|
||||
],
|
||||
"no-constant-condition": ["warn", {checkLoops: false}],
|
||||
"no-use-before-define": ["off"],
|
||||
"no-useless-constructor": ["off"],
|
||||
"no-case-declarations": ["off"],
|
||||
|
|
Loading…
Reference in New Issue