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

Future of no-not-function-handler #903

Closed
marekdedic opened this issue Nov 3, 2024 · 2 comments
Closed

Future of no-not-function-handler #903

marekdedic opened this issue Nov 3, 2024 · 2 comments

Comments

@marekdedic
Copy link
Contributor

Hi, the rule no-not-function-handler is used in Svelte 4 for checking that event callbacks are functions. In Svelte 5, event callbacks are regular props. I think the rule shouldn't be ported to this new event system for several reasons:

  1. You can't really tell which prop is an event callback
  2. Passing non-functions to props which expect a callback is like passing any wrongly typed prop, sou should be caught if you are using TypeScript (and if you are not... well that's your choice, this is exactly the kind of issue that TypeScript was built for...)

What do you think?

@ota-meshi
Copy link
Member

Yeah. I agree with you, I don't think that rule is very useful.

@marekdedic
Copy link
Contributor Author

marekdedic commented Nov 6, 2024

Ok, I'll add it to the list in #894.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants