-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
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
Related issues
a-tarasyuka-tarasyuk
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript