Tslint: deprecate no-unreachable once implemented in TS compiler

Created on 16 Sep 2015  路  7Comments  路  Source: palantir/tslint

compiler is adding reachability checks soon: https://github.com/Microsoft/TypeScript/pull/4788

P2 Accepting PRs Breaking Change

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.

All 7 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacob-robertson picture jacob-robertson  路  3Comments

avanderhoorn picture avanderhoorn  路  3Comments

rajinder-yadav picture rajinder-yadav  路  3Comments

zewa666 picture zewa666  路  3Comments

denkomanceski picture denkomanceski  路  3Comments