From 23865447c4a8ca2e5cbfc6cf37f34ae3ae3c2a4e Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 29 Apr 2026 14:21:19 -0400 Subject: [PATCH] lint --- .../.generated/compile-warnings.md | 12 +++++----- .../messages/compile-warnings/template.md | 8 +++---- packages/svelte/src/compiler/warnings.js | 22 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/documentation/docs/98-reference/.generated/compile-warnings.md b/documentation/docs/98-reference/.generated/compile-warnings.md index d37d297526..e32931d097 100644 --- a/documentation/docs/98-reference/.generated/compile-warnings.md +++ b/documentation/docs/98-reference/.generated/compile-warnings.md @@ -703,12 +703,6 @@ See [the migration guide](v5-migration-guide#Event-changes) for more info. Component has unused export property '%name%'. If it is for external reference only, please consider using `export const %name%` ``` -### unexpected_head - -``` -Using `` (%location%) will likely lead to runtime errors. Use [``](https://svelte.dev/docs/svelte/svelte-head) instead -``` - ### legacy_code ``` @@ -988,6 +982,12 @@ A derived value may be used in other contexts: See [the note in the docs](legacy-svelte-self) for more info. +### unexpected_head + +``` +Using `` (%location%) will likely lead to runtime errors. Use [``](https://svelte.dev/docs/svelte/svelte-head) instead +``` + ### unknown_code ``` diff --git a/packages/svelte/messages/compile-warnings/template.md b/packages/svelte/messages/compile-warnings/template.md index cae0f1c38c..857b409241 100644 --- a/packages/svelte/messages/compile-warnings/template.md +++ b/packages/svelte/messages/compile-warnings/template.md @@ -83,10 +83,6 @@ In a future version of Svelte, self-closing tags may be upgraded from a warning See [the migration guide](v5-migration-guide#Event-changes) for more info. -## unexpected_head - -> Using `` (%location%) will likely lead to runtime errors. Use [``](https://svelte.dev/docs/svelte/svelte-head) instead - ## node_invalid_placement_ssr > %message%. When rendering this component on the server, the resulting HTML will be modified by the browser (by moving, removing, or inserting elements), likely resulting in a `hydration_mismatch` warning @@ -163,3 +159,7 @@ A derived value may be used in other contexts: > `` is deprecated — use self-imports (e.g. `import %name% from './%basename%'`) instead See [the note in the docs](legacy-svelte-self) for more info. + +## unexpected_head + +> Using `` (%location%) will likely lead to runtime errors. Use [``](https://svelte.dev/docs/svelte/svelte-head) instead diff --git a/packages/svelte/src/compiler/warnings.js b/packages/svelte/src/compiler/warnings.js index 7959b7d211..04bd55592a 100644 --- a/packages/svelte/src/compiler/warnings.js +++ b/packages/svelte/src/compiler/warnings.js @@ -113,14 +113,14 @@ export const codes = [ 'element_implicitly_closed', 'element_invalid_self_closing_tag', 'event_directive_deprecated', - 'unexpected_head', 'node_invalid_placement_ssr', 'script_context_deprecated', 'script_unknown_attribute', 'slot_element_deprecated', 'svelte_component_deprecated', 'svelte_element_invalid_this', - 'svelte_self_deprecated' + 'svelte_self_deprecated', + 'unexpected_head' ]; /** @@ -786,15 +786,6 @@ export function event_directive_deprecated(node, name) { w(node, 'event_directive_deprecated', `Using \`on:${name}\` to listen to the ${name} event is deprecated. Use the event attribute \`on${name}\` instead\nhttps://svelte.dev/e/event_directive_deprecated`); } -/** - * Using `` (%location%) will likely lead to runtime errors. Use [``](https://svelte.dev/docs/svelte/svelte-head) instead - * @param {null | NodeLike} node - * @param {string} location - */ -export function unexpected_head(node, location) { - w(node, 'unexpected_head', `Using \`\` (${location}) will likely lead to runtime errors. Use [\`\`](https://svelte.dev/docs/svelte/svelte-head) instead\nhttps://svelte.dev/e/unexpected_head`); -} - /** * %message%. When rendering this component on the server, the resulting HTML will be modified by the browser (by moving, removing, or inserting elements), likely resulting in a `hydration_mismatch` warning * @param {null | NodeLike} node @@ -853,3 +844,12 @@ export function svelte_element_invalid_this(node) { export function svelte_self_deprecated(node, name, basename) { w(node, 'svelte_self_deprecated', `\`\` is deprecated — use self-imports (e.g. \`import ${name} from './${basename}'\`) instead\nhttps://svelte.dev/e/svelte_self_deprecated`); } + +/** + * Using `` (%location%) will likely lead to runtime errors. Use [``](https://svelte.dev/docs/svelte/svelte-head) instead + * @param {null | NodeLike} node + * @param {string} location + */ +export function unexpected_head(node, location) { + w(node, 'unexpected_head', `Using \`\` (${location}) will likely lead to runtime errors. Use [\`\`](https://svelte.dev/docs/svelte/svelte-head) instead\nhttps://svelte.dev/e/unexpected_head`); +} \ No newline at end of file