-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
π Search Terms
βimportβ
π Version & Regression Information
- This changed between versions 5.4 and 5.5
- I was unable to test this on prior versions because this feature was introduced in TypeScript 5.5
β― Playground Link
https://github.com/remcohaszing/typescript-jsdoc-import-bug
π» Code
/**
* @import {
* Program
* } from 'estree'
*/
/**
* @param {Program} program
*/
export function compile(program) {}
π Actual behavior
TypeScript emits the following type invalid definition:
/**
* @import {
* Program
* } from 'estree'
*/
/**
* @param {Program} program
*/
export function compile(program: * Program): void;
import type { Program } from 'estree';
π Expected behavior
TypeScript emits the following valid type definition:
/**
* @import {
* Program
* } from 'estree'
*/
/**
* @param {Program} program
*/
export function compile(program: Program): void;
import type { Program } from 'estree';
Additional information about the issue
This bug does not appear in the playground, only when running tsc
locally.
ExE-Boss
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyFix AvailableA PR has been opened for this issueA PR has been opened for this issue