TypeScript Type-check Hook

Validate TypeScript types before committing

Category:hooks-configs
Type:hook
Difficulty:intermediate
typescript
pre-commit
testing
intermediate

Description

Pre-commit hook that runs TypeScript type checking. Ensures type safety across your codebase by catching type errors before they're committed. Uses tsc with noEmit flag.

Content

Resource Content
{
  "hooks": {
    "pre-commit": [
      {
        "name": "typescript-check",
        "command": "npx tsc --noEmit",
        "match": "**/*.{ts,tsx}",
        "description": "Type-check TypeScript files"
      }
    ]
  }
}