eslint-plugin

@masknet/type/prefer-return-type-annotation

Enforce Move return type annotation to function return type

Rule Details

:x: Incorrect

async function request() {
  const response = await fetch('...')
  return (await response.json()) as Payload
}

:white_check_mark: Correct

async function request(): Promise<Payload> {
  const response = await fetch('...')
  return response.json()
}

Attributes