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

Update no-nullable-attribute-binding fix for null attribute #339

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

AndrewJakubowicz
Copy link
Contributor

Context

Fixes: #317

In versions of Lit >2, ifDefined can handle null and undefined so the explicit null check is no longer required.

Change

Instead of recommending ifDefined(expr === null ? undefined : expr), instead recommend ifDefined(expr) for both undefined and null.

Test

Added message tests to ensure that type detection works correctly, and that the diagnostic message correctly identify either null or undefined. This will make it easier to catch regressions when moving to isTypeAssignableTo in the future.

@AndrewJakubowicz
Copy link
Contributor Author

Ready for review, cc/ @rictic

@rictic
Copy link
Collaborator

rictic commented Jan 5, 2024

Great change!

@rictic rictic merged commit 6d7dbe8 into runem:master Jan 5, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

Update no-nullable-attribute-binding rule for null attribute
2 participants