plantain-00 / type-coverage

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

Shouldn't flag `as const` #52

Closed danielnixon closed 4 years ago

danielnixon commented 4 years ago

Version(if relevant): 2.8.0

Environment(if relevant):

Code(if relevant):

"foo" as const

Expected:

Doesn't count as uncovered

Actual:

Is flagged as uncovered

plantain-00 commented 4 years ago

It's the strict mode

Type assertion, like a as string, a!, a will be considered as uncovered Also, future minor release may introduce stricter type check in this mode, which may lower the type coverage rate

https://github.com/plantain-00/type-coverage#strict-mode

You can turn it off by removing --strict you don't need it.

plantain-00 commented 4 years ago

as const should not count, I will fix it.

plantain-00 commented 4 years ago

v2.8.1 should exclude as const

danielnixon commented 4 years ago

LGTM, thanks @plantain-00.