Skip to content

linter: false positive in unicorn/no-useless-spread #4872

@camc314

Description

@camc314

the following code proiduces an error on the ...

const test2 = [...new Set(test || [])];

https://oxc-project.github.io/oxc/playground/?code=3YCAAICogICAgICAgICxG0qZRraXVswdRc9QqqX01RSLQj6CIL60mOY7cTm3PXoTnCmrrStudD9%2FdpNkgA%3D%3D

this is incorrect as new Set() returns a Set where as [...new Set(test || [])] returns an array.

looks like this regressed in #4791 ?

Metadata

Metadata

Assignees

Labels

A-linterArea - LinterC-bugCategory - Bug

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions