-
Notifications
You must be signed in to change notification settings - Fork 44
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
Getting "typescript-eslint/unbound-method" using a simple Svelte "on:event" syntax. A false positive? #103
Comments
What is |
The rule sounds like it's doing what it's supposed to do. You either need to disable it, or otherwise appease the type checker. This doesn't have anything to do with Svelte. |
@JounQin action(event: AnimationEvent | string) {
// handle event here
}, @Conduitry some hours ago I found something that had to be "correct" in Svelte types. I don't think I'm asking for much but an indication, among other things useful for all those who will look after me. |
Use following like sveltejs/svelte#6094 action(this:void, event: AnimationEvent | string) {
// handle event here
}, Or arrow function action: (event: AnimationEvent | string) => {
// handle event here
},
`` |
@JounQin it works! I love you! ❤️❤️❤️ @Conduitry Simply this. |
I think you should ready more carefully about the rule itself before raising issues, bro. |
I'm converting to Typescript this code:
on the line
on:animationend={myStore.action}
typescript-eslint is complaining about:Avoid referencing unbound methods which may cause unintentional scoping of
this. eslint@typescript-eslint/unbound-method
.What should I do?
Change it to the below? But I like Svelte because of its laconicity!
Can you help me understand, please?
The text was updated successfully, but these errors were encountered: