plantain-00 / type-coverage

A CLI tool to check type coverage for typescript code
MIT License
1.26k stars 44 forks source link

add --ignore-catch functionality #22

Closed Raynos closed 5 years ago

Raynos commented 5 years ago

Fixes(if relevant):

Introduces a new flag --ignore-catch;

ignore catch

If you want to get 100% type coverage then try {} catch {} is the largest blocked towards that.

This can be fixed in typescript with Allow type annotation on catch clause variable but until then you can turn on --ignoreCatch --at-least 100.

Your catch blocks should look like

try {
  await ...
} catch (anyErr) {
  const err = <Error> anyErr
}

To have the highest type coverage.

Checks

plantain-00 commented 5 years ago

Released at v1.13.0, and I changed --ignoreCatch to --ignore-catch to be consistent with --at-least