[NODEJS-1767] Make type dectection way better

- Make type dectection way better
- Apply JSHint into practice