mirror of https://github.com/sveltejs/svelte
feat: better compiler warnings for non-reactive dependencies of reactive statements (#12824)
* feat: better compiler warnings for non-reactive dependencies of reactive statements * fix * regeneratepull/12846/head
parent
0a06a3f2b6
commit
57a4b5d19c
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
feat: better compiler warnings for non-reactive dependencies of reactive statements
|
@ -1,6 +1,11 @@
|
||||
<script context="module">
|
||||
let foo;
|
||||
let foo = 0;
|
||||
|
||||
export function update() {
|
||||
foo += 1;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$: bar = foo;
|
||||
</script>
|
||||
|
@ -1,14 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "reactive_declaration_module_script",
|
||||
"message": "All dependencies of the reactive declaration are declared in a module script and will not be reactive",
|
||||
"code": "reactive_declaration_module_script_dependency",
|
||||
"message": "Reassignments of module-level declarations will not cause reactive statements to update",
|
||||
"start": {
|
||||
"column": 1,
|
||||
"line": 5
|
||||
"column": 10,
|
||||
"line": 10
|
||||
},
|
||||
"end": {
|
||||
"column": 14,
|
||||
"line": 5
|
||||
"column": 13,
|
||||
"line": 10
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in new issue