Skip to content

Instantly share code, notes, and snippets.

@babldev
Last active April 19, 2022 20:31
Show Gist options
  • Save babldev/9ac9c032ccd80a025e8f8ef21beb6430 to your computer and use it in GitHub Desktop.
Save babldev/9ac9c032ccd80a025e8f8ef21beb6430 to your computer and use it in GitHub Desktop.
Pre-commit hook for typescript type checking
repos:
- repo: local
hooks:
- id: typescript-check
name: typescript-check
entry: npx tsc
language: system
types_or: [ts, tsx]
pass_filenames: false
@babldev
Copy link
Author

babldev commented Apr 19, 2022

I use this in conjunction with eslint https://github.com/pre-commit/mirrors-eslint

-   repo: https://github.com/pre-commit/mirrors-eslint
    rev: v8.12.0
    hooks:
    -   id: eslint
        files: \.[jt]sx?$  # *.js, *.jsx, *.ts and *.tsx
        types: [file]
        args: ['--fix']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment