Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --ignore-catch functionality #22

Merged
merged 2 commits into from
Apr 16, 2019

Conversation

Raynos
Copy link
Contributor

@Raynos Raynos commented Apr 16, 2019

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

  • Contains Only One Commit(git reset then git commit)
  • Build Success(npm run build)
  • Lint Success(npm run lint to check, npm run fix to fix)
  • File Integrity(git add -A or add rules at .gitignore file)
  • Add Test(if relevant, npm run test to check)

This adds the ability to ignore the `any` in the catch block
because TypeScript forces the `any` there and a type annotation
or type cast is illegal syntax
@plantain-00 plantain-00 merged commit 8aded79 into plantain-00:master Apr 16, 2019
@plantain-00
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants