claudekit
Version:
CLI tools for Claude Code development workflow
19 lines • 6.66 kB
text/csv
Category,Symptom/Error,Root Cause,Fix 1,Fix 2,Fix 3,Diagnostic Command,Validation Step,Official Link
Generic Types & Constraints,"Type instantiation is excessively deep and possibly infinite","Recursive type definition without termination condition","Add type assertion with `as any`","Limit recursion depth with conditional types","Redesign type hierarchy to avoid deep recursion","tsc --extendedDiagnostics","Check compilation time and memory usage","https://www.typescriptlang.org/docs/handbook/2/conditional-types.html"
Generic Types & Constraints,"Type 'T' could be instantiated with a different subtype of constraint","Generic variance issues or insufficient constraints","Use intersection types `T & SomeType`","Add proper generic constraints `T extends SomeInterface`","Implement branded types for nominal typing","tsc --strict","Verify type safety with test cases","https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints"
Generic Types & Constraints,"Cannot find name 'T' or generic parameter not in scope","Generic type parameter scope issues","Move generic parameter to outer scope","Use conditional types with infer keyword","Restructure type hierarchy with mapped types","tsc --noEmit","Check generic parameter visibility","https://www.typescriptlang.org/docs/handbook/2/generics.html"
Utility Types & Transformations,"Type 'keyof T' cannot be used to index type 'U'","Incorrect usage of keyof operator","Use bracket notation with string literal","Apply proper mapped type with `K in keyof T`","Create type-safe property access utility","tsc --strict --noImplicitAny","Test with various object types","https://www.typescriptlang.org/docs/handbook/2/keyof-types.html"
Utility Types & Transformations,"Template literal type cannot be parsed","Invalid template literal type syntax","Use simpler string literal types","Apply proper template literal syntax","Implement recursive template literal parsing","tsc --strict","Validate string manipulation behavior","https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html"
Utility Types & Transformations,"Conditional type 'T extends U ? X : Y' is not distributive","Misunderstanding of distributive conditional types","Wrap condition in array `[T] extends [U]`","Use proper distributive conditional syntax","Create helper types for distribution control","tsc --noEmit","Test with union types","https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types"
Type Inference & Narrowing,"Object is possibly 'null' or 'undefined'","Strict null checks without proper narrowing","Use non-null assertion `value!`","Add null check with if statement","Implement comprehensive type guard","tsc --strict --strictNullChecks","Test with null/undefined inputs","https://www.typescriptlang.org/docs/handbook/2/narrowing.html"
Type Inference & Narrowing,"Argument of type 'unknown' is not assignable","Type narrowing failure in generic context","Use type assertion `value as T`","Implement type guard with type predicate","Create assertion function with `asserts`","tsc --strict --noImplicitAny","Verify runtime type checking","https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates"
Type Inference & Narrowing,"Control flow analysis cannot determine type","Complex control flow confusing TypeScript","Simplify conditional logic","Use type assertions at key points","Refactor with discriminated unions","tsc --strict","Test all code paths","https://www.typescriptlang.org/docs/handbook/2/narrowing.html#control-flow-analysis"
Advanced Type Patterns,"Circular reference in type definition","Types referencing each other directly","Break cycle with interface declaration","Use conditional types to defer evaluation","Implement proper type hierarchy","tsc --noEmit","Check for infinite type loops","https://www.typescriptlang.org/docs/handbook/declaration-files/deep-dive.html"
Advanced Type Patterns,"Brand type not assignable to base type","Incorrect brand type implementation","Use intersection with base type","Implement proper brand with unique symbol","Create type-safe constructor functions","tsc --strict","Test nominal typing behavior","https://egghead.io/blog/using-branded-types-in-typescript"
Advanced Type Patterns,"Recursive type alias 'T' illegally references itself","Direct self-reference in type alias","Use interface with extends","Defer recursion with conditional types","Implement mutual recursion pattern","tsc --noEmit","Verify type resolution","https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces"
Performance & Compilation,"Type checking is very slow","Complex types causing performance issues","Enable skipLibCheck in tsconfig","Use incremental compilation","Optimize type complexity and unions","tsc --extendedDiagnostics","Monitor compilation time","https://github.com/microsoft/TypeScript/wiki/Performance"
Performance & Compilation,"Out of memory during type checking","Type instantiation consuming too much memory","Increase Node.js heap size","Simplify complex type unions","Break large types into smaller pieces","node --max-old-space-size=8192","Monitor memory usage","https://github.com/microsoft/TypeScript/wiki/Performance#preferring-interfaces-over-intersections"
Performance & Compilation,"Type instantiation depth exceeded","Deeply nested type operations","Use type aliases to break chains","Limit recursive type depth","Redesign type architecture","tsc --noEmit","Check type complexity","https://github.com/microsoft/TypeScript/wiki/Performance#writing-easy-to-compile-code"
Library & Module Types,"Module has no default export","Incorrect module import/export handling","Use namespace import `* as module`","Add default export to module","Configure module resolution correctly","tsc --moduleResolution bundler","Test import statements","https://www.typescriptlang.org/docs/handbook/modules.html"
Library & Module Types,"Cannot find module declaration","Missing or incorrect .d.ts files","Create ambient module declaration","Install @types package if available","Generate declaration files from source","tsc --declaration --emitDeclarationOnly","Verify module resolution","https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html"
Library & Module Types,"Module augmentation not working","Incorrect global or module augmentation","Use proper declare module syntax","Place augmentation in global scope","Ensure proper import/export context","tsc --traceResolution","Test augmented properties","https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation"