Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 294 Bytes

prefer-single-boolean-return.md

File metadata and controls

19 lines (14 loc) · 294 Bytes

prefer-single-boolean-return

Return of boolean literal statements wrapped into if-then-else ones should be simplified.

Noncompliant Code Example

if (expression) {
  return true;
} else {
  return false;
}

Compliant Solution

return expression;