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

🐛 lint/style/noCommaOperator incorrectly alerts on 3-update for loop #138

Closed
1 task done
turbocrime opened this issue Sep 4, 2023 · 0 comments · Fixed by #152
Closed
1 task done

🐛 lint/style/noCommaOperator incorrectly alerts on 3-update for loop #138

turbocrime opened this issue Sep 4, 2023 · 0 comments · Fixed by #152
Assignees
Labels
A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@turbocrime
Copy link

turbocrime commented Sep 4, 2023

What happened?

lint/style/noCommaOperator will alert on a for loop with three or more update expressions.

for (let i = 0, j = 1, k = 2; i < 100; i++, j++, k++) {}

this will alert on the comma after i++ with default settings.

https://biomejs.dev/playground/?code=ZgBvAHIAIAAoAGwAZQB0ACAAaQAgAD0AIAAwACwAIABqACAAPQAgADEALAAgAGsAIAA9ACAAMgA7ACAAaQAgADwAIAAxADAAMAA7ACAAaQArACsALAAgAGoAKwArACwAIABrACsAKwApACAAewB9AA%3D%3D

Expected result

lint/style/noCommaOperator should not apply to the top level of for loop update expressions.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico added A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug labels Sep 4, 2023
@Conaclos Conaclos self-assigned this Sep 4, 2023
@Conaclos Conaclos added this to the Biome 1.1 milestone Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants