VSCode extension hides errors from non-Svelte projects if Svelte is in parent folder
See original GitHub issueDescribe the bug
Using the Svelte VSCode plugin with "svelte.enable-ts-plugin": true
hides some errors from non-Svelte projects when Svelte is installed in a parent directory. The plugin seems to cause lib.dom.d.ts
to be globally available, even where it shouldn’t.
I have a Cloudflare Workers project where global types are provided by @cloudflare/workers-types
. With these types, the global Request
type does not have certain properties like cache
, mode
, integrity
and credentials
. If I include one of these properties, tsc
gives me an error - However, no error shows up in VSCode, and in fact intellisense is suggesting these properties.
Reproduction
https://github.com/probablykasper/workers-libdom-bug
Expected behaviour
Properties like Request.cache
should not be available
System Info
- OS: macOS
- IDE: VSCode
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Stupid me, this only relates to the TypeScript plugin, for which we can do sth similar what we do for the ambient module declarations and remove it on the fly. The TypeScript plugin doesn’t care if the content of a Svelte file is all red because those diagnostics never show up in that context.
Are you sure it would cause errors if the parent folder specifies libdom in the tsconfig?