Message from JavaScript discussions

October 2020

— And you never have to think about any of these cases

— 

ALSO, if you define variables in your cases, you would also need blocks:
case 'POST': {
const foo = ...
...
}

— Otherwise the variable declarations will "leak" to the other cases

— I use switches rarely so I forgot about all the things ;)

— Switches are just terrible

— Avoid them

— How can they? If the case isn't called and there is a proper break/return

— Well how do you determine that there is a proper break / return in all cases

— You would need a lint rule or something

— That is done by default in VSCode

— And some insane static analysis to make sure that you don't accidentally reuse another variable from another switch case without a block

Message permanent page

— Probably a default setting in its TS lintrr