Having compilerOptions
in svelte.config.js
leads to '$state' is not defined
#849
Closed
2 tasks done
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
9.10.0
What version of
eslint-plugin-svelte
are you using?2.43.0
What did you do?
Configuration
I ran
pnpm eslint .
, this should run eslint on the project. However it threw lots of:What did you expect to happen?
It should work when having an empty
compilerOptions
object specified.What actually happened?
After hours of upgrading/changing versions trying to resolve the issue - At some point I noticed that I had an empty
compilerOptions
object insidesvelte.config.js
:❗❗❗ After removing
compilerOptions
entirely (OR force-settingsrunes: true
) thenpnpm eslint .
did not raise'$state' is not defined
no more.It seems like eslint thinks
runes: false
whenever acompilerOptions
exists, even when not specifyingrunes
.I believe that an empty
compilerOptions
object should be treated like an undefined one.Link to GitHub Repo with Minimal Reproducible Example
https://github.com/timephy/eslint-plugin-svelte-runes-bug
Additional comments
This is a very unpredictable and confuses the user immensely...
The fact that using the same name for the variable fixes the issue is absolutely stunning.
The text was updated successfully, but these errors were encountered: