-
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mark exports as "can only bind to them"
- Loading branch information
1 parent
811b1ce
commit e118ab0
Showing
12 changed files
with
99 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...guage-server/test/plugins/typescript/features/diagnostics/fixtures/bindings/Legacy.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script lang="ts"> | ||
export let value = 'implicitly bindable'; | ||
export function bind_and_prop() { | ||
return true; | ||
} | ||
</script> |
7 changes: 7 additions & 0 deletions
7
...nguage-server/test/plugins/typescript/features/diagnostics/fixtures/bindings/Runes.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script lang="ts"> | ||
let { readonly, can_bind = $bindable() }: { readonly?: string; can_bind?: string } = $props(); | ||
export function only_bind() { | ||
return true; | ||
} | ||
</script> |
36 changes: 36 additions & 0 deletions
36
...ver/test/plugins/typescript/features/diagnostics/fixtures/bindings/expected_svelte_5.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[ | ||
{ | ||
"code": 2322, | ||
"message": "Type 'Binding<string>' is not assignable to type 'string'.", | ||
"range": { | ||
"end": { | ||
"character": 20, | ||
"line": 23 | ||
}, | ||
"start": { | ||
"character": 12, | ||
"line": 23 | ||
} | ||
}, | ||
"severity": 1, | ||
"source": "ts", | ||
"tags": [] | ||
}, | ||
{ | ||
"code": 2322, | ||
"message": "Type '() => boolean' is not assignable to type 'Binding<() => boolean>'.", | ||
"range": { | ||
"end": { | ||
"character": 17, | ||
"line": 24 | ||
}, | ||
"start": { | ||
"character": 8, | ||
"line": 24 | ||
} | ||
}, | ||
"severity": 1, | ||
"source": "ts", | ||
"tags": [] | ||
} | ||
] |
1 change: 1 addition & 0 deletions
1
...age-server/test/plugins/typescript/features/diagnostics/fixtures/bindings/expectedv2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
25 changes: 25 additions & 0 deletions
25
...nguage-server/test/plugins/typescript/features/diagnostics/fixtures/bindings/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script lang="ts"> | ||
import Legacy from './Legacy.svelte'; | ||
import Runes from './Runes.svelte'; | ||
let bind_and_prop: () => boolean; | ||
let value = ''; | ||
let only_bind: () => boolean; | ||
let can_bind = ''; | ||
let readonly = '' | ||
</script> | ||
|
||
<!-- ok --> | ||
<Legacy bind:bind_and_prop /> | ||
<Legacy bind:value /> | ||
<Legacy {value} /> | ||
<Legacy {bind_and_prop} /> | ||
<Runes bind:can_bind /> | ||
<Runes {can_bind} /> | ||
<Runes {readonly} /> | ||
<Runes bind:only_bind /> | ||
|
||
<!-- error in Svelte 5 --> | ||
<Runes bind:readonly /> | ||
<Runes {only_bind} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters