🐛 useImportType
false positive when identifier shares a name with a TypeScript type
#4640
Open
1 task done
Labels
S-Needs triage
Status: this issue needs to be triaged
Environment information
What happened?
This one's easy to reproduce.
With
useImportType
* enabled, biome treats certain term-level identifiers (such asobject
) as types, even if the identifier is used as a value in that file.Since the
unsafe
flag is opt-in, this has the potential to cause a runtime exception unless it's caught during review / by our CI/CD pipeline.Config:
I believe
useImportType
is turned on by default, so any configuration that doesn't override it is enough to reproduce.Repro:
This is what I wrote:
This is what biome changes it to:
Expected result
It shouldn't add inline type keywords if the identifier is used as a term in that same file.
Code of Conduct
The text was updated successfully, but these errors were encountered: