Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
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.
undefined
angular vscode auto-import