Skip to content

@ts-expect-error comment is being shifted so it breaks #9812

@amankkg

Description

@amankkg

Prettier 2.2.1
Playground link

--no-bracket-spacing
--parser typescript
--no-semi
--single-quote

Input:

for (const p of ['fullName', 'organ', 'position', 'rank'])
// @ts-expect-error
  form.setValue(`${prefix}.data.${p}`, response[p])

Output:

// @ts-expect-error
for (const p of ['fullName', 'organ', 'position', 'rank'])
  form.setValue(`${prefix}.data.${p}`, response[p])

Expected behavior:
TS comment line is unchanged, only indentation is fixed

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:commentsIssues with how Prettier prints commentslang:javascriptIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions