-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 discussionenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintruleRelates to ESLint's core rulesRelates to ESLint's core rules
Description
Environment
Node version: v16.14.0
npm version: v8.3.1
Local ESLint version: v8.11.0 (Currently used)
Global ESLint version: v7.23.0
Operating System: darwin 21.1.0
What parser are you using?
Default (Espree)
What did you do?
var x = 3;
switch(x){
case 0:
case 1: break;
case 2:
case 3:
break;
}
What did you expect to happen?
No errors
What actually happened?
8:3 error Expected a 'break' statement before 'case' no-fallthrough
Participation
- I am willing to submit a pull request for this issue.
Additional comments
It might also make sense to support comments:
switch(x) {
// currently accepted
case 0:
case 1:
break;
// this issue
case 2:
case 3:
break;
// general proposal
/* a note about 4 */
case 4:
/* a note about 5 */
case 5:
break;
}
LvChengbin, reviewher and Gautam-Arora24
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 discussionenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintruleRelates to ESLint's core rulesRelates to ESLint's core rules
Type
Projects
Status
Complete