3 ms·
This isn't needed any more. Modern TS enforces switch exhaustiveness out-of-the box (if you provide the proper union type, of course).
by loxs 7y ago
This isn't needed any more. Modern TS enforces switch exhaustiveness out-of-the box (if you provide the proper union type, of course).
- city41 7y agoOh awesome, I didn't know that. Thanks for the heads up.
- sikan 7y agoThis is not true: https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking https://www.typescriptlang.org/docs/handbook/advanced-types....
- loxs 7y agoYeah, I always use strict and specify return type. IMO, still counts.