Steps to reproduce
Compile the following .js file with --declaration:
class C {
/** @typedef {string} Foo */
/** @type {Foo} */
foo = "abc"
}
Behavior with typescript@5.8
Generates this .d.ts file:
declare class C {
/** @typedef {string} Foo */
/** @type {Foo} */
foo: string;
}
type Foo = string;
Behavior with tsgo
Generates this invalid .d.ts file:
declare class C {
type Foo = string;
/** @typedef {string} Foo */
/** @type {Foo} */
foo: Foo;
}