Skip to content

no-unused-vars should consider default values in aliased destructuring. #1414

@vicary

Description

@vicary

Lint Name

no-unused-vars

Code Snippet

const { foo, bar: baz = foo } = { foo: 1 }; 

Expected Result

No lint errors

Actual Result

foo is marked as unused variable.

Additional Info

The alias : baz seems to mask the relation of bar = foo.

Version

deno 2.1.9 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions