Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting the wrong path when I auto import Typescript class in IntelliJ

If I am in my IntelliJ and I try to command space to auto import an Typescript class I get the full path (import {Http} from "../../../../node_modules/@angular/http/src/http";) when I would expect the shorter on (import {Http} from "@angular/http")

This worked at one point but I can't figure out what setting got rejiggered. Anyone have an idea? I am on 2017.1

like image 557
Jackie Avatar asked Jan 12 '17 16:01

Jackie


1 Answers

In Settings | Editor | Code Style | TypeScript | Imports, try enabling Use paths relative to tsconfig.json. When this checkbox is selected, import paths are calculated relative to the "baseUrl" specified in tsconfig; if this option is omitted, it's considered to be equal to a directory where tsconfig.json is located.

like image 58
oomkoos Avatar answered Oct 26 '22 12:10

oomkoos