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?

1
7 comments
Official 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:

0

Sergey,

Please tick "prefer adding module aliases instead of qualifying" checkbox as well.

Thanks! 

0

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

1
Avatar
Permanently deleted user

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?

0

Peter unfortunately I did't find any solution to solve this problem. I believe it will be fixed

0

Still shows same behaviour.

0

Please sign in to leave a comment.