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
Odd arrow function printing #800
Comments
Likely going to be fixed by #680. Edit, nvm it doesn't |
Honestly I'm not a fan of bumping down contents ever from arrow functions like that. We didn't do that in early version of prettier and I had no idea some people wanted that until they filed bugs. We do it because some people do stuff like func =>
Promise.resolve((resolve, reject) => {
// lots of code
}) But in my opinion they really should just make it a block and use |
By adding a group, we can avoid adding a newline if the expression fits in a single line. Fixes prettier#800
Turns out there's an easy fix for this one: #829 |
By adding a group, we can avoid adding a newline if the expression fits in a single line. Fixes #800
This:
gets turned into this:
in https://github.com/cpojer/jest/blob/master/packages/jest-snapshot/src/index.js
It looks a bit odd.
https://prettier.github.io/prettier/#%7B%22content%22%3A%22const%20initializeSnapshotState%20%3D%20(%5Cn%20%20testFile%3A%20Path%2C%5Cn%20%20update%3A%20boolean%2C%5Cn%20%20testPath%3A%20string%2C%5Cn%20%20expand%3A%20boolean%2C%5Cn)%20%3D%3E%20new%20SnapshotState(testFile%2C%20update%2C%20testPath%2C%20expand)%3B%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3Afalse%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22doc%22%3Afalse%7D%7D
The text was updated successfully, but these errors were encountered: