Closed
Description
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: