reason-cli icon indicating copy to clipboard operation
reason-cli copied to clipboard

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

Open johnhaley81 opened this issue 7 years ago • 0 comments

👋

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

johnhaley81 avatar Oct 26 '18 16:10 johnhaley81