You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
Should be working correctly in latest drop of TypeSript (typescript@next). VSCode ships with an older version of TypeScript. Please see Using Newer TypeScript Versions documentation for more details on updating your VSCode to use a different version of TypeScript.
From @bradzacher on November 20, 2017 4:12
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 importGraphQLString
, code places this importimport { GraphQLString } from 'graphql/type/scalars';
instead of using the import on the base packageimport { 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).
Copied from original issue: microsoft/vscode#38744
The text was updated successfully, but these errors were encountered: