-
-
Notifications
You must be signed in to change notification settings - Fork 5k
no-extra-semi advice is ill on loops without a body #3075
Copy link
Copy link
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyruleRelates to ESLint's core rulesRelates to ESLint's core rules
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyruleRelates to ESLint's core rulesRelates to ESLint's core rules
Real life example
While I agree this is hardly readable and should be refactored,
extra-semidoes incorrectly advice to remove the semicolon here, which would lead to the next line being considered the body of the loop, changing behaviour. The same issue can happen on awhileloop:Real life example
A
do whileis unaffected because the curly braces are required there. This is on v24.1.