You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find it weird that newlines in an object literal is respected even if collapsing is less than printWidth, whilst newlines in an object destructure is not.
I find it weird that newlines in an object literal is respected even if collapsing is less than
printWidth
, whilst newlines in an object destructure is not.Input:
Output:
I would expect them to be treated the same - either both collapse, or both stay expanded.
(Personally I would prefer both to be expanded, combined with #2068 being a thing you'd invoke sometimes)
https://prettier.io/playground/#%7B%22content%22%3A%22const%20someObject%20%3D%20%7B%20one%2C%20two%2C%20three%2C%20four%2C%20five%2C%20six%2C%20seven%20%7D%3B%5Cnconst%20%7B%20one%2C%20two%2C%20three%2C%20four%2C%20five%2C%20six%2C%20seven%20%7D%20%3D%20someObject%3B%5Cn%5Cnconst%20someObject%20%3D%20%7B%5Cn%20%20one%2C%5Cn%20%20two%2C%5Cn%20%20three%2C%5Cn%20%20four%2C%5Cn%20%20five%2C%5Cn%20%20six%2C%5Cn%20%20seven%2C%5Cn%7D%3B%5Cnconst%20%7B%5Cn%20%20one%2C%5Cn%20%20two%2C%5Cn%20%20three%2C%5Cn%20%20four%2C%5Cn%20%20five%2C%5Cn%20%20six%2C%5Cn%20%20seven%5Cn%7D%20%3D%20someObject%3B%5Cn%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3A%22none%22%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22parser%22%3A%22babylon%22%2C%22semi%22%3Atrue%2C%22useTabs%22%3Afalse%2C%22doc%22%3Afalse%2C%22ast%22%3Afalse%7D%7D
The text was updated successfully, but these errors were encountered: