mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 17:28:29 +02:00
Fix JSON lint error location
This commit is contained in:
@@ -10,7 +10,7 @@ export function jsonParseLinter() {
|
|||||||
const doc = view.state.doc.toString();
|
const doc = view.state.doc.toString();
|
||||||
// We need lint to not break on stuff like {"foo:" ${[ ... ]}} so we'll replace all template
|
// 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.
|
// 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);
|
jsonLintParse(escapedDoc);
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// biome-ignore lint/suspicious/noExplicitAny: none
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user