Hacker News new | ask | show | jobs
by gopher_protocol 3446 days ago
I've found another issue where it just removes comments entirely inside an otherwise empty block.

    function doSomething() : int {
      return myPromise
      .then(() => {
        // ...do thing
        /* what */
      })
      .catch(() => {
        // ..do other thing
        /* the heck */
      });
    }
becomes

    function doSomething(): int {
      return myPromise
        .then(() => {})
        .catch(() => {});
    }
Still a very nice pretty printer, though.
1 comments

I used Recast on a codebase at work to migrate to a new code style, and I ran into a long tail of issues with preserving comments that looked like they would require some significant work to fix. I know the author of Recast (Hi Ben) and corresponded with him a little bit about it at the time.