reasonml / reason-cli

Globally installable Reason toolchain.
MIT License
291 stars 23 forks source link

Fastpipe operations in JSX are modified to invalid code after run through refmt #91

Open johnhaley81 opened 5 years ago

johnhaley81 commented 5 years ago

👋

I'm hitting an issue with refmt turning valid code into invalid code in a JSX block.

let component = ReasonReact.statelessComponent("RefmtBug");

let getLiComponent = str => <li> str->ReasonReact.string </li>;

let make = (~strings, _children) => {
  ...component,
  render: _ =>
    <div>
      <ul>
        strings
        ->Belt.List.map(getLiComponent)
        ->Belt.List.toArray
        ->ReasonReact.array
      </ul>
    </div>,
};

The above snippet is valid code but after a run through refmt it's invalid.

> refmt --version
Reason 3.3.3 @ fefe5e4d

Switching from -> to |> is the only way I know how to fix it