💅 noRedeclare
false positive when function overloading with destructured objects
#2608
Closed
1 task done
Labels
A-Linter
Area: linter
L-JavaScript
Language: JavaScript and super languages
S-Bug-confirmed
Status: report has been confirmed as a valid bug
Environment information
Rule name
lint/suspicious/noRedeclare
Playground link
https://biomejs.dev/playground/?code=dAB5AHAAZQAgAFgAIAA9ACAAewAKAAkAKABlADoAIAAiAGMAaABhAG4AZwBlAC0AawBpAG4AZAAiACwAIAB7ACAAawBpAG4AZAAgAH0AOgAgAHsAIABrAGkAbgBkADoAIAAiAGEAIgAgAH0AKQA6ACAAdgBvAGkAZAA7AAoACQAoAGUAOgAgACIAYwBoAGEAbgBnAGUALQBrAGkAbgBkACIALAAgAHsAIABrAGkAbgBkACwAIABlAHgAdAByAGEAIAB9ADoAIAB7ACAAawBpAG4AZAA6ACAAIgBiACIAOwAgAGUAeAB0AHIAYQA6ACAAbgB1AG0AYgBlAHIAIAB9ACkAOgAgAHYAbwBpAGQAOwAKAH0AOwAKAAoAbABlAHQAIAB4ADoAIABYADsACgAKAHgAKAAiAGMAaABhAG4AZwBlAC0AawBpAG4AZAAiACwAIAB7ACAAawBpAG4AZAA6ACAAIgBhACIAIAB9ACkAOwAKAAoAeAAoACIAYwBoAGEAbgBnAGUALQBrAGkAbgBkACIALAAgAHsAIABrAGkAbgBkADoAIAAiAGIAIgAsACAAZQB4AHQAcgBhADoAIAAxACAAfQApADsACgA%3D
Expected result
The rule should not be triggered when writing function overload definitions since it is a type, not actual code.
The playground and the original code that triggered it is not completely equal, since it was a generic function input in a Vue component (as seen below).
As far as I am aware it should not be triggered in either case, but it definitely shouldn't in the Vue snippet.
Code of Conduct
The text was updated successfully, but these errors were encountered: