Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.
This repository was 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

Description

@adidahiya

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions