angular-cli: Current tsconfig naming is problematic w.r.t. VSCode (and other IDEs)

OS?

archlinux latest

Versions.

@angular/cli: 1.0.0-rc.0
node: 6.10.0
os: linux x64
@angular/common: 4.0.0-rc.1
@angular/compiler: 4.0.0-rc.1
@angular/core: 4.0.0-rc.1
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 4.0.0-rc.1
@angular/http: 4.0.0-rc.1
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0-rc.1
@angular/platform-browser-dynamic: 4.0.0-rc.1
@angular/router: 4.0.0-rc.1
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 4.0.0-rc.1

Repro steps.

app created with the cli

Mention any other details that might be useful.

It seems that the choice was made to name tsconfigs as:

  • ./src/tsconfig.app.json
  • ./src/tsconfig.spec.json
  • ./e2e/tsconfig.e2e.json

All extending ./tsconfig.json.

The problem with this is well explained in the following tickets of vscode and typescript:

Basically, vscode is expecting a file named tsconfig.json in a given directory (and multiple can be used, but in different directories).

Currently what happens with angular-cli, is that only the parent tsconfig.json is used by vscode, and thus libraries are missing because only declared in tsconfig.app.json (or one of the others).

It would make sense to at least rename ./e2e/tsconfig.e2e.json to ./e2e/tsconfig.json and ./src/tsconfig.app.json to ./src/tsconfig.json. Or maybe it is possible to tell vscode this but I didn’t find how…

And then, I think we are blocked for now concerning the specs files since they are in the same directory as the app files. In the above issues, Microsoft people recommend to have two directory, one for the tests and one for the application.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

Sorry i was referred here from another thread and got a bit mixed up. You’re right the tsconfig modification alone will fix the IDE errors