mirror of https://github.com/sveltejs/svelte
fix: don't show `state_referenced_locally` warning on types (#13177)
Add a new visitor to the "strip TS AST" logic. Strictly speaking this results in incorrect ASTs but esrap, our printer, just ignores them at those positions, so we can do that. An alternative would be to adjust zimmerframe to be able to return something to say "delete this node" Fixes #13173pull/13198/head
parent
3808935f51
commit
941f83b5a8
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: don't show `state_referenced_locally` warning on types
|
@ -0,0 +1,6 @@
|
||||
<script lang="ts">
|
||||
let { a }: { a: string } = $state({});
|
||||
let { b }: { b: string } = $derived(a);
|
||||
</script>
|
||||
|
||||
<button onclick={()=>a++}></button>
|
Loading…
Reference in new issue