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

coverage stat tabulates uses rather than declarations #95

Open starpit opened 5 years ago

starpit commented 5 years ago

the coverage utility is quite helpful. i notice that it increments the penalty for every use of an any variable. maybe this is working as designed, but i think it would be more helpful to penalize any variables once per declaration, rather than once per use?

my thinking is that the magnitude of the fix is proportional to the number of declarations that need to be typed, rather than the number of such uses?

urish commented 5 years ago

Good call! Are you working on a PR?

starpit commented 5 years ago

yes. i also am working on adding a coverage report. the report will break typecov down by declarations versus parameters versus returns

i'm thinking of dropping identifiers altogether, as focusing on these is probably misleading; this will also increase the scalability of the tool, at least as far as the coverage report is concerned: e.g. in our code base (https://github.com/IBM/kui) there is a roughly 10x difference in magnitude between decls and identifiers.

urish commented 5 years ago

This sounds lovely, I'm looking forward to it. Once we have it, #94 will also make a lot more sense