Open midnightveil opened 1 day ago
Thanks, this seems like a valid request.
Please be aware though that we currently don’t do any analysis on JsDoc comments, so this is unlikely to be picked up soon unless someone wishes to contribute such support.
As a workaround, I would suggest moving the import itself into a comment as well. I believe tsc
supports some syntax to do this.
Environment information
Rule name
lint/correctness/noUnusedImports
Playground link
https://biomejs.dev/playground/?indentStyle=space&lintRules=all&files.main.js=aQBtAHAAbwByAHQAIAB7AFMAbwBtAGUAQwBsAGEAcwBzAH0AIABmAHIAbwBtACAAIgAuAC8AbwB0AGgAZQByAGYAaQBsAGUALgBqAHMAIgA7AAoACgAvACoAKgAKACAAKgAgAEAAcABhAHIAYQBtACAAewBTAG8AbQBlAEMAbABhAHMAcwB9ACAAYQAKACAAKgAvAAoAZQB4AHAAbwByAHQAIABmAHUAbgBjAHQAaQBvAG4AIAB4ACgAYQApACAAewAKACAAIAByAGUAdAB1AHIAbgAgAGEALgBiACAAKwAgADUAOwAKAH0A
Expected result
As the import is referenced in the JSDoc, it should not be flagged as an unused import.
Removing this import causes
tsc
to complain (rightfully) that it doesn't know what type this is. (tsc
checking JS files). This happens a lot when you are passing a certain type to a function, but never need to create it. You never explicitly reference the typename but access its properties.Code of Conduct