Skip to content

Warning 6133 ignores @link tagsΒ #47558

Closed
@DanielSWolf

Description

@DanielSWolf

Bug Report

πŸ”Ž Search Terms

  • "@link"
  • is declared but its value is never read. (6133)

πŸ•— Version & Regression Information

  • This changed between versions 4.2.3 and 4.3. The problem concerns the @link tag, which was introduced in version 4.3.

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

// @filename: wheel.ts

import type { Car } from './car';

/** A wheel for use with a {@link Car}. */
export interface Wheel {
  // ...
}

// @filename: car.ts

export interface Car {
  // ...
}

πŸ™ Actual behavior

The line import type { Car } from './car'; has the following compiler warning:

'Car' is declared but its value is never read. (6133)

πŸ™‚ Expected behavior

There should be no compiler warning for the type import. The purpose of this warning is to indicate superfluous imports, and this type import isn't superfluous: It is required for the @link tag to work property.

Without the type import, TypeScript could not resolve the target of the link. As a result, the tooltip in VS code would contain the Car reference in plain text rather than as a link.

Compare the following screenshots:

With type import:

Without type import:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions