- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
From @OliverJAsh on September 26, 2018 13:23
- VSCode Version: 10.27.2
- OS Version: macOS 10.13.6
Steps to Reproduce:
- Given a tsconfig.jsonthat has project references, where the referenced TS projects specify a customcompilerOptions.types
- Open a file inside one of the referenced projects
Expected: VSCode should respect compilerOption.types.
Actual: VSCode appears to ignore compilerOption.types.
For example, I have three TS projects:
- tsconfig-src.jsonwhich should not have- jesttypes (- compilerOption.typesis set to- [])
- tsconfig-tests.jsonwhich should have- jesttypes (- compilerOption.typesis set to- ["jest"])
- tsconfig.jsonwhich- referencesboth of the above
The following file is part of the tsconfig-src.json project:
// src/sum.ts
test('foo', () => {})
// Expected: error in VSCode and when running `tsc -b`
// Actual: no error in VSCode, error when running `tsc -b`
export function sum(a: number, b: number) {
  return a + b;
}When I run tsc -b -f tsconfig.json, I get the expected error:
src/sum.ts:3:1 - error TS2304: Cannot find name 'test'.
3 test('foo', () => {})
  ~~~~
(test is a global type provided by the jest types.)
However, VSCode has no error. Instead, the types appear to be available, even when they shouldn't:
You can try this for yourself with the provided full reproduction case.
Copied from original issue: microsoft/vscode#59466
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issue
