Skip to main content


Require return statements to either always or never specify values.


This rule requires type information to run.

This rule extends the base eslint/consistent-return rule. This version adds support for functions that return void or Promise<void>.


If possible, it is recommended to use tsconfig's noImplicitReturns option rather than this rule. noImplicitReturns is powered by TS's type information and control-flow analysis so it has better coverage than this rule.

function foo(): undefined {}
function bar(flag: boolean): undefined {
if (flag) return foo();

async function baz(flag: boolean): Promise<undefined> {
if (flag) return;
return foo();
Open in Playground


See eslint/consistent-return options.

How to Use

module.exports = {
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"consistent-return": "off",
"@typescript-eslint/consistent-return": "error"

Try this rule in the playground ↗

When Not To Use It

Type checked lint rules are more powerful than traditional lint rules, but also require configuring type checked linting. See Performance Troubleshooting if you experience performance degredations after enabling type checked rules.


Taken with ❤️ from ESLint core.