From 2f5b26eb6fd7eb737a0cba287c826307e7b7f004 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 23 Apr 2024 21:26:20 -0400 Subject: [PATCH] lint --- packages/svelte/scripts/process-messages/index.js | 2 +- packages/svelte/src/compiler/warnings.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/svelte/scripts/process-messages/index.js b/packages/svelte/scripts/process-messages/index.js index ec8b90ebb0..80c3a811d9 100644 --- a/packages/svelte/scripts/process-messages/index.js +++ b/packages/svelte/scripts/process-messages/index.js @@ -176,7 +176,7 @@ function transform(name, dest) { for (let i = 0; i < parts.length; i += 1) { const part = parts[i]; if (i % 2 === 0) { - const str = part.replace(/(`|\$)/g, '\\$1'); + const str = part.replace(/(`|\${)/g, '\\$1'); quasis.push({ type: 'TemplateElement', value: { raw: str, cooked: str }, diff --git a/packages/svelte/src/compiler/warnings.js b/packages/svelte/src/compiler/warnings.js index bf8907356e..1e71aa51a6 100644 --- a/packages/svelte/src/compiler/warnings.js +++ b/packages/svelte/src/compiler/warnings.js @@ -574,7 +574,7 @@ export function avoid_nested_class(node) { * @param {string} name */ export function store_with_rune_name(node, name) { - w(node, "store_with_rune_name", `It looks like you're using the \`\$${name}\` rune, but there is a local binding called \`${name}\`. Referencing a local variable with a \`\$\` prefix will create a store subscription. Please rename \`${name}\` to avoid the ambiguity`); + w(node, "store_with_rune_name", `It looks like you're using the \`$${name}\` rune, but there is a local binding called \`${name}\`. Referencing a local variable with a \`$\` prefix will create a store subscription. Please rename \`${name}\` to avoid the ambiguity`); } /** @@ -583,7 +583,7 @@ export function store_with_rune_name(node, name) { * @param {string} name */ export function non_state_reference(node, name) { - w(node, "non_state_reference", `\`${name}\` is updated, but is not declared with \`\$state(...)\`. Changing its value will not correctly trigger updates`); + w(node, "non_state_reference", `\`${name}\` is updated, but is not declared with \`$state(...)\`. Changing its value will not correctly trigger updates`); } /**