Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
amankkg opened this issue Dec 1, 2020 · 2 comments · May be fixed by #9829
Open

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

amankkg opened this issue Dec 1, 2020 · 2 comments · May be fixed by #9829
Labels
area:comments Issues with how Prettier prints comments lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program

Comments

@amankkg
Copy link

amankkg commented Dec 1, 2020

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

@amankkg amankkg changed the title @ts-expect-error comment is moved so it breaks @ts-expect-error comment is being shifted so it breaks Dec 1, 2020
@thorn0 thorn0 added lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program area:comments Issues with how Prettier prints comments labels Dec 1, 2020
@HolgerJeromin
Copy link
Contributor

kind of duplicate of #5411

@fisker
Copy link
Sponsor Member

fisker commented Dec 1, 2021

The comment issues are hard to fix, lets' track them one by one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:comments Issues with how Prettier prints comments lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants