-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslang:javascriptIssues affecting JSIssues affecting JS
Description
Prettier 2.6.2
Playground link
--parser babel
Input:
const foo = "Bar";
/**
* @template T
* @param {Type} type
* @param {T} value
* @return {Value}
*//**
* @param {Type} type
* @return {Value}
*/
function value(type, value) {
if (arguments.length === 2) {
return new ConcreteValue(type, value);
} else {
return new Value(type);
}
}
Output:
const foo = "Bar";
/**
* @template T
* @param {Type} type
* @param {T} value
* @return {Value}
*/ /**
* @param {Type} type
* @return {Value}
*/
function value(type, value) {
if (arguments.length === 2) {
return new ConcreteValue(type, value);
} else {
return new Value(type);
}
}
Expected behavior:
As reported in #7724, JSDoc function overloads require two comment blocks "nestled" together. When that issue was reported, "nestled" comments would have a blank line inserted between them, breaking the JSDoc parser. That issue was closed via #9672. Now, instead of inserting a blank line, Prettier inserts a single space, turning *//**
into */ /**
. This still breaks the JSDoc parser. The sequence must be exactly *//**
, and it must not be modified by Prettier at all.
/cc @fisker, who wrote the linked PR, and @grassator who reported the previous issue.
Metadata
Metadata
Assignees
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslang:javascriptIssues affecting JSIssues affecting JS