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

bug(fmt): semicolon insertion causing syntax errors with using in a for-of loop #24406

Closed
nberlette opened this issue Jul 3, 2024 · 0 comments · Fixed by #24834
Closed

bug(fmt): semicolon insertion causing syntax errors with using in a for-of loop #24406

nberlette opened this issue Jul 3, 2024 · 0 comments · Fixed by #24834
Assignees
Labels
bug Something isn't working correctly deno fmt Related to the "deno fmt" subcommand or dprint

Comments

@nberlette
Copy link
Contributor

Version: Deno 1.44.4+dadc606 (macOS 14.5, M1 Pro)

When a for-of loop contains a using statement instead of let or const, deno fmt inserts a semicolon after the identifier in the middle of the statement, breaking it half and creating a syntax error.

I haven't had a chance to test different combinations of for-of/for-await-of loops nor await using. I also haven't had a chance to test it with semicolons disabled in fmt config, but I would assume that configuration would likely prevent this from happening.

Here's a quick recording of it occuring in VSCode as described:

Screen.Recording.2024-07-03.at.5.15.12.AM.mov
@bartlomieju bartlomieju added bug Something isn't working correctly deno fmt Related to the "deno fmt" subcommand or dprint labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly deno fmt Related to the "deno fmt" subcommand or dprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants