From 96e9c154bd741dfbfe3c9c6890873e73ab26aef4 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 1 May 2024 11:32:18 +0100 Subject: [PATCH] chore: Fix a couple of regex related eslint issues /puter/packages/phoenix/src/puter-shell/providers/ScriptCommandProvider.js 27:38 error Unnecessary escape character: \/ no-useless-escape /puter/packages/phoenix/src/util/wrap-text.js 24:33 error Unexpected control character(s) in regular expression: \x1b no-control-regex --- .../phoenix/src/puter-shell/providers/ScriptCommandProvider.js | 2 +- packages/phoenix/src/util/wrap-text.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/phoenix/src/puter-shell/providers/ScriptCommandProvider.js b/packages/phoenix/src/puter-shell/providers/ScriptCommandProvider.js index 66be2041f..1e50a0894 100644 --- a/packages/phoenix/src/puter-shell/providers/ScriptCommandProvider.js +++ b/packages/phoenix/src/puter-shell/providers/ScriptCommandProvider.js @@ -24,7 +24,7 @@ export class ScriptCommandProvider { async lookup (id, { ctx }) { const { filesystem } = ctx.platform; - const is_path = id.match(/^[.\/]/); + const is_path = id.match(/^[./]/); if ( ! is_path ) return undefined; const absPath = resolveRelativePath(ctx.vars, id); diff --git a/packages/phoenix/src/util/wrap-text.js b/packages/phoenix/src/util/wrap-text.js index 478f1e76b..86adfe840 100644 --- a/packages/phoenix/src/util/wrap-text.js +++ b/packages/phoenix/src/util/wrap-text.js @@ -16,6 +16,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +/* eslint-disable no-control-regex */ + export function lengthIgnoringEscapes(text) { const escape = '\x1b'; // There are a lot of different ones, but we only use graphics-mode ones, so only parse those for now.