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.

Svelte for VS Code v102.5.0 / svelte-check 1.1.09 Breaks TS support in .svelte files when style tag present below

See original GitHub issue

Describe the bug Imports and markup-interop type-hints break in .svelte files for version 102.5.0.

  • Hovering over js variables in markup (e.g. <div>{obj.value}</div>) provides no type hints.
  • No property suggestions when trying to autocomplete in markup.
  • False positives with ts errors in <script lang="ts">.
  • False positives with component import errors (in some cases).

Reverting back to v102.4.0 fixes these issues: code --install-extension svelte.svelte-vscode@102.4.0.

To Reproduce Install svelte.svelte-vscode@102.5.0. Compare to svelte.svelte-vscode@102.4.0.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

  • No property suggestions when trying to autocomplete: image
  • False positives with ts errors: image
  • False positives with component imports (in some cases): image

System (please complete the following information):

  • OS: Windows
  • IDE: VSCode 1.50.1, x64
  • Plugin/Package: Svelte for VSCode

Additional context To be clear, my app runs as expected, it looks to be entirely a tooling issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
dummdidummcommented, Nov 6, 2020

This should be fixed with Svelte for VS Code 102.5.1 / svelte-check 1.1.10

2reactions
dimfeldcommented, Nov 5, 2020

Looks like a PR just came in but in case it still helps, here’s the smallest example I could get to reproduce reliably:

<script context="module" lang="typescript">
  class Control {
    el: string;
  }
</script>

<script lang="typescript">
</script>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Svelte for VS Code - Visual Studio Marketplace
Svelte for VS Code. Provides syntax highlighting and rich intellisense for Svelte components in VS Code, using the svelte language server.
Read more >
TypeScript support in Svelte - Learn web development
Objective: Learn how to configure and use TypeScript when developing Svelte applications.
Read more >
Typescript mysteriously won't lint in VSCode with a large ts ...
The solution would be to break your 3,000 line giga-file into a number of smaller files, at which point code hinting should work...
Read more >
Using vanilla-extract with SvelteKit: Styles with TypeScript
You can create your style in TypeScript files which sit alongside your Svelte code and import the styles, adding them as classes to...
Read more >
svelte-preprocess
Svelte Preprocess. A Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, CoffeeScript, TypeScript, Pug and much more.
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