Skip to content

Flow: Print dangling comments for empty inexact object type#7892

Merged
sosukesuzuki merged 4 commits into
prettier:masterfrom
sosukesuzuki:fix-inexact-comment
Mar 31, 2020
Merged

Flow: Print dangling comments for empty inexact object type#7892
sosukesuzuki merged 4 commits into
prettier:masterfrom
sosukesuzuki:fix-inexact-comment

Conversation

@sosukesuzuki

Copy link
Copy Markdown
Contributor

Fixes #7718

The following comments cannot be formatted in this PR:
Input:

type Foo = {
  // comment0
  ...,
  // comment1
};

Output:

type Foo = {
  // comment0
  // comment1
  ...,
};

Expected:

type Foo = {
  // comment0
  ...,
  // comment1
};

It is hard to format this because there was not much information about inexact in the AST. But, since this is an edge case, I don't think this is a problem.

  • I’ve added tests to confirm my change works.
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@prettier prettier deleted a comment from netlify Bot Mar 28, 2020
@sosukesuzuki sosukesuzuki requested a review from thorn0 March 29, 2020 18:04
@sosukesuzuki sosukesuzuki merged commit 0f56b4a into prettier:master Mar 31, 2020
@sosukesuzuki sosukesuzuki deleted the fix-inexact-comment branch March 31, 2020 11:26
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flow] "Comment was not printed" error with explicit inexact objects

3 participants