You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track missing type coverage in TypeScript projects to ensure type safety
Features
π track type coverage defined as the count of symbols whose type is not any / the total count of symbols
π display type coverage directly in GitHub
π set minimal type coverage and automatically fail PRs
π supports monorepos
Motivation
Despite using --strict mode in tsconfig you can still have anys in your codebase. This tool gives you a good overview if PR that you are going to merge increases or decreases overall type coverage and where exactly types should be improved.
Install
npm install --save-dev typecov
Usage
TypeCov is built on CodeChecks.io - open source code review automation platform.
interfaceOptions{name?: string;// will be added to check nametsconfigPath?: string;//defaults to tsconfig.jsonatLeast?: number;ignoreFiles?: string[];ignoreCatch?: boolean;strict?: boolean;}
name
optional string
Defaults: Type Coverage
Specify the name for check. Might be useful in monorepos.
tsconfigPath
optional string
Default: tsconfig.json
Path to typescript project configuration
atLeast
optional number
Defaults: undefined
Example: atLeast: 99
Fail if coverage rate < this value.
ignoreFiles
optional string[]
Defaults: undefined
Specify the ignored for checks files.
See type-coverage's description for the reference.