mirror of https://github.com/sveltejs/svelte
Fix #6606: warning on reactive use of module const
This generated a warning:
<script context="module">
export const foo = 123;
</script>
<script>
$: console.log(foo);
</script>
while this did not:
<script>
const foo = 123;
$: console.log(foo);
</script>
We don't need a warning to tell us that we will not be reactive to a
variable that isn't going to change anyway; regardless of whether or not
it's in a module.
(Maybe there should be a 'no reactive variable used' warning, but this
also happens in cases where other mutable variables are used; such as a
shared const formatter function, formatting a prop.)
pull/6607/head
parent
4b3151408e
commit
a0534a17c7
Loading…
Reference in new issue