Skip to content

jsdoc comment in union type isn't being aligned #18787

@Dunqing

Description

@Dunqing

Prettier 3.8.1
Playground link

--parser babel-ts

Input:

This is a prettier test case at

type A1 = | /**
* octahedralRhinocerosTransformer
*/
a
| (b | c);

type A1 = | /**
              * octahedralRhinocerosTransformer
              */
          a
          | (b | c);

Output:

type A1 =
  | /**
   * octahedralRhinocerosTransformer
   */
  a
  | (b | c);

Expected output:

type A1 =
  | /**
     * octahedralRhinocerosTransformer
     */
    a
  | (b | c);

Why?

Both the JSDoc comment and a should align with the other union type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:union typeslang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions