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

Print leading comment for readonly modifier of TS Mapped Types #11190

Closed
wants to merge 8 commits into from

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Jul 11, 2021

Description

Fixes #11098

Since TSMappedType contains { and }, it could not be implemented as a simple leading comments.

Checklist

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

Try the playground for this PR

@fisker
Copy link
Sponsor Member

fisker commented Aug 30, 2021

I'm not sure if we want to do this, the current output seems more preferred for me.

Prettier pr-11190
Playground link

--parser babel

Input:

class A {
  static // comment
  foo() {}
  
  get // comment
  foo() {}
  
   // comment
  static
  foo() {}
  
  // comment
  get 
  foo() {}
  
}

Output:

class A {
  static // comment
  foo() {}

  get // comment
  foo() {}

  // comment
  static foo() {}

  // comment
  get foo() {}
}

@thorn0
Copy link
Member

thorn0 commented Sep 7, 2022

superseded by #13427

@thorn0 thorn0 closed this Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment gets wrongly placed after readonly keyword in mapped type
3 participants