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

Unstable comment of last argument of a method #905

Closed
vjeux opened this issue Mar 6, 2017 · 0 comments
Closed

Unstable comment of last argument of a method #905

vjeux opened this issue Mar 6, 2017 · 0 comments
Labels
area:comments Issues with how Prettier prints comments locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program

Comments

@vjeux
Copy link
Contributor

vjeux commented Mar 6, 2017

#856 fixed it for functions and types but not for methods.

class X {
  f(
    currentRequest: {a: number},
    // TODO this is a very very very very long comment that makes it go > 80 columns
  ) {}
}

outputs

class X {
  f(
    currentRequest: { a: number }
  ) // TODO this is a very very very very long comment that makes it go > 80 columns
  {
  }
}

which ouputs

class X {
  f(
    currentRequest: { a: number } // TODO this is a very very very very long comment that makes it go > 80 columns
  ) {}
}

https://prettier.github.io/prettier/#%7B%22content%22%3A%22class%20X%20%7B%5Cn%20%20f(%5Cn%20%20%20%20currentRequest%3A%20%7Ba%3A%20number%7D%2C%5Cn%20%20%20%20%2F%2F%20TODO%20this%20is%20a%20very%20very%20very%20very%20long%20comment%20that%20makes%20it%20go%20%3E%2080%20columns%5Cn%20%20)%20%7B%7D%5Cn%7D%5Cn%5Cnclass%20X%20%7B%5Cn%20%20f(%5Cn%20%20%20%20currentRequest%3A%20%7B%20a%3A%20number%20%7D%5Cn%20%20)%20%2F%2F%20TODO%20this%20is%20a%20very%20very%20very%20very%20long%20comment%20that%20makes%20it%20go%20%3E%2080%20columns%5Cn%20%20%7B%5Cn%20%20%7D%5Cn%7D%5Cn%5Cn%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3A%22%22%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22parser%22%3A%22%22%2C%22doc%22%3Afalse%7D%7D

@vjeux vjeux added the type:bug Issues identifying ugly output, or a defect in the program label Mar 6, 2017
@rattrayalex rattrayalex added the area:comments Issues with how Prettier prints comments label Mar 7, 2017
vjeux added a commit to vjeux/prettier that referenced this issue Mar 16, 2017
In prettier#856, it handled a bunch of cases but missed class methods

Fixes prettier#905
jlongster pushed a commit that referenced this issue Mar 17, 2017
In #856, it handled a bunch of cases but missed class methods

Fixes #905
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 8, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:comments Issues with how Prettier prints comments locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

2 participants