zxbodya / flowts

utility script to convert project from flow to typescript
77 stars 11 forks source link

Recast doesn't stop it from messing with this comment #9

Open nickretallack opened 4 years ago

nickretallack commented 4 years ago

Input:

// @flow
(a, b) =>
  // comment
  x

Output with --no-prettier, with or without recast:

(a, b) => // comment
x;

It didn't need to change that. I was hoping recast would stop babel-plugin-flow-to-typescript from messing with this line.

If you let it run prettier, it gets worse:

(
  a,
  b, // comment
) => x;
nickretallack commented 4 years ago

I filed an issue on prettier for its role in this as well.