-
Notifications
You must be signed in to change notification settings - Fork 36.8k
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: any
- OS Version: any
Steps to Reproduce:
Create a root tsconfig that references two other configs with inclusion patterns that don't overlap in applicability, and two corresponding TypeScript files. The configs use type fields, to exclude/include certain types, where the root config explicitly uses no additional types. Some of the types are assumed to be installed as dev dependencies.
- Relevant files and content:
// tsconfig.alice.json
{
"compilerOptions": {
"composite": true,
"types": [
"node"
]
},
"include": [
"*.alice.ts"
]
}// tsconfig.bob.json
{
"compilerOptions": {
"composite": true,
"types": [
"@webgpu/types"
]
},
"include": [
"*.bob.ts"
]
}{
"// package.json": "",
"devDependencies":
{
"@types/node": "*",
"@webgpu/types": "*",
}
}// module.alice.ts
import "node:fs"; // should be ok.
export const gpu = navigator.gpu; // should be marked as an error, but it's not.// module.bob.ts
import "node:fs"; // should be marked as an error, but it's not.
export const gpu = navigator.gpu; // should be ok.-
VSC shows no errors and has type information from ambient types.
-
tsc --build --noEmitreports errors as expected: alice does not have WebGPU types and bob does not have Node.js types.
Which approach should be taken to let the IDE align with the type checker? Enforcing structural patterns due to IDE limitations is not a solution. This is clearly a bug.