This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
🐛 ts/useShorthandArrayType is not taking into consideration the need for parenthesis #3111
Closed
1 task done
Labels
Milestone
Environment information
Running the analyzer from the
main
branch.What happened?
The lint rule ts/useShorthandArrayType is not taking into consideration the need for parenthesis when creating the suggested fix.
Example:
https://play.rome.tools/?code=let+v+%3D+%5B%5D+as+Array%3C%28...args%3A+E%29+%3D%3E+void%3E%3B%0Aconsole.log%28v%29%3B&lineWidth=80&indentStyle=tab"eStyle=double&indentWidth=2&sourceType=module&typescript=true&jsx=false#bABlAHQAIAB2ACAAPQAgAFsAXQAgAGEAcwAgAEEAcgByAGEAeQA8ACgALgAuAC4AYQByAGcAcwA6ACAARQApACAAPQA+ACAAdgBvAGkAZAA+ADsACgBjAG8AbgBzAG8AbABlAC4AbABvAGcAKAB2ACkAOwA=
Suggested fix here is:
Expected result
I was expecting the suggested fix to be
Code of Conduct
The text was updated successfully, but these errors were encountered: