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?

6 comments
Comment actions Permalink
Official comment

Hello Sergei

Please try selecting "ES6-style imports" here ReSharper | Options | Code Editing | TypeScript | Code Style | Aliases | Preferred import statement kind.

Thanks! 

Comment actions Permalink

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
Comment actions Permalink

Thanks. Alexander. As I have mentioned, I have ES6-style imports enabled:

0
Comment actions Permalink

Sergey,

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

Thanks! 

0
Comment actions Permalink

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
Comment actions Permalink

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

0

Please sign in to leave a comment.