question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Current tsconfig naming is problematic w.r.t. VSCode (and other IDEs)

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Juansasacommented, Mar 3, 2017

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

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript Programming with Visual Studio Code
VS Code provides IntelliSense for individual TypeScript files as well as TypeScript tsconfig.json projects. Hover information. Hover over a TypeScript symbol to ...
Read more >
How to use multiple tsconfig files in vs-code? - Stack Overflow
The problem is that I want the shared directory to be included in both projects.
Read more >
Problems with TypeScript - Hacker News
Isn't that the overt main point of TS, hence the name? ... Do you have the same problem with "auto" in other languages?...
Read more >
How To Work With TypeScript in Visual Studio Code
superset - TypeScript adds some additional features on top of JavaScript. All valid JavaScript is valid TypeScript, but not the other way around ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found