-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Copy link
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentshelp wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 2.2.1
Playground link
--parser typescriptInput:
type A = (
/** @deprecated */
() => void
);
type B = (
/** @deprecated */
new () => void
);
type C = (
/** @deprecated */
<T>() => void
);
type D = (
/** @deprecated */
new <T>() => void
);Output:
type A = () => /** @deprecated */
void;
type B = new () => /** @deprecated */
void;
type C = /** @deprecated */
<T>() => void;
type D = new /** @deprecated */
<T>() => void;Expected behavior:
Preserve the doc comment in a valid position. The doc comment has to start on a new line to be recognized by TS (playground link).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentshelp wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.