From 507091a9760262d1c45db2b4035d2d5833f91ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Sat, 28 Dec 2019 15:58:43 -0800 Subject: [PATCH] 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> --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index 1753a27..7134931 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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"],