mirror of https://github.com/sveltejs/svelte
parent
10fdca7d70
commit
23265f1fca
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: keep comments in `<script module>` from applying to the instance script
|
||||
@ -0,0 +1,11 @@
|
||||
<script module>
|
||||
// svelte-ignore state_referenced_locally
|
||||
export const answer = 42;
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let count = $state(0),
|
||||
doubled = count * 2;
|
||||
</script>
|
||||
|
||||
{doubled}
|
||||
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "state_referenced_locally",
|
||||
"message": "This reference only captures the initial value of `count`. Did you mean to reference it inside a closure instead?",
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 8,
|
||||
"column": 17
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in new issue