Typescript auto import not using relative path

Answered

Using 2017.1.3. When auto importing types in Typescript,

I expect to get

import {HomeViewModelMapperType} from '../tool/samples/samples.model';

Instead I am getting

import {HomeViewModelMapperType} from 'app/tool/samples/samples.model';

3 comments
Comment actions Permalink
Official comment

Hello 

Please try selecting "Relative file reference style in 'require'" value in "Relative to root folder" combobox here "ReSharper | Options | Code Editing | TypeScript | Code Style" and then specify a root folder here "ReSharper | Options | Code Editing | TypeScript | Generated Code".

Also there is the following ticket about the similar things for tsconfig.json location https://youtrack.jetbrains.com/issue/RSRP-462922.

Thanks! 

Comment actions Permalink

The above change does not work. But in my case there is a baseUrl property on the tsconfig.json, once it is removed, everything is working again.

2
Comment actions Permalink

I filed a new request on YouTrack https://youtrack.jetbrains.com/issue/RSRP-465159 for deeper investigation.

Thanks! 

0

Please sign in to leave a comment.