Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings in script tag get quick-fixed in the wrong place #2529

Closed
paoloricciuti opened this issue Oct 9, 2024 · 0 comments
Closed

Warnings in script tag get quick-fixed in the wrong place #2529

paoloricciuti opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@paoloricciuti
Copy link
Member

Describe the bug

If i have code like this

<script lang="ts">
    let count = $state(2);
    let x = count;
    //      ^^^^^ State referenced in its own scope will never update. Did you mean to reference it inside a closure?svelte(state_referenced_locally)
</script>

<div></div>

and i try to quick-fix it it get's quick-fixed like this

<script lang="ts">
    let count = $state(2);
    let x = count;
    //      ^^^^^ State referenced in its own scope will never update. Did you mean to reference it inside a closure?svelte(state_referenced_locally)
</script>

<!-- svelte-ignore state_referenced_locally -->
<div></div>

Reproduction

  1. open VSCode
  2. paste the above code
  3. try to quick fix it

Expected behaviour

<script lang="ts">
    let count = $state(2);
    // svelte-ignore state_referenced_locally
    let x = count;
</script>

<div></div>

System Info

VSCode

Which package is the issue about?

Svelte for VS Code extension, svelte-language-server

Additional Information, eg. Screenshots

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant