Can we disallow to use || on optional types by lint?
I want to disallow following code: function(num: undefined|number) { return num || 10; } I want use ?? instead of ||. typescript-eslint.io/rules/prefer-nullish-coalescing – Note that for num 0, nullish coalescing will return 0 while the or operator will return 10. – @JSONDerulo I believe that’s exactly the reason to prefer ?? – to avoid defaulting … Read more