-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Component event and prop names too permissive #5903
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
Comments
Agree with that. From a tooling perspective it would be ideal to only allow alphanumeric characters and |
Is this actually causing a bug, or is it just unsightly? |
From a tooling perspective it causes some problems because JSX/TSX, which code is transformed to for intellisense features, is more restrictive, but I've not yet encountered an actual bug. So from my point of view it would be more of a "more well defined" thing. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I still think this would be good to make more strict. It would make tooling easier. Strictly speaking it's probably a breaking change though. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Thinking about this differently now. Still would be cool but many libraries take advantage of the more permissive nature of props and events and added things like |
Now thinking that it's not worth the hassle - the language tools argument I brought up back in the day is no longer relevant. |
we decided to not worry about this. it is a potential footgun, but it's also a potential escape hatch, and escape hatches should be left unlocked |
What would be an example where such escape hatches would be required? |
The nature of escape hatches is that it's hard to predict when you need them! |
Event and prop names accept all characters but space, quotes,
>
and=
https://svelte.dev/repl/8bff2976db80403db1affa9138c3e8dd?version=3.31.2
The text was updated successfully, but these errors were encountered: