feat: sort possible bindings in invalid binding error (#11950)

pull/11976/head
wackbyte 7 months ago committed by GitHub
parent a41223598c
commit c9202a8896
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
feat: sort possible bindings in invalid binding error

@ -421,7 +421,8 @@ const validation = {
!binding_property.invalid_elements?.includes(parent.name)) !binding_property.invalid_elements?.includes(parent.name))
); );
}) })
.map(([property_name]) => property_name); .map(([property_name]) => property_name)
.sort();
e.bind_invalid_name( e.bind_invalid_name(
node, node,
node.name, node.name,

@ -1,7 +1,7 @@
[ [
{ {
"code": "bind_invalid_name", "code": "bind_invalid_name",
"message": "`bind:clientWidth` is not a valid binding. Possible bindings for <svelte:document> are focused, activeElement, fullscreenElement, pointerLockElement, visibilityState, this", "message": "`bind:clientWidth` is not a valid binding. Possible bindings for <svelte:document> are activeElement, focused, fullscreenElement, pointerLockElement, this, visibilityState",
"start": { "start": {
"line": 5, "line": 5,
"column": 17 "column": 17

@ -1,7 +1,7 @@
[ [
{ {
"code": "bind_invalid_name", "code": "bind_invalid_name",
"message": "`bind:clientWidth` is not a valid binding. Possible bindings for <svelte:window> are focused, innerWidth, innerHeight, outerWidth, outerHeight, scrollX, scrollY, online, devicePixelRatio, this", "message": "`bind:clientWidth` is not a valid binding. Possible bindings for <svelte:window> are devicePixelRatio, focused, innerHeight, innerWidth, online, outerHeight, outerWidth, scrollX, scrollY, this",
"start": { "start": {
"line": 5, "line": 5,
"column": 15 "column": 15

Loading…
Cancel
Save