In August 2025, TypeScript overtook Python and JavaScript to become the most-used programming language on GitHub. It's a significant shift, and the driver isn't a new TypeScript feature or a framework war — it's AI coding assistants.
The Numbers
From the GitHub Octoverse 2025 report:
- TypeScript is now #1 by repository usage on GitHub, surpassing Python and JavaScript
- 80% of new GitHub developers use Copilot within their first week
- Over 1.1 million public repositories use an LLM SDK (up 178% year-over-year)
- 84% of developers use or plan to use AI tools; 51% use them daily
The Octoverse team named this the "convenience loop": AI tools make TypeScript easier to work with, which pulls developers toward TypeScript, which in turn makes AI tools more effective. It compounds.
Why TypeScript Works Better with AI
The underlying reason is mechanical. When an LLM generates code, it makes inferences about types, shapes, and contracts based on context. The more explicit the types are, the less the model has to guess.
A 2025 academic study found that 94% of compilation errors from LLM-generated code were type-check failures. Type annotations directly address the most common failure mode of AI-assisted coding.
// With TypeScript: the AI knows exactly what to pass and what to expect
async function createInvoice(
customerId: string,
lineItems: Array<{ productId: string; quantity: number; unitPrice: number }>,
currency: 'JPY' | 'USD' | 'EUR'
): Promise<{ invoiceId: string; totalAmount: number }> {
// AI-generated body has constrained solution space — fewer wrong answers
}
// Without TypeScript: the AI might pass 'yen', 0, or undefined for currency
function createInvoice(customerId, lineItems, currency) {
// Runtime surprises are common here
}This isn't about TypeScript being theoretically superior. It's about AI tools producing better outputs when they have more signal. Declare x: string and the model immediately knows to ignore every operation that doesn't work on strings.
The "Convenience Loop" in Practice
GitHub's analysis shows a consistent behavioral pattern among developers who adopt Copilot early:
- New developer uses Copilot from day one
- TypeScript projects give Copilot more context → completions are more accurate
- Developer experiences fewer corrections needed → TypeScript feels easier
- Developer chooses TypeScript for their next project
The loop resets what "easy" means. Developers who learn to code alongside AI assistance don't experience JavaScript's permissiveness as freedom — they experience TypeScript's structure as lower friction. The language choice follows from the tooling choice, not the other way around.
Practical Migration Path for JavaScript Projects
You don't need to convert everything at once. The most effective approach is incremental.
Phase 1: Enable TypeScript alongside existing JavaScript (1-2 days)
npm install -D typescript @types/node
npx tsc --initMinimal tsconfig.json to start:
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": false,
"allowJs": true,
"checkJs": false,
"outDir": "./dist",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*"]
}With allowJs: true, existing .js files compile without modification. New files go in .ts from the start.
Phase 2: Write all new code in TypeScript (ongoing)
Treat migrating existing files as low-priority tech debt. New features and modules start in .ts immediately. The codebase gradually shifts without a disruptive rewrite.
Phase 3: Enable strict mode (3-6 months in)
# Count errors before enabling strict — sets expectations
npx tsc --noEmit --strict 2>&1 | grep "error TS" | wc -l
# Find the files with most errors — start there
npx tsc --noEmit --strict 2>&1 | grep "error TS" \
| awk -F'(' '{print $1}' \
| sort | uniq -c | sort -rn \
| head -20Enable strict: true in tsconfig.json and address errors by file, starting with the highest-traffic modules.
What Concretely Changes with AI Tooling
Once a TypeScript codebase is established, AI-assisted development improves in measurable ways:
Completion accuracy: AI suggests correct argument types, return types, and handles nullable fields properly instead of producing plausible-but-wrong code that passes a quick read but fails at runtime.
Refactoring safety: Type-checking validates AI-suggested changes automatically. The feedback loop tightens from "run tests to find errors" to "see errors before running anything."
Onboarding speed: New developers and AI assistants can understand a codebase faster when type contracts are explicit at every boundary. The types serve as always-up-to-date documentation that code comments rarely are.
When TypeScript Isn't Worth It
TypeScript adds overhead that isn't always justified:
- One-off scripts: If a script runs once and gets deleted, the type setup cost isn't worth it.
- Very small projects: A 200-line utility script doesn't need the full TypeScript toolchain.
- Stable JavaScript codebases with no active development: Don't migrate for migration's sake.
The sweet spot is any project that will grow, be maintained by multiple developers, or benefit from AI-assisted development. That describes most production web applications.
Takeaways
TypeScript's rise to #1 on GitHub reflects a structural change in how professional code is written, driven by the intersection of type safety and AI tooling. The "convenience loop" effect means this trend is likely to accelerate rather than reverse.
If your team is still on JavaScript for production applications, the migration friction has never been lower. Modern tooling handles incremental adoption well, and the improvement in AI tool effectiveness is immediate and tangible once types are in place.
Start with allowJs: true, write new modules in TypeScript, and let the codebase shift naturally. It's the lowest-risk path to a meaningfully different development experience.