actually no, not final. head_in_component makes no sense. renamed it. man i hate slop

pull/18151/head
Rich Harris 4 months ago
parent 98ccf31e97
commit 9dc0f484e6

@ -703,7 +703,7 @@ 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%`
```
### head_in_component
### unexpected_head
```
Using `<head>` (%location%) will likely lead to runtime errors. Use [`<svelte:head>`](https://svelte.dev/docs/svelte/svelte-head) instead

@ -83,7 +83,7 @@ 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.
## head_in_component
## unexpected_head
> Using `<head>` (%location%) will likely lead to runtime errors. Use [`<svelte:head>`](https://svelte.dev/docs/svelte/svelte-head) instead

@ -127,7 +127,7 @@ export function RegularElement(node, context) {
}
if (node.name === 'head' && !context.state.parent_element) {
w.head_in_component(node, locate_node(node));
w.unexpected_head(node, locate_node(node));
}
node.metadata.has_spread = node.attributes.some(

@ -113,7 +113,7 @@ export const codes = [
'element_implicitly_closed',
'element_invalid_self_closing_tag',
'event_directive_deprecated',
'head_in_component',
'unexpected_head',
'node_invalid_placement_ssr',
'script_context_deprecated',
'script_unknown_attribute',
@ -791,8 +791,8 @@ export function event_directive_deprecated(node, name) {
* @param {null | NodeLike} node
* @param {string} location
*/
export function head_in_component(node, location) {
w(node, 'head_in_component', `Using \`<head>\` (${location}) will likely lead to runtime errors. Use [\`<svelte:head>\`](https://svelte.dev/docs/svelte/svelte-head) instead\nhttps://svelte.dev/e/head_in_component`);
export function unexpected_head(node, location) {
w(node, 'unexpected_head', `Using \`<head>\` (${location}) will likely lead to runtime errors. Use [\`<svelte:head>\`](https://svelte.dev/docs/svelte/svelte-head) instead\nhttps://svelte.dev/e/unexpected_head`);
}
/**

@ -1,6 +1,6 @@
[
{
"code": "head_in_component",
"code": "unexpected_head",
"message": "Using `<head>` ((unknown):1:0) will likely lead to runtime errors. Use [`<svelte:head>`](https://svelte.dev/docs/svelte/svelte-head) instead",
"start": {
"line": 1,

Loading…
Cancel
Save