mirror of https://github.com/sveltejs/svelte
breaking: disallow string literal values in `<svelte:element this="...">` (#11454)
* breaking: disallow string literal values in `<svelte:element this="...">` * note breaking change * Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com> * prettier * make invalid `<svelte:element this>` a warning instead of an error (#11641) * make it a warning instead of an error * format --------- Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com>pull/11659/head
parent
ade6b6e480
commit
d288735fa8
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
breaking: disallow string literal values in `<svelte:element this="...">`
|
@ -1,2 +1,2 @@
|
||||
<svelte:element this="div"></svelte:element>
|
||||
<svelte:element this="div" class="foo"></svelte:element>
|
||||
<svelte:element this={"div"}></svelte:element>
|
||||
<svelte:element this={"div"} class="foo"></svelte:element>
|
||||
|
@ -1 +1 @@
|
||||
<svelte:element this="div">Foo</svelte:element>
|
||||
<svelte:element this={"div"}>Foo</svelte:element>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<svelte:element this="svg" xmlns="http://www.w3.org/2000/svg">
|
||||
<svelte:element this="path" xmlns="http://www.w3.org/2000/svg"></svelte:element>
|
||||
<svelte:element this={"svg"} xmlns="http://www.w3.org/2000/svg">
|
||||
<svelte:element this={"path"} xmlns="http://www.w3.org/2000/svg"></svelte:element>
|
||||
</svelte:element>
|
@ -1 +1 @@
|
||||
<svelte:element this="textarea"></svelte:element>
|
||||
<svelte:element this={"textarea"}></svelte:element>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<div>
|
||||
<svelte:element this="p" />
|
||||
<svelte:element this={"p"} />
|
||||
</div>
|
||||
|
@ -1 +1 @@
|
||||
<svelte:element this="div">Foo</svelte:element>
|
||||
<svelte:element this={"div"}>Foo</svelte:element>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<svelte:element this="title">lorem</svelte:element>
|
||||
<svelte:element this="style">{'.ipsum { display: block; }'}</svelte:element>
|
||||
<svelte:element this="script">{'console.log(true);'}</svelte:element>
|
||||
<svelte:element this={"title"}>lorem</svelte:element>
|
||||
<svelte:element this={"style"}>{'.ipsum { display: block; }'}</svelte:element>
|
||||
<svelte:element this={"script"}>{'console.log(true);'}</svelte:element>
|
||||
|
@ -1,14 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "svelte_element_invalid_this",
|
||||
"message": "Invalid element definition — must be an `{expression}`",
|
||||
"code": "svelte_element_missing_this",
|
||||
"message": "`<svelte:element>` must have a 'this' attribute with a value",
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
"column": 21
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in new issue