mockdeep / typewiz

Automatically discover and add missing types in your TypeScript code
https://medium.com/@urish/manual-typing-is-no-fun-introducing-typewiz-58e3e8813f4c
1.1k stars 46 forks source link

Running apply-types twice makes the project explode #36

Open MadaraUchiha opened 6 years ago

MadaraUchiha commented 6 years ago

Running apply-types twice makes it attempt to actually apply the types twice.

Proposal: remove the collected-types.json file after running apply-types once. (Or something similar)

goodnessSquad

urish commented 6 years ago

Seems like #34 can fix that - if we update collected-types whenever we apply a type, and mark this type as applied (or simply remove it from the list), it should do the trick.

Another thing we can do is to save the hash of each of the source file inside collected-types.json, so we can detect if the files have been changed since we collected the types (and warn the user about that).