Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a VSCode extension that adds a Quick Fix for adding the explicit type to a field for Typescript?

I want to have a Quick Fix action (cmd + .) that adds the explicit type to a field, parameter, or function return (where it is otherwise inferred).

To turn

const specificQuesiton = await Question.query().findById(1)

into

const specificQuesiton: Question = await Question.query().findById(1)
like image 642
Kyle Venn Avatar asked Sep 06 '25 03:09

Kyle Venn


1 Answers

Found one!

https://marketplace.visualstudio.com/items?itemName=nick-lvov-dev.typescript-explicit-types

Here's an example of it in action: enter image description here

I also found this one which just does return type (the one above does everything).

like image 183
Kyle Venn Avatar answered Sep 07 '25 19:09

Kyle Venn