Answer the question
In order to leave comments, you need to log in
Plugin for VS Code (typescript)?
Good day. Tell me, you need a plugin that would automatically substitute the return type for functions when saving the file. Now I use Prettier, but I didn’t find such functionality there.
Answer the question
In order to leave comments, you need to log in
And how do you even imagine it? Here the plug-in explicitly prescribed the type of the function before you added it (when saving it), or you simply made a mistake, how, when changing the body of the function, will it have to understand that the explicitly specified type will need to be changed?
The type is specified explicitly in order to avoid errors in function returns, if you need automatic determination of the return type (relevant for short and simple functions), then nothing needs to be specified.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question