Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

New rule: ensure that all code paths return a value #580

Closed
adidahiya opened this issue Aug 19, 2015 · 2 comments
Closed

New rule: ensure that all code paths return a value #580

adidahiya opened this issue Aug 19, 2015 · 2 comments

Comments

@adidahiya
Copy link
Contributor

tsc doesn't report any errors for code like this:

function foo(): string {
  if (false) {
    return "abc";
  }
}

It'd be nice to have a tslint rule that does control flow analysis to warn against that.

@andy-hanson
Copy link
Contributor

Can this be closed then?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants