reviewing-type-safety
TypeScript type safety patterns and best practices for maximum type coverage. Use when reviewing TypeScript code for type issues, eliminating `any` types, or when user mentions type safety, 型安全, 型カバレッジ, strict mode.
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Type Safety Review
Detection
| ID | Pattern | Fix |
|---|---|---|
| TS1 | any |
unknown + type guard |
| TS1 | Implicit any | Explicit type annotation |
| TS2 | value as Type |
Type guard function |
| TS2 | value! (non-null assertion) |
Explicit null check |
| TS3 | function fn(data) (untyped) |
function fn(data: Type) |
| TS3 | Missing return type | Explicit : ReturnType |
| TS4 | default: without exhaustive |
default: assertNever(value) |
Criteria
Type coverage >= 95%. Any usage = 0. Strict mode all enabled.
References
| Topic | File |
|---|---|
| Coverage | references/type-coverage.md |
| Guards | references/type-guards.md |
| Strict | references/strict-mode.md |
| Result | references/result-type.md |
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!