💅 Transform a function with generics to arrow function by biome linter will not safe. #3292
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/complexity/useArrowFunction
Playground link
https://biomejs.dev/playground/?code=CgAKAGMAbwBuAHMAdAAgAHcAaQB0AGgARABlAGYAYQB1AGwAdAAgAD0AIABmAHUAbgBjAHQAaQBvAG4AIAA8AFQAPgAoAHYAYQBsAHUAZQA6ACAAVAAsACAAZABlAGYAYQB1AGwAdABWAGEAbAB1AGUAOgAgAFQAKQAgAHsACgAgACAAcgBlAHQAdQByAG4AIAB2AGEAbAB1AGUAIAA%2FAD8AIABkAGUAZgBhAHUAbAB0AFYAYQBsAHUAZQA7AAoAfQA7AAoACgAvAC8AIABjAG8AbgBzAHQAIAB3AGkAdABoAEQAZQBmAGEAdQBsAHQAIAA9ACAAPABUAD4AKAB2AGEAbAB1AGUAOgAgAFQALAAgAGQAZQBmAGEAdQBsAHQAVgBhAGwAdQBlADoAIABUACkAIAA9AD4AIAB2AGEAbAB1AGUAIAA%2FAD8AIABkAGUAZgBhAHUAbAB0AFYAYQBsAHUAZQA7AAoA
Expected result
Hi there, I discovered some weird behavior with Biome linter, so I want to share it.
When I apply to
biome check --write
to this code below (please don't mind that the functions actual doing.)Biome linter suggest (also will be replaced) to this
However, unfortunately it seems probably wrong. And I actually expect to replace like this (
<T,>
)Here is Typescript playground, and you can see how typescript recognize those code.
https://www.typescriptlang.org/play/?#code/FAehAIGMHsDsGcAu4DuBLRALAIgUwGYCGArgDbIC84+xskiac4APACoB8AFAG6GnG4AXOFYAacABMCJcgDU+A4awCU4AN6gI4beABOuRMV2xwvfrnAB+S5OllE88wG5N4AL4vgMBMnRY8RPYAqrC4AB4ADrj0uBLgVGyiXGaKIuJSgXIKQiKqFOym2VY2GTIO2Z7eSKgYOHbkAKKR0Yix8SwcPNlK6fXl5kp5BSkW1raZ-QIuQA
And also this post said what should suggest to.
https://stackoverflow.com/questions/32308370/what-is-the-syntax-for-typescript-arrow-functions-with-generics
Thanks!
Code of Conduct
The text was updated successfully, but these errors were encountered: