From 8e00693af364c17cb916353627e1d0bf787cbdf3 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 1 Dec 2025 07:54:02 -0800 Subject: [PATCH] Fix JSON lint error location --- src-web/components/core/Editor/json-lint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-web/components/core/Editor/json-lint.ts b/src-web/components/core/Editor/json-lint.ts index 1c340fad..f4b080dd 100644 --- a/src-web/components/core/Editor/json-lint.ts +++ b/src-web/components/core/Editor/json-lint.ts @@ -10,7 +10,7 @@ export function jsonParseLinter() { const doc = view.state.doc.toString(); // We need lint to not break on stuff like {"foo:" ${[ ... ]}} so we'll replace all template // syntax with repeating `1` characters, so it's valid JSON and the position is still correct. - const escapedDoc = doc.replace(TEMPLATE_SYNTAX_REGEX, '1'); + const escapedDoc = doc.replace(TEMPLATE_SYNTAX_REGEX, (m) => '1'.repeat(m.length)); jsonLintParse(escapedDoc); // biome-ignore lint/suspicious/noExplicitAny: none } catch (err: any) {