Closed ishowshao closed 5 years ago
Huh! This is pretty bad. I'll take a stab at fixing this for the v2 release.
So one possible fix is to make --pretty
mode (which deletes the type syntax and doesn't leave whitespace) mandatory, and bring in source-map-support
as part of flow-node
to keep stack traces in sync with the source code. It's a bit heavy-handed, but would work.
The alternative is to essentially move the arrow to the start of the stretch of whitespace. I'll see if I can make that work in an efficient way.
We've just published v2.99.0 of both flow-remove-types
and flow-node
, which should resolve this issue. Future releases will be aligned with Flow releases (e.g. v2.99.0 ↔ Flow 0.99.0) and will always use the latest version of the Flow parser for maximum compatibility.
The code has now moved to the main Flow repo, and this separate repo will be archived soon; please use the Flow issue tracker for any further discussion.
removed:
because:
An arrow function cannot contain a line break between its parameters and its arrow.