-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
I was testing the app with a proyect, which has tons of complex types with documented properties, and it seems like unions break the comments, generating invalid syntax.
Minimal reproduction:
type Type = {
/** Hi */
b: 1;
} | {
c: string;
};
New text:
/**
* @typedef {{
* /** Hi */
* b: 1;
* } | {
* c: string;
* }} Type
*/
type Type = {
/** Hi */
b: 1;
} | {
c: string;
};
Worth pointing out, this also breaks with optional (?), such as:
type Type = {
a?: {
/** Hi */
b: 1;
};
};
/**
* @typedef {Object} Type
* @property {{ /** Hi */ b: 1; }} [a]
*/
type Type = {
a?: {
/** Hi */
b: 1;
};
};
I doubt the tsconfig changes anything, but just in case:
{
"include": ["index.ts"],
"compilerOptions": {
"target": "ESNext",
"module": "Preserve",
"moduleResolution": "Bundler",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"isolatedModules": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
Metadata
Metadata
Assignees
Labels
No labels