Auto-Import icon indicating copy to clipboard operation
Auto-Import copied to clipboard

Duplicate imports

Open OliverJAsh opened this issue 8 years ago • 2 comments

When I have existing imports from ../foo, any auto completions for exports in this module will add another import from ./../foo.

E.g.

import { x } from '../foo';
// after auto importing y…
import { y } from './../foo';

Expected:

// after auto importing y…
import { x, y } from '../foo';

This may be related to #37

OliverJAsh avatar Dec 14 '16 09:12 OliverJAsh

BTW, over on another project there is a library design discussion underway. One topic that has come up is that if a library exports a symbol from only one place, tooling (like this) has no way to import it from the "wrong" place.

kylecordes avatar Jan 11 '18 18:01 kylecordes

For some npm modules I have more than two options:

  • lib/index.js
  • dist/example.js
  • src/path/to/file.js
  • src/index.js

I think even if there was only a unique export from the index, it would still be picked up from lib and dist.

Undistraction avatar Jan 11 '18 18:01 Undistraction