microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
98.27k stars 12.21k forks source link

isolatedDeclarations wrongly enabled in VSCode #58328

Closed Jack-Works closed 2 weeks ago

Jack-Works commented 2 weeks ago

🔎 Search Terms

isolatedDeclaration

🕗 Version & Regression Information

5.5.0-beta

⏯ Playground Link

https://github.com/Jack-Works/reproduce/tree/main/typescript-5.5-isolatedDeclarations-vscode

💻 Code

git clone https://github.com/Jack-Works/reproduce/ --filter=blob:none
cd typescript-5.5-isolatedDeclarations-vscode
code . # start vscode at the current directory

Open b/index.ts in the editor. (you must not open a/index.ts otherwise the error won't appear)

🙁 Actual behavior

img

But A does not have isolatedDeclarations enabled.

图片

If you open a/index.ts, the error is gone, and if you close it, the error appears again.

🙂 Expected behavior

Works

Additional information about the issue

No response

RyanCavanaugh commented 2 weeks ago

Requires this setting to be on image

RyanCavanaugh commented 2 weeks ago

@sheetalkamat what's the logic that usually prevents this from happening (settings in the referring project being wrongly applied to the imported file) ?

sheetalkamat commented 2 weeks ago

Its a bug. We skip semantic diagnostics for these kind of files from referenced project, we should also skip emit diagnostics.