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

Use {} for empty if and else blocks #1245

Merged
merged 1 commit into from
May 11, 2024
Merged

Use {} for empty if and else blocks #1245

merged 1 commit into from
May 11, 2024

Conversation

edemaine
Copy link
Collaborator

Fixes #1244

Oddly TypeScript complains about an if block being the empty statement ;, but doesn't complain about else blocks or loops.

For symmetry, I changed both if and else blocks to use {} empty blocks instead of ;, but left loops alone. Also cleaned up postfix detection.

@edemaine edemaine changed the title Use {} or empty if and else blocks Use {} for empty if and else blocks May 11, 2024
@edemaine edemaine merged commit a213c4e into main May 11, 2024
3 checks passed
@edemaine edemaine deleted the empty-if branch May 11, 2024 18:01
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.

Use {} instead of ; for empty block
2 participants