Skip to content

svelte-check and LSP error on bind:clientWidth with transform syntax #15482

@midzelis

Description

@midzelis

Describe the bug

Using this syntax causes a syntax error in svelte-check and the LSP:

Object literal may only specify known properties, and '"bind:clientWidth"' does not exist in type 'HTMLProps<"section", HTMLAttributes<any>>'.ts(2353)

Reproduction

<div bind:clientWidth={null, (v) => ((myModel.viewportWidth = v), myFn())}

Logs

System Info

System:
    OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 21.70 GB / 30.27 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 22.14.0 - ~/.volta/tools/image/node/22.14.0/bin/node
    npm: 10.9.2 - ~/.volta/tools/image/node/22.14.0/bin/npm
  npmPackages:
    svelte: ^5.17.4 => 5.20.5

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions