Improve type inference with simple TypeScript patterns like Control Flow Analysis and Discriminated Unions, coding habits, and compiler options.