This website requires JavaScript.
Explore
Help
Sign In
vitalif
/
prettier
Watch
1
Star
0
Fork
You've already forked prettier
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
b2cca7eacc
prettier
/
tests
/
flow_union
/
jsfmt.spec.js
2 lines
40 B
JavaScript
Raw
Normal View
History
Unescape
Escape
Inline | null and | void (#1734) TypeScript doesn't have the concept of `?` for nullable options and instead you have to write `| null` and `| void`. This is annoying to have it use the long form, so we're now inlining them. While working on this, I found out a few issues with the way we deal with those: - We only align objects if the parent is a union. This means that if you have `Array<{ object }>`, the object is not aligned properly. The fix is to move the alignment logic to the union, and not the child. - When doing so, it messes up with the comment alignment, so we have to manually handle children comment printing in the union code. It doesn't yet fix #1727 because the hardcoded type names are different, i'll follow up in a PR.
2017-05-26 02:26:40 +03:00
run
_spec
(
_
_dirname
,
null
,
[
"babylon"
]
)
;