Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode does not pickup tsconfig.json files in subdirectories #50910

Closed
CoreyCole opened this issue May 31, 2018 · 1 comment
Closed

vscode does not pickup tsconfig.json files in subdirectories #50910

CoreyCole opened this issue May 31, 2018 · 1 comment
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code) typescript Typescript support issues

Comments

@CoreyCole
Copy link

CoreyCole commented May 31, 2018

According to @mjbvz in #4466

[vscode does pick up] tsconfig.json files in subdirectories and treat those subdirectories as individual projects. If you are not seeing the correct behavior around this, please open a new issue and I can take a look

  • VSCode Version: 1.23.1
  • OS Version: OSX 10.13.4

Steps to Reproduce:

  1. clone https://github.com/CoreyCole/tsconfig-bug
  2. open vscode at the root, open another vscode window in the subdirectory tsconfig-bug
    • install node modules in subdirectory
  3. see the root window has red lines in tsconfig-bug/test/app.e2e.spec.ts but in the subdirectory window the typing information is correct

You can see me reproducing the issue

Does this issue occur when all extensions are disabled?: Yes

@mjbvz
Copy link
Contributor

mjbvz commented Jun 1, 2018

This is unrelated to the tsconfig. That file is not part of any tsconfig because you have excluded it with the include and exclude rules.

The issue you are seeing is that we don't load global types (like those used by jest) from node_modules in sub folders by default. You can fix this by adding:

import 'jest'

to the file. Or by making the file part of a real tsconfig that contains:

 "typeAcquisition": {
    "include": [
      "jest"
    ]
  }

@mjbvz mjbvz closed this as completed Jun 1, 2018
@mjbvz mjbvz added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Jun 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code) typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

2 participants