Closed
Description
Thanks to #19392 we can now produce Suggestions with Code Fixes rather than error diagnostics.
This is a good way for TypeScript to report that a program is valid TypeScript, but likely contains a mistake.
Unreachable code is exactly this case. Developers sometimes add a quick throw
statement just to make a runtime assertion while debugging. Then they get an error diagnostic which forces them to comment out remaining lines in this control flow, or add a fake guard condititonal if (1==1) throw new Error('')
I think unreachable code is not an invalid TypeScript program and therefore should be treated like an unused variable.