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

Comment gets wrongly placed after readonly keyword in mapped type #11098

Closed
MichaelDeBoey opened this issue Jun 21, 2021 · 1 comment
Closed
Labels
area:comments Issues with how Prettier prints comments lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@MichaelDeBoey
Copy link
Contributor

Prettier 2.3.0
Playground link

--parser typescript

Input:

type Type = {
  // comment
  readonly [T in number]: OtherType[T];
};

Output:

type Type = {
  readonly // comment
  [T in number]: OtherType[T];
};

Expected behavior:

type Type = {
  // comment
  readonly [T in number]: OtherType[T];
};
@lydell lydell added area:comments Issues with how Prettier prints comments lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) labels Jul 5, 2021
@thorn0 thorn0 changed the title Comment gets wrongly placed after readonly keyword Comment gets wrongly placed after readonly keyword in mapped type Sep 4, 2022
@thorn0
Copy link
Member

thorn0 commented Sep 15, 2022

fixed by #13427

@thorn0 thorn0 closed this as completed Sep 15, 2022
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Nov 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:comments Issues with how Prettier prints comments lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants