Quick Fix: Infer parameter types from usage … for one function #31506
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Search Terms
better type may be inferred from usage
Suggestion
There's a quickfix to infer types from usage for variables that are implicitly
any
:The two options are both useful, but for a large file the "Infer all types from usage" option feels a bit extreme. But inferring symbol-by-symbol can get tedious.
I'm proposing a middle ground option, something like "Infer all types in this block."
Use Cases
Adding type annotations to variables in large files based on usage piecemeal.
Examples
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: