question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode extension hides errors from non-Svelte projects if Svelte is in parent folder

See original GitHub issue

Describe 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:open
  • Created 10 months ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dummdidummcommented, Dec 20, 2022

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.

0reactions
probablykaspercommented, Dec 20, 2022

Are you sure it would cause errors if the parent folder specifies libdom in the tsconfig?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · sveltejs/language-tools - GitHub
The Svelte Language Server, and official extensions which use it - Issues ... VSCode extension hides errors from non-Svelte projects if Svelte is...
Read more >
Docs • Svelte
The Svelte team maintains a VS Code extension and there are integrations with various other editors and tools as well. If you're having...
Read more >
Svelte for VS Code - Visual Studio Marketplace
Provides syntax highlighting and rich intellisense for Svelte components in VS Code, using the svelte language server. Setup. If you added "files.associations": ...
Read more >
Svelte Tutorial and Projects Course | John Smilga - Skillshare
Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work...
Read more >
TypeScript support in Svelte - Learn web development
In this article we took our to-do list application and ported it to TypeScript.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found