@codechecks/type-coverage-watcher

Track missing type coverage in TypeScript projects to ensure type safety

Usage no npm install needed!

<script type="module">
  import codechecksTypeCoverageWatcher from 'https://cdn.skypack.dev/@codechecks/type-coverage-watcher';
</script>

README

codechecks.io

Type Coverage Watcher

Track missing type coverage in TypeScript projects to ensure type safety

Build Status Software License codechecks.io

Install

npm add --save-dev @codechecks/type-coverage-watcher

Usage

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

Add to your codechecks.yml file:

checks:
  - name: type-coverage-watcher
  # ...

Under the hood it uses type-coverage package.

API

typeCoverageWatcher(options: Options): Promise<void>

options

interface Options {
  tsconfigPath?: string; //defaults to tsconfig.json
  name?: string; // defaults to Type Coverage
  ignoreFiles?: string[];
  ignoreCatch?: boolean;
  atLeast?: number;
  strict?: boolean;
}
tsconfigPath

optional string

Default: tsconfig.json

Path to typescript project configuration

name

optional string

Defaults: Type Coverage

Specify the name for check. Might be useful in monorepos.

ignoreFiles

optional string[]

Defaults: undefined

Specify the ignored for checks files.

ignoreCatch

optional string

Defaults: undefined

See type-coverage's description for the reference.

atLeast

optional number

Defaults: undefined

Example: atLeast: 99

Fail if coverage rate < this value.

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