-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Interface $$Events is labeled as unused but necessary for Typescript #843
Comments
Wanted to mention I did try upgrading and same thing. "eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-svelte": "^2.43.0", |
Likely unrelated, but another "unused" thing:
|
I think this is unrelated. The responsibility doesn't fall on this plugin to determine what unused I usually have to set up a set of rules to configure what you are expecting. I followed this configuration. |
Thank you for posting issue. The RFC about |
@justingolden21, since it is a linter warning and not an error with the framework itself, I recommend you disable the // In your eslint config, add the following rule
// ...
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^(_|\\$\\$Props|\\$\\$Events)',
varsIgnorePattern: '^(_|\\$\\$Props|\\$\\$Events)',
caughtErrorsIgnorePattern: '^_'
}
],
// ... Another more "scalable" solution would be: // You can add more patterns on demand here...
const patterns = ['_', '\\$\\$Props', '\\$\\$Events'];
// In your eslint config, add the following rule
// ...
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: `^(${patterns.join('|')})`,
varsIgnorePattern: `^(${patterns.join('|')})`,
caughtErrorsIgnorePattern: '^_'
}
],
// ... The |
Duplicate of #348 I think. Anyway, events are deprecated as of Svelte 5, so maybe it's not worth fixing this? |
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
^8.56.0
What version of
eslint-plugin-svelte
are you using?^2.35.1
What did you do?
Configuration
What did you expect to happen?
This should not be an error since $$Events is necessary for on:change and otherwise I get errors from Typescript and when running
check
:svelte-check --tsconfig ./tsconfig.json
What actually happened?
Toggle.svelte
5:12 error '$$Events' is defined but never used @typescript-eslint/no-unused-vars
Link to GitHub Repo with Minimal Reproducible Example
https://eslint-online-playground.netlify.app/#eNplU8tu2zAQ/JUFEcCX2OrZlY0AbYAUSIsCzS0KEFpc23QoUiUpx4Gqf+/yEdlKDnqQuzOc3R32zNm6wBNvWoULd0TlkS1Z6WorWw+Ka7FbVcy7iq0rDSCb1lgP3ux2CmFrTQOztMjg2ddKK/RQ77F+QQEr2HLlkHbLIpESDy0eIihSinBAWrKwsZFaLDN+1eefIUQU36B6wJNf9bNEMBugWLPrWMVEx7SIcw2WTvfvVby1CD1821MC3h5R+zuqV6GFIZeWuApU2FDUUXEBHzmKAn5hjc5x+wYbrHnnEF6pJ8a+civA7xGejaZCAvszYOAfobd/7qX2IAw6PfPwos0rIbgPDBqpb34vXeCKIlMhIxidIvBcSMc3CueaGjKnHYSbc/I8JRXazDtN0sT8yK3L5WuPdstrhKurWLaDPkUqn+Qu4Te3vEHKc+Xn/pR3Dz/vf+i287epM+v145en1Bw/pA+eYo8vvLAE3SkF/2BjjEKuz974CJCU67yVevc5NnpgknI2Vx5QKeQxT/vilxYyyJ54LLaYDBKXG3OqGPRSDDAOjyw2wuPxYTCrmPMeKYuL86Y5I7YfpecWlUXciQkXBPSQo9P8FrXRW7lbHBwZOtv2QMYI7qzYTR7ygaxNNyx3SeCWd8rDY7gyB5cp3MJibRqalkBxHUJ9eAHYTqFbvq8A/nbGh43HiqG1xlbsmo4SpiOvVewpQgGG+A1vmnvQ2/L6he+QlBpNWiMdXTpqbcWW9NcYQQcRWQoIPH7HNojRtUTSPyqYlhWgipMgn6EhIcWnwSin0gMb/gOIOLht
Additional comments
Thank you in advance
The text was updated successfully, but these errors were encountered: