Giter Site home page Giter Site logo

typecov's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.