TypeScript · Type Checking

noImplicitReturns

Enable error reporting for codepaths that do not explicitly return in a function.

Syntax
"noImplicitReturns": true

Example

Example
{
  "compilerOptions": {
    "noImplicitReturns": true
  }
}

More in this group

allowUnreachableCode allowUnusedLabels alwaysStrict noFallthroughCasesInSwitch noImplicitAny noImplicitOverride noImplicitThis noPropertyAccessFromIndexSignature

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course