Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the...

Examples of errors detected by the V7004 diagnostic

V7004. The 'then' statement is equivalent to the 'else' statement.


React

V7004. The 'then' statement is equivalent to the 'else' statement. InferMutationAliasingEffects.ts 1771


for (const property of value.properties) {
  if (property.kind === 'ObjectProperty') {
    effects.push({
      kind: 'Capture',
      from: property.place,
      into: lvalue,
    });
  } else {
    effects.push({
      kind: 'Capture',
      from: property.place,
      into: lvalue,
    });
  }
}

Visual Studio Code

V7004 The 'then' statement is equivalent to the 'else' statement. chatUsageWidget.ts 102


private renderQuotaItem(
    container: HTMLElement,
    label: string,
    quota: IQuotaSnapshot,
    overageEnabled: boolean = false
    ): void {
  ....
  const quotaItemValue = DOM.append(quotaItemHeader, $('.quota-item-value'));
  if (quota.unlimited) {
    quotaItemValue.textContent = localize('plan.included', 'Included');
  } else {
    quotaItemValue.textContent = localize('plan.included', 'Included');
  }
  ....
}

Overleaf

V7004. The 'then' statement is equivalent to the 'else' statement. index.js 39


if (change.isIntersecting) {
  videoIsVisible = true
  if (videoEl.readyState >= videoEl.HAVE_FUTURE_DATA) {
    if (!videoEl.ended) {
      videoEl
        .play()
        .catch(error =>
          debugConsole.error('Video autoplay failed:', error)
        )
    } else {
      videoEl
        .play()
        .catch(error =>
          debugConsole.error('Video autoplay failed:', error)
        )
    }
  }
}