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

Note that if the result of the expression is not a boolean but for instance an integer, then double negation should be used for proper conversion.

Note that this rule requires Node.js to be available during analysis.

Noncompliant Code Example

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

Compliant Solution

return expression;

or

return !!expression;