Types are definitely a stumbling block for LLMs. I think you are onto something there.
My personal guess is that there’s just so much crappy TypeScript code out there that without a ton of guardrails it’s just a pasta machine.
Second to that is the lack of understanding of category theory which IMO needs some level of reasoning.