VSCode 1.38.0
TypeScript 3.6.3
Test drive the import/export space of TS and VSCode workflow support.
As expected. The identifier nameused matches how the variable was defined in the source module. Example below makes this clear.
Multiple auto-import hints. User can differentiate by going over each option and seeing the from
differences. Does not import qualified. As a user, working with generic names intended to work by namespace, this is probable not what you want. Namespaced auto-import is an open issue on TS repo.
VSCode presents two auto-complete hints. Selecting either produces same result: Import of the default export. Default export seems to shadow named one. Two hint given suggets VSCode is aware of the duality, but fumbles thereafter.
Slightly buggy. Presumably non-issue in near future. OK if named import is not common case.
-
Sebastian Markbåge has stated (cannot find tweet link) that default exports were probably a language mistake, driven mostly by wide spread use of the pattern in Node/CommonJS]
-
(2019) Nicholas C. Zakas Against Defaults (long detailed article)
There is a factual mistake in this article:
This type of functionality isn’t possible when using default exports because there is no canonical name for things you want to import.
It is, as we saw above.