Typescript: problem when auto-importing named exports.
Answered
I have ES6-style imports enabled. Whenever I try to import some named export ReSharper decides that I want to import everything from a module. So I get this:
import * as Item from "../Shared/EquipmentIcon/equipmentItem";
instead of this (please watch the screencast below):
import {EquipmentItem} from "../Shared/EquipmentIcon/equipmentItem";
http://g.recordit.co/tmbTySkV1I.gif
Is there a way to fix it?
Please sign in to leave a comment.
Hello Sergei
Please try selecting "ES6-style imports" here ReSharper | Options | Code Editing | TypeScript | Code Style | Aliases | Preferred import statement kind.
Thanks!
Thanks. Alexander. As I have mentioned, I have ES6-style imports enabled:
Sergey,
Please tick "prefer adding module aliases instead of qualifying" checkbox as well.
Thanks!
Thanks, Alexander, but there another problem:
When I try to import an interface from a module with named exports, ReSharper decides to import it with an alias, how can I disable this behaviour?
http://g.recordit.co/yl7bRDTbPA.gif
Sergei Galkin did you manage to solve the interface aliasing issue? I also fined this behavior counter productive. And I can see no reason for it?
Peter unfortunately I did't find any solution to solve this problem. I believe it will be fixed
Still shows same behaviour.