Skip to content

@imports marked as unused #58969

@lishaduck

Description

@lishaduck

🔎 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.

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions