-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
archived 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 discussiontriageAn ESLint team member will look at this issue soonAn ESLint team member will look at this issue soon
Description
With the following code, the no-fallthrough
rule correctly warns about the missing break statement.
let foo = 'bar';
switch (foo) {
case 'bar':
console.log('Reached matching case.');
default:
console.log('Reached default case.');
}
Expected a "break" statement before "default"
However, when braces surround the case statements, no-fallthrough
fails to report the problem, even though all cases are indeed executed.
let foo = 'bar';
switch (foo) {
case 'bar': {
console.log('Reached matching case.');
}
default: {
console.log('Reached default case.');
}
}
Using ESLint v1.10.3.
Metadata
Metadata
Assignees
Labels
archived 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 discussiontriageAn ESLint team member will look at this issue soonAn ESLint team member will look at this issue soon