Inline return

Convert a variable assignment to a return statement.

Refactoring (Inline)
P42 for VS Code
P42 for GitHub
Inline return

Inline return converts a variable assignment to a return statement. Such a conversion is possible when the following statement after the assignment in the control flow returns the variable.

This refactoring simplifies the control flow and makes it easier to reason about a function.

Related Code Actions

Learn More

Available In