Skip to content
Track missing type coverage to ensure type safety
TypeScript JavaScript
Branch: master
Clone or download
krzkaczor Merge pull request #10 from codechecks/kk/neutral-short-message
add shorter message when no change was detected
Latest commit da6cdb3 Aug 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
meta use typecov name Aug 18, 2019
src add shorter message when no change was detected Aug 19, 2019
.gitignore 🔥 it works Mar 18, 2019
.prettierignore 🔥 it works Mar 18, 2019
.prettierrc 🔥 it works Mar 18, 2019
CHANGELOG.md 💅 readme and package metadata improvements Mar 28, 2019
CONTRIBUTING.md 💅 readme and package metadata improvements Mar 28, 2019
LICENSE 💅 readme and package metadata improvements Mar 28, 2019
README.md motivation section in readme Aug 19, 2019
jest.config.js 🆙 update @codechecks/client, add default export to make it work with … Mar 31, 2019
package.json use typecov name Aug 18, 2019
tsconfig.json 🔥 it works Mar 18, 2019
tsconfig.prod.json use typecov name Aug 18, 2019
tslint.json 🔥 it works Mar 18, 2019
yarn.lock reapply updating dependencies Aug 2, 2019

README.md

codechecks.io

TypeCov

Track missing type coverage in TypeScript projects to ensure type safety

Build Status Software License codechecks.io

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.

Are you new to codechecks? Check out getting started guide (it's simple)!

Install package and then add to your codechecks.yml file:

checks:
  - name: typecov
    options:
      # atLeast: 99
      # name: webapp
      # tsconfigPath: ./tsconfig.prod.json

Under the hood it uses type-coverage package.

API

typecov(options: Options): Promise<void>

options

interface Options {
  name?: string; // will be added to check name
  tsconfigPath?: string; //defaults to tsconfig.json
  atLeast?: 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.

ignoreCatch

optional string
Defaults: undefined
See type-coverage's description for the reference.

strict

optional string
Defaults: undefined
See type-coverage's description for the reference.

Contributing

All contributions are welcomed. Read more in CONTRIBUTING.md

Licence

MIT @ codechecks.io

You can’t perform that action at this time.