Giter VIP home page Giter VIP logo

typescript-error-reporter-action's Introduction

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: [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: computerjazz/[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: computerjazz/[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: computerjazz/[email protected]
  with:
    error_fail_threshold: 100

passing repo_token parameter

In order to bypass the maximum of 10 pull request annotations that a GitHub action can post, this action uploads all annotations in separate, batched api calls, which requires an API token:

- name: Typecheck
  uses: computerjazz/[email protected]
  with:
    error_fail_threshold: 100
    repo_token: "${{ secrets.GITHUB_TOKEN }}"

typescript-error-reporter-action's People

Contributors

andoshin11 avatar computerjazz avatar gozala avatar

Stargazers

Leho Kraav avatar  avatar JC (Jonathan Chen) avatar Krzysztof Saczuk avatar Nutsu avatar

Watchers

Leho Kraav avatar James Cloos avatar

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.