Closed mjbvz closed 3 years ago
Root cause seems to be that I had the following folder structure:
projects/
node_modules/
typescript/
ts-lib-problem/ # folder I had open
node_modules/
typescript/
However I had explicitly opened just the ts-lib-problem
folder in VS Code so I was really confused as to where the other lib types were coming from
If I understand correctly, this is probably still a bug? Even if you were accidentally resolving to the wrong TypeScript installation, the folder you had opened should be a ConfiguredProject and shouldn’t pull in random lib files, right?
Yes, this behavior is very strange to me.
We already have logic in place to prevent the TSServer from finding tsconfig files outside the project root. Perhaps we should do the same for d.ts
files?
I mean, there has to be some positive reason for a .d.ts
file to get pulled into a program in the first place, and without watching it happen, I can’t think of what that would be in this case.
@mjbvz hmm, I can’t seem to reproduce this. Does it still repro for you?
I can't repo this anymore. Not sure what caused the initial issue
TypeScript Version: 4.2.0-dev.20201211
Search Terms:
Code
index.ts
Object.values
is allowed to be referenced even through thelib
is set to["es5"]
Expected behavior: This should be an error since
Object.values
is not included in thees5
Actual behavior: No error and go to definition opens up
es2017.d.t
Here's my server log
Playground Link:
Related Issues: