Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@imports marked as unused #58969

Open
lishaduck opened this issue Jun 22, 2024 · 1 comment
Open

@imports marked as unused #58969

lishaduck opened this issue Jun 22, 2024 · 1 comment
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@lishaduck
Copy link

πŸ”Ž Search Terms

@import noUnused

πŸ•— Version & Regression Information

  • I was unable to test this on prior versions because it uses @import

⏯ Playground Link

No response

πŸ’» Code

This requires multiple files, so the TS playground won't work. Sorry.

// bar.js
/** @import {foo} from "foo"; */

/**
 * @param baz {foo}
 */
function bar(baz) {}

With this in the TSConfig

"noUnusedLocals": true,
"noUnusedParameters": true,

πŸ™ Actual behavior

Foo is marked as unused.
It's being used in a JSDoc

πŸ™‚ Expected behavior

It shouldn't be marked as unused.

Additional information about the issue

This doesn't appear all the time, usually when there's multiple imports.
The example doesn't actually error, the code erroring got force-pushed away. However, it's the general issue.

I thought it might need a type qualifier, but that doesn't seem to be valid.

@lishaduck lishaduck changed the title @import @imports marked as unused Jun 22, 2024
@lishaduck
Copy link
Author

Oh, I didn't look at PR comments. I think this still needs an issue though: #57207 (comment)

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Jun 24, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.6.0 milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

No branches or pull requests

3 participants