complete/strict-undefined-functions
💼 This rule is enabled in the ✅ recommended config.
📝 Disallows empty return statements in functions annotated as returning undefined.
💭 This rule requires type information.
Rule Details
Section titled “Rule Details”void is different from undefined in that undefined is a value and void
is the lack of any value. Thus, it is confusing if someone is returning nothing
from a function that is annotated as returning undefined. In general, this is
indication that either the return type of the function should be changed to
void or that undefined should be explicitly returned.
// Badfunction foo(): undefined { return;}
// Badfunction foo(): undefined {}
// Goodfunction foo(): undefined { return undefined;}Options
Section titled “Options”This rule is not configurable.
