4
spacem
6y

Visual studio code has this feature where it will automatically add typescript import statements. It doesn't work properly for me on this angular project.
eg. I get this:
import { Output } from '@angular/core/src/metadata/directives';
instead of this:
import { Output } from '@angular/core';

After a few weeks of being annoyed at this I tried to search to see if there was a fix. Surely others must use vscode+angular? Anyway I found this issue and it is set to fixed in typescript 2.5:
https://github.com/Microsoft/...

So I check and I am using typescript 2.4. I read that angular has issues if you use an unsupported version of typescript but I cant find anywhere that actually says the versions that are supported. I try npm install typescript@latest anyway and sure enough angular-cli spits out some error. The error says to run npm install typescript@'>=2.1.0 <2.6.0'

That command doesnt work! maybe something about those quotes in windows command prompt but I manage to run it with double quotes npm install "typescript@>=2.1.0 <2.6.0" and now I have typescript 2.5.

I try out the auto import but it still doesn't work.

Comments
Add Comment