mirror of https://github.com/sveltejs/svelte
fix: prevent false positive store error in module script (#10291)
When a variable with the same name was declared in the instance script, the module-no-auto-store-subscription-validation would fail fixes #10285pull/10299/head
parent
107ec1c848
commit
005ff894ff
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: prevent false positive store error in module script
|
@ -1,6 +1,13 @@
|
||||
<script context="module">
|
||||
// this should be fine (state rune is not treated as a store)
|
||||
const state = $state(0);
|
||||
// this is not
|
||||
const foo = {};
|
||||
const answer = $foo;
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let state;
|
||||
</script>
|
||||
|
||||
<p>{answer}</p>
|
Loading…
Reference in new issue