compiler is adding reachability checks soon: https://github.com/Microsoft/TypeScript/pull/4788
Looks like it'll be released in TS 1.8: https://github.com/Microsoft/TypeScript/wiki/Roadmap
1.8 is released now. =)
@JKillian chatted about this and there is _some_ merit to keeping the TSLint rule around in case users don't want to turn on the compiler error (which would fail builds) but leave it as a linter warning (which may not fail builds). Thoughts?
Personally I'm on board with removing the rule in TSLint 4.0 just to avoid duplicating compiler logic. But if there are objections I could be convinced to keep it around.
Hmm. I don't feel strongly either way, but it seems strange that someone would want to disable this in the compiler and then just ignore the linter warning. Unreachable code is surely a bug that must be fixed immediately? I'm probably not seeing all the use cases, so I guess it's better to get more feedback.
I'm personally a bit disappointed this lint option was removed. I sometimes like to add a return statement in the middle of a function during development, for debugging purposes. That's why I would disable unreachable code errors in the compiler but keep it enabled in the linter.
@dbandstra for development workflows: the compiler will produce errors but still transpile your code to JS. Is that not sufficient for debugging?
Yeah, I'll live hehe. I was a bit late to chime in on this issue.
Most helpful comment
I'm personally a bit disappointed this lint option was removed. I sometimes like to add a return statement in the middle of a function during development, for debugging purposes. That's why I would disable unreachable code errors in the compiler but keep it enabled in the linter.