Skip to content

Prop bind produces 'variable is declared but its value is never read' #2268

@minht11

Description

@minht11

Describe the bug

Use bind shorthand with the prop, get error 'offsetWidth' is declared but its value is never read.ts(6133)

Reproduction

Run code below in VS code.

<script lang="ts">
	let {
		offsetWidth,
	} = $props<{
		offsetWidth?: number
	}>()
</script>

<div
	bind:offsetWidth
/>

Expected behaviour

No error.

System Info

  • OS: [e.g. Macos]
  • IDE: [e.g. VSCode]

Which package is the issue about?

svelte-language-server

Additional Information, eg. Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions