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

Don't add types in places where they could be inferred #29

Open urish opened 6 years ago

urish commented 6 years ago

For instance, skip adding types to n parameter of square in the following code, as TypeScript can automatically infer this type:

console.log([1,2,3].map(function square(n) {
  return n*n;
}));

This involves consulting the Type Checker, see infer-types branch / #27 which also involve using the Type Checker API.

zoehneto commented 6 years ago

Since #27 is merged, is this issue resolved or is it still in progress?

urish commented 6 years ago

@zoehneto not yet - it should be quite easy to implement though using the work done in #27 as a foundation

GeeWee commented 6 years ago

Just want to give a thumbs up to this - TypeWiz types all of my it((err? : any => void)) blocks, even though the types are fully specified in the chai docs.