eslint-plugin

@masknet/no-single-return

Disallow single-return

Rule Details

Disallow Single Return

:x: Incorrect

function isGood(battery: Battery) {
  let out = false
  if (battery.charge) out = true
  if (battery.cycles < 10) out = true
  return out
}

:white_check_mark: Correct

function isGood(battery: Battery) {
  if (battery.charge) return true
  if (battery.cycles < 10) return true
  return false
}

Attributes