Skip to content

TypeScript reporter

Actions
Report type check result on PR diff view
v1.0.9
Latest
Star (5)

TypeScript Error Reporter Action GitHub release (latest SemVer) GitHub

Ensuring type safety is one of the most important responsibilities of modern software developers.

This action uses the TypeScript Compiler API to run a static type check on your code and display the results of the check.

TypeScript Error Reporter Action

Example Configuration

.github/workflows/test.yml:

name: Test

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [13.x]
    steps:
      - uses: actions/checkout@v1
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: Install dependencies
        run: yarn install --frozen-lockfile
      - name: Typecheck
        uses: gozala/[email protected]

tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "skipLibCheck": true,
    "moduleResolution": "node",
    "types": ["node"],
    "lib": ["ES2017"]
  },
  "include": ["src/**/*.ts"]
}

Passing project parameter

If you're working with a monorepo or your tsconfig.json is not in the root repo, or you use different config file, you can provide a project parmeter with a path to the repo itself:

- name: Typecheck
  uses: gozala/[email protected]
  with:
    project: packages/subpackage/tsconfig.json

Passing error_fail_threshold parameter

If you're incrementally adopting typescript in a project, you may not want to fail the entire workflow on a single typescript error. error_fail_threshold allows you to pass the maximum number of errors at which the step passes. Defaults to 0:

- name: Typecheck
  uses: gozala/[email protected]
  with:
    error_fail_threshold: 100

TypeScript reporter is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Report type check result on PR diff view
v1.0.9
Latest

TypeScript reporter is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.