Skip to content

Reactive expression hinting $: x, fn() raises TS error #1277

@rixo

Description

@rixo

Describe the bug
Reactive expression hinting raises TS error "Left side of comma operator is unused and has no side effects".

$: x, update()

AFAIK this is very idiomatic Svelte to mean "update when x changes", so this shouldn't be marked as error/warning.

To Reproduce
Paste the following in a .svelte file in VSCode:

<script lang="ts">
  let x: any

  const update = () => {}

  $: x, update()
</script>

x in the reactive expression is marked as error.

Expected behavior
There should be no TS errors for the above snippet.

System (please complete the following information):

  • OS: Ubuntu
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode v105.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions