tradeship icon indicating copy to clipboard operation
tradeship copied to clipboard

Erroneously removes used flow types

Open creatorrr opened this issue 6 years ago • 1 comments

Correction: Only value types are removed erroneously. Snippet updated below.

Example input:

import { User } from "./types";

function updateUser(user: User) {   // `User` only used here
  /* do something here */
}

tradeship -w output:

// Removed type import
function updateUser(user: User) {   // `flow` complains about missing type
  /* do something here */
}

creatorrr avatar Nov 23 '18 04:11 creatorrr

Thanks for reporting this @creatorrr! Unfortunately, I don't have time to work on this. If this is something you're interested in fixing, happy to accept a PR here!

karthikv avatar Nov 28 '18 20:11 karthikv