From 50d75cd2f9c4517683d44ab07dc13deb56a5004d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 1 May 2024 11:08:06 +0100 Subject: [PATCH] refactor: Make loop condition non-constant Resolves this eslint issue: /puter/packages/phoenix/src/ansi-shell/readline/readline.js 154:33 error Unexpected constant condition no-constant-condition --- packages/phoenix/src/ansi-shell/readline/readline.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/phoenix/src/ansi-shell/readline/readline.js b/packages/phoenix/src/ansi-shell/readline/readline.js index 0a9c0490..0d1b8326 100644 --- a/packages/phoenix/src/ansi-shell/readline/readline.js +++ b/packages/phoenix/src/ansi-shell/readline/readline.js @@ -151,11 +151,7 @@ const ReadlineProcessorBuilder = builder => builder if ( completions.length > 1 ) { let inCommon = ''; - for ( let i=0 ; true ; i++ ) { - if ( ! completions.every(completion => { - return completion.length > i; - }) ) break; - + for ( let i=0 ; completions.every(completion => completion.length > i) ; i++ ) { let matches = true; const chrFirst = completions[0][i];