From 20e26e102f79dd3735a67044b63d136b4714c044 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 6 Sep 2022 11:55:11 +0300 Subject: [PATCH] Fix leading comments in mapped types with `readonly` (#13427) --- changelog_unreleased/typescript/13427.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 changelog_unreleased/typescript/13427.md diff --git a/changelog_unreleased/typescript/13427.md b/changelog_unreleased/typescript/13427.md new file mode 100644 index 000000000000..96f9b91da401 --- /dev/null +++ b/changelog_unreleased/typescript/13427.md @@ -0,0 +1,22 @@ +#### Fix leading comments in mapped types with `readonly` (#13427 by @thorn0, @sosukesuzuki) + + +```tsx +// Input +type Type = { + // comment + readonly [key in Foo]; +}; + +// Prettier stable +type Type = { + readonly // comment + [key in Foo]; +}; + +// Prettier main +type Type = { + // comment + readonly [key in Foo]; +}; +```