-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Milestone
Description
Describe the feature
Currently code like the following:
/** Test */
function test() {}
/** Test */
export class Test {
/**
* Multi-line
*/
method() {}
}
Will emit with comments like so:
/** Test */ function test() {}
/** Test */ export class Test {
/**
* Multi-line
*/ method() {}
}
I'm emitting some typescript declarations using swc where only the jsdoc comments are preserved and the output doesn't look great because of this (I'd rather avoid doing post-processing on it, but it's not a big deal if I have to do that)
What are your thoughts on making swc do this? For a fast implementation, perhaps it should only do it for block comments that start with *
and preceed declarations?
Both Babel and TypeScript keep the jsdoc on the previous line, but will also keep it on the same line if the person has the code that way.
Babel plugin or link to the feature description
No response
Additional context
No response