Skip to content

False positives for legacy syntax reactive comma-separated statement #2973

@sirkostya009

Description

@sirkostya009

Describe the bug

Running svelte-check with --incremental or --tsgo prints errors for comma-separated reactive statements ($:) that have a custom store or a reactive value (or a prop) in it.

Reproduction

Run svelte-check in a codebase with a component like:

<script lang="ts">
	import { page } from "$app/stores";
	import { onMount } from "svelte";
	import { writable } from "svelte/store";

	export let prop: string;

	let button: HTMLButtonElement;

	let count = 0;
	let store = writable(0);

	$: button, prop, count, console.log("button:", button);
	$: $page.form, count, console.log("count:", count); // weirdly enough doesnt report when i have $page
</script>

<button onclick={() => count++} bind:this={button}>button</button>

Expected behaviour

No errors are returned

System Info

  • OS: Linux
  • IDE: VSCode

Which package is the issue about?

svelte-check

Metadata

Metadata

Assignees

No one assigned

    Labels

    BlockedCannot proceed until something else is resolvedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions