Refactorings to convert from function declarations to function expressions #44080
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
Suggestion
🔍 Search Terms
refactoring quick fix vs code action
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
We already have refactorings to convert function expressions (arrow or non-arrow) to a function declaration, e.g. we can use "convert to named function" on both of these:
However, there is no refactoring to convert in the opposite direction—from a function declaration to a function expression.
I would like to suggest adding these refactorings so we cover all possibilities.
Note we do already have these refactorings (#28250):
However these only work on function expressions—they don't work on function declarations. Perhaps we could fix this by extending the scope of those refactorings so they do work on function declarations.
The text was updated successfully, but these errors were encountered: