You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: packages/svelte/src/compiler/warnings.js
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,8 @@ export const codes = [
90
90
"component_name_lowercase",
91
91
"element_invalid_self_closing_tag",
92
92
"event_directive_deprecated",
93
-
"slot_element_deprecated"
93
+
"slot_element_deprecated",
94
+
"svelte_element_invalid_this"
94
95
];
95
96
96
97
/**
@@ -712,4 +713,12 @@ export function event_directive_deprecated(node, name) {
712
713
*/
713
714
exportfunctionslot_element_deprecated(node){
714
715
w(node,"slot_element_deprecated","Using `<slot>` to render parent content is deprecated. Use `{@render ...}` tags instead");
716
+
}
717
+
718
+
/**
719
+
* `this` should be an `{expression}`. Using a string attribute value will cause an error in future versions of Svelte
720
+
* @param {null | NodeLike} node
721
+
*/
722
+
exportfunctionsvelte_element_invalid_this(node){
723
+
w(node,"svelte_element_invalid_this","`this` should be an `{expression}`. Using a string attribute value will cause an error in future versions of Svelte");
0 commit comments