Galooshi / atom-import-js

Atom plugin for ImportJS
MIT License
36 stars 3 forks source link

Imported custom types are removed erroneously #53

Open dannyb21892 opened 4 years ago

dannyb21892 commented 4 years ago

I have a custom type exported from another file and imported into a service. I set the types of certain variables and function returns in the service, however the "fix all imports" command still removes my imported types. My code is similar to the following:

import { MyType1, MyType2} from './custom-types';

...

getData = (): Observable<MyType1> => {
  let myVariable: MyType2;
...
}

And the import statement is removed despite the types being used in the rest of the code.

trotzig commented 4 years ago

That's not great.

I'm not using typescript myself, so it's unlikely that I'll be looking at fixes for this. I'm happy to review potential fixes though.