Stop the Switch Case Suffering in TypeScript!

Опубликовано: 27 Февраль 2025
на канале: TypeScript with Benny Code
583
29

The switch statement can become dangerous to you and your code. Luckily, TypeScript comes with a type checking feature to protect you.

My FREE programming apps:
https://apps.apple.com/app/id659282498
https://play.google.com/store/apps/de...

My FREE TypeScript Course:
https://typescript.tv/

Timeline:
01:24 The switch fallthrough case
02:28 Fixing error-prone switch statements
03:22 noFallthroughCasesInSwitch compiler option
04:10 Prevent fallthrough cases with ESLint
04:45 Bonus tip: Block scoping with switch cases
06:13 Outro

Resources:
➜ https://palantir.github.io/tslint/rul...
➜ https://eslint.org/docs/latest/rules/...

Follow TypeScript TV:
🌐 https://typescript.tv
🐦   / typescripttv  
📺    / typescripttv  

Hashtags:
#TypeScript #JavaScript #typescripttutorial