Files
test-repo/changelog_unreleased/javascript/12268.md
T
eb671dd983 2.6 blog post (#12412)
* Generate

* Generate

* Add TS4.6 changelog

* Regenerate

* Add changelog to switch to esbuild

* Add category

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Address review

* Regenerate

* Highlight TS 4.6

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Regenerate

* Update changelog_unreleased/typescript/12390.md

Co-authored-by: Jed Fox <git@jedfox.com>

* Add thanks message for sponsors

* Address review!

* Update cspell.json

* Fix link of Ubie

* Generate

* Add `Thanks to our sponsors!`

* Update cspell

* Address review

* Update changelog_unreleased/blog-post-intro.md

Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>

* Regenerate

* Add `--print-truncate` option

* Address review

* Generate

Co-authored-by: Jed Fox <git@jedfox.com>
Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>
2022-03-16 13:25:48 +09:00

1.1 KiB

Improve printing of comments in type aliases in Flow & TS (#12268 by @duailibe)

For Flow, the comments will now be more aligned to how we print comments in assignments where the right-hand side is an object expression:

// Input
type Props = // comment explaining the props
  {
    isPlaying: boolean
  };

// Prettier stable
// comment explaining the props
type Props = {
  isPlaying: boolean,
};

// Prettier main
type Props =
  // comment explaining the props
  {
    isPlaying: boolean,
  };

This change also fixes an issue where a similarly-placed comment in TypeScript would be moved again after a second formatting operation:

// Input
type Props = // comment explaining the props
  {
    isPlaying: boolean
  };

// Prettier stable
type Props = { // comment explaining the props
  isPlaying: boolean;
};

// Prettier stable (2nd format)
type Props = {
  // comment explaining the props
  isPlaying: boolean;
};

// Prettier main
type Props =
  // comment explaining the props
  {
    isPlaying: boolean,
  };