-
-
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
New rule: no undefined variable in the DOM
#747
Comments
Thank you for posting the rule suggestion. |
Svelte 5 solved this issue. So should we implement rules for Svelte 4 now that Svelte 5 is RC? |
I think what users need to do is migrating the app to Svelte 5 instead of adding the rule. |
I didn't know that 😅 I can’t wait for the GA of Svelte v5!!! |
Thanks for pointing out this evolution is Svelte 5. I am concerned whether this is a better solution. Usually, when I had Maybe it's still necessary to have this rule but as a warning and not an error? |
Yeah, I think the priority has been lowered, but someone might want to make sure it's explicitly a string. |
Motivation
When using a variable (say a props) that can be
null
orundefined
directly in the DOM, it will be rendered as a string"null"
or"undefined"
. Hence, it is probablly never going to be a good thing to use a possibly null or undefined variable directly in the DOM.Description
The rule would highlight any variable or expression used in the DOM that resolves to a type involving a union type to
null
orundefined
.Examples
Additional comments
No response
The text was updated successfully, but these errors were encountered: