Open
Description
Suggestion
π Search Terms
- uncalled function
- check
- statement
β Suggestion
Today TS can detect uncalled functions that appear in conditionals. I propose also extending this to uncalled functions that appear as statements
π Motivating Example
function doImportantStuff() { }
doImportantStuff; // Mistake here. The user forgot to call the func
if (doImportantStuff) { // This one is detected today
}
π» Use Cases
This can help catch a common programming mistake. As long as the function being checked has a const
binding and is always a function type, I don't think there are cases where you actually want to write doImportantStuff;
as a statement