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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With