Why is this an issue?

Declaring a variable only to immediately return or throw it is a bad practice.

Some developers argue that the practice improves code readability, because it enables them to explicitly name what is being returned. However, this variable is an internal implementation detail that is not exposed to the callers of the method. The method name should be sufficient for callers to know exactly what will be returned.

Noncompliant code example

function computeDurationInMilliseconds(hours, minutes, seconds) {
  let duration = (((hours * 60) + minutes) * 60 + seconds ) * 1000;
  return duration;
}

Compliant solution

function computeDurationInMilliseconds(hours, minutes, seconds) {
  return (((hours * 60) + minutes) * 60 + seconds ) * 1000;
}

Noncompliant code example

async function foo () {
  try {
    const result = await bar();
    return result;
  } catch (e) {
    handleError(e);
  }
}

Compliant solution

async function foo () {
  try {
    return await bar();
  } catch (e) {
    handleError(e);
  }
}