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
{{ message }}
Repository navigation
Refactoring suggtion: convert to namespace import #24044
Yes managing this automatically would also be nice. However a refactor that I can trigger would also be useful, as there are some module that I always want to use namespace imports for. I originally opened this issue because I noticed myself converting a lot of imports like:
import{red,greenblue}from'vs/colors';
to:
import*ascolorsfrom'vs/colors'
Even when only a single value is used from vs/colors, I prefer using the namespace for this module
If you only provide this refactor and not the reverse one (* to named import) then people might think TypeScript is promoting this kind of imports. Make sure you want to do that or provide the reverse transformation.
In my experience developing typescript refactors, non named imports like the one you are suggesting could make it harder to navigate the AST for global refactors when you have to refactor imports / exports globally (think for example on refactors like move class to other file, move method to other class/interface, etc)
Activity
mjbvz commentedon May 11, 2018
Yes managing this automatically would also be nice. However a refactor that I can trigger would also be useful, as there are some module that I always want to use namespace imports for. I originally opened this issue because I noticed myself converting a lot of imports like:
to:
Even when only a single value is used from
vs/colors, I prefer using the namespace for this moduleDanielRosenwasser commentedon May 17, 2018
Looks like a duplicate of #19260
cancerberoSgx commentedon May 21, 2018
My humble opinion / question:
My two cents