Skip to content

@imports marked as unusedΒ #58969

Closed as not planned
Closed as not planned
@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