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

[2.7.0] GraphQL: empty lines inside comments unexpectedly removed #13011

Closed
jlowcs opened this issue Jun 14, 2022 · 3 comments · Fixed by #13013
Closed

[2.7.0] GraphQL: empty lines inside comments unexpectedly removed #13011

jlowcs opened this issue Jun 14, 2022 · 3 comments · Fixed by #13013
Labels
lang:graphql Issues affecting GraphQL type:bug Issues identifying ugly output, or a defect in the program

Comments

@jlowcs
Copy link

jlowcs commented Jun 14, 2022

Prettier 2.7.0
Playground link

Input:

const typeDefs = gql`
  type User {
    """
    First line

    Second Line
    """
    value: String
  }
`

Output:

const typeDefs = gql`
  type User {
    """
    First line
    Second Line
    """
    value: String
  }
`

Expected behavior:

Unless I'm mistaken, the empty comment line should not be removed by prettier.

@fisker fisker added type:bug Issues identifying ugly output, or a defect in the program lang:graphql Issues affecting GraphQL labels Jun 14, 2022
@tubbo
Copy link

tubbo commented Jun 14, 2022

We're also seeing this on our project. Last version we were on was v2.6.2, so I think this might be related to #12519

Screen Shot 2022-06-14 at 3 18 17 PM

@chimurai
Copy link
Contributor

Caused by #12608

You can try the fix with the ✨Try the playground for this PR✨-link in #13013 to verify the fix.

Sorry for the inconvenience.

@fisker
Copy link
Sponsor Member

fisker commented Jun 16, 2022

Fixed in v2.7.1 https://github.com/prettier/prettier/releases/tag/2.7.1

Thank you @chimurai

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:graphql Issues affecting GraphQL 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