Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS AutoImport deep vs shallow imports #38744

Closed
bradzacher opened this issue Nov 20, 2017 · 1 comment
Closed

TS AutoImport deep vs shallow imports #38744

bradzacher opened this issue Nov 20, 2017 · 1 comment
Assignees
Labels
javascript JavaScript support issues

Comments

@bradzacher
Copy link

I noticed that when doing an autoimport in TS, code seems to prefer deep imports over shallow ones.

I.e. when working with graphql, if you try and import GraphQLString, code places this import import { GraphQLString } from 'graphql/type/scalars'; instead of using the import on the base package import { GraphQLString } from 'graphql';.

It would be good if code could detect this and prefer shallow imports where possible.
Esp with node module imports, because doing a deep import can technically be fragile (i.e. a module author may not intend you to import from one of the modules' internal folders).

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 20, 2017

This issue was moved to microsoft/TypeScript#20160

@mjbvz mjbvz closed this as completed Nov 20, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

2 participants