Skip to content

Doesn't seem to understand destructuring inside a reactive statement #172

Closed
@tivac

Description

@tivac
$: ({ foo } = bar);

is totally valid & functional in svelte reactive statements. We use it heavily for pulling single fields off of object stores to limit the amount of redrawing we do.

Here's an example of it running in the svelte REPL:

https://svelte.dev/repl/ccaace4f16ca4ea2a77616192ab99e1a?version=3.48.0

But when I run this parser with the base ESLint no-undef rule applied it yells at me about the destructured variables not existing.

https://ota-meshi.github.io/svelte-eslint-parser/playground/#eJyrVkrOT0lVslKyKU4uyiwosYvJU1BIzs8rLlFISixSsFWoVkjLz1ewUohRAtIxSgq11jF5IDUqVgoaELlaoCqgWk2ghI0+3JSYvGqgZK1SLQADrB+9

image
image

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