In Typescript, when there is unreachable code, the compiler generates a default error:
error TS7027: Unreachable code detected.
I can avoid this by using the compiler option allowUnreachableCodebefore true, but can I somehow change it to a warning?
I would still rather know about unreachable code. During development and debugging, I sometimes use if (false)to temporarily remove some functions, which is better than commenting out the code, especially when the code itself contains comments.
In C #, unreachable code generates a warning (which I can consider as an error with another option), which seems to me the best way to handle this.
source
share