Hooked up jsonc language mode for Codemirror

This commit is contained in:
Gregory Schier
2026-03-05 06:50:44 -08:00
parent 88f5f0e045
commit 2247d8b158
5 changed files with 22 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ export function jsonParseLinter() {
// 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, (m) => '1'.repeat(m.length));
jsonLintParse(escapedDoc);
jsonLintParse(escapedDoc, { mode: 'cjson' });
// biome-ignore lint/suspicious/noExplicitAny: none
} catch (err: any) {
if (!('location' in err)) {