Skip to content

Add support for ternary operator #5

@juanjoDiaz

Description

@juanjoDiaz

I'm sure that this is more complex than it looks like...
But it would be nice if it would detect easy cases like:

const myFunction = (x) => {
  return (x>0) ? "ok" : "not ok"
}

being equivalent to

const myFunction = (x) => {
  if(x>0){
    return "ok"
  } else {
    throw "not ok"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions