reasonml / reason

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
http://reasonml.github.io
MIT License
10.15k stars 428 forks source link

Comment interleaving wrong before JSX #2029

Open chenglou opened 6 years ago

chenglou commented 6 years ago
{
  /* foo */
  <div className />;
}

refmt as:

<div
  className
  /* foo */
/>;
jchavarri commented 1 year ago

the following code:

let t =
  <Parent>
    // a
    React.null
    // b
    <ElementThatNeedsComment />
    // c
  </Parent>;

gets refmt'd into:

let t =
  <Parent>

      React.null
      // b
      <ElementThatNeedsComment />
    </Parent>;
    // c
    // a