Visual Studio Code Angular quickfix import stopped working on particular project

871 views Asked by At

I'm working on Angular 7 app and there is a problem with autoimport via QuickFix. User defined class and components works fine but the Angulars (like ViewChild, OnInit etc.) are not :/

On clean project it works (I have angular extension for VS Code).

I've tried to find any configuration differences but to be honest what exactly I'm looking for

I've found that there is no tsConfig linked in Angular.json:

"lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": [
          "tsconfig.app.json"
        ],
        "exclude": []
      }
    }

And fix from here but without success

2

There are 2 answers

0
Orzel94 On BEST ANSWER

Answer: I this situation make sure that your angular dependecies are in you main package.json:

project/package.json -> angular dependecies

not in nested library package.json:

project -> package.json -> lib dependencies -> lib package.json in node-modules -> angular depedencies

0
Gaurav Mazumdar On

SOLUTION FOR THE ISSUE it made a tense conditions for me but the site come up and solved the problem easily .Hope you guys enjoy the struggle .

https://github.com/microsoft/TypeScript/issues/39488