sveltejs / eslint-plugin-svelte

ESLint plugin for Svelte using AST
https://sveltejs.github.io/eslint-plugin-svelte/
MIT License
276 stars 30 forks source link

Svelte 5 - "illegal variable name" when using stores #746

Closed rChaoz closed 2 months ago

rChaoz commented 2 months ago

Before You File a Bug Report Please Confirm You Have Done The Following...

What version of ESLint are you using?

8.57.0

What version of eslint-plugin-svelte are you using?

2.38.0

What did you do?

<script>
    import { page } from "$app/stores"
    const something = $page
</script>

What did you expect to happen?

No errors.

What actually happened?

  6:34  error  `$page` is an illegal variable name. To reference a global variable called `$page`, use `globalThis.$page`(global_reference_invalid)  svelte/valid-compile

Link to GitHub Repo with Minimal Reproducible Example

-

Additional comments

This happens for all stores in .svelte files. I haven't checked but the same issue might happen in .svelte.[ts|js] files.

ota-meshi commented 2 months ago

Duplicate of #652