What Are the New tsconfig Defaults in TypeScript 6.0?
Purpose
This post explains the new default compiler options in TypeScript 6.0 and how to migrate your existing projects.
When I upgraded my projects to TypeScript 6.0 beta, I noticed several breaking changes. The TypeScript team changed five major defaults that affect every project. I’ll explain what changed and how to fix your configuration.
What changed in TypeScript 6.0?
TypeScript 6.0 updates the default compiler options to match modern JavaScript development. The old defaults reflected the JavaScript ecosystem of 5-10 years ago. In 2026, those defaults cause problems.
Here are the five changes:
strictnow defaults totrue(wasfalse)modulenow defaults to"esnext"(was"commonjs")targetnow defaults to"es2025"(was"es2015")rootDirnow defaults to.(was inferred)typesnow defaults to[](was auto-included everything)
Let me explain each change and show you how to handle it.
Change 1: strict mode enabled by default
Before (TypeScript 5.9)
{ "compilerOptions": { // strict defaults to false }}When you created a new project, you had to manually enable strict mode. Most developers copied the same configuration across projects because the defaults were too loose.
After (TypeScript 6.0)
{ "compilerOptions": { // strict is now true by default }}Now strict mode is enabled automatically. This catches more type errors at compile time.
What strict: true enables:
noImplicitAny- catches implicitanytypesstrictNullChecks- prevents null/undefined bugsstrictFunctionTypes- enforces function type correctnessstrictBindCallApply- fixescall(),apply(),bind()typingstrictPropertyInitialization- ensures class properties are initializednoImplicitThis- preventsthismisusealwaysStrict- emits “use strict” in all files
How to opt-out
If you need to disable strict mode (not recommended):
{ "compilerOptions": { "strict": false }}Change 2: ESM modules by default
Before (TypeScript 5.9)
{ "compilerOptions": { "module": "commonjs }}The default was CommonJS, Node.js’s old module system. This made sense years ago when CommonJS was dominant. Not anymore.
After (TypeScript 6.0)
{ "compilerOptions": { "module": "esnext }}ESM (ECMAScript Modules) is now the standard for both browsers and Node.js. Bundlers like Vite, webpack, and esbuild prefer ESM input. Tree-shaking works better with ESM. Top-level await requires ESM.
How to opt-out
If you need CommonJS:
{ "compilerOptions": { "module": "commonjs }}Change 3: ES2025 target by default
Before (TypeScript 5.9)
{ "compilerOptions": { "target": "es2015 }}TypeScript targeted 9-year-old JavaScript by default. This generated unnecessary polyfill code.
After (TypeScript 6.0)
{ "compilerOptions": { "target": "es2025 }}Evergreen browsers support modern JavaScript. You don’t need to transpile to decade-old standards by default.
What ES2025 includes:
RegExp.escape()- safely escape regex stringsPromise.try()- better promise handling- New
SetandIteratormethods - Temporal API types
How to opt-out
If you need to support older runtimes:
{ "compilerOptions": { "target": "es2015 }}Change 4: rootDir defaults to .
Before (TypeScript 5.9)
TypeScript inferred rootDir by analyzing all input files and finding their common directory. This caused problems:
- Impossible to know project structure without parsing files
- Performance overhead analyzing every file path
- Unpredictable output structure
After (TypeScript 6.0)
rootDir defaults to . (the directory containing tsconfig.json).
This can break your output structure if you’re not careful.
Example scenario:
Your project structure:
my-project/├── tsconfig.json├── src/│ └── index.ts└── dist/Before (inferred)
{ "compilerOptions": { // rootDir inferred as "./src" automatically }}Output: dist/index.js ✓
After (explicit default)
{ "compilerOptions": { // rootDir defaults to "." (folder with tsconfig.json) }}Output: dist/src/index.js ✗ (wrong structure!)
Fix
Set rootDir explicitly:
{ "compilerOptions": { "rootDir": "./src }, "include": ["./src"]}Output: dist/index.js ✓
Change 5: types defaults to empty array
This is the most disruptive change.
Before (TypeScript 5.9)
TypeScript auto-included every package in node_modules/@types by default.
{ "compilerOptions": { // types defaults to ["*"] - loads EVERYTHING }}In a typical monorepo, you might have hundreds of @types packages:
@types/node@types/jest@types/react@types/lodash- …plus 200+ transitively installed types
All of these were loaded into every compilation, even if you didn’t use them.
After (TypeScript 6.0)
{ "compilerOptions": { "types": [] // empty by default }}You must explicitly list what you need.
Fix
Add the types you use:
{ "compilerOptions": { "types": ["node", "jest"] }}Restore old behavior
If you want to load everything (not recommended):
{ "compilerOptions": { "types": ["*"] }}Performance impact
The TypeScript team stated:
“Many projects we’ve looked at have improved their build time anywhere from 20-50% just by setting
typesappropriately.
How to diagnose missing types
If you see errors like:
Cannot find name 'process'. Do you need to install type definitions for node?Cannot find name 'describe'. Do you need to install type definitions for a test runner?Cannot find module 'fs'.Add the appropriate types to your tsconfig:
{ "compilerOptions": { "types": ["node", "jest"] }}Migration example
Before (TypeScript 5.9)
{ "compilerOptions": { "target": "es2015", "module": "commonjs", "lib": ["es2015"], "outDir": "./dist", "rootDir": "./src", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, "include": ["src/**/*"]}After (TypeScript 6.0)
{ "compilerOptions": { // These are now defaults (removed): // "strict": true, // "module": "esnext", // "target": "es2025", // "esModuleInterop": true,
// Keep these: "outDir": "./dist", "rootDir": "./src", "lib": ["es2025"], "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "moduleResolution": "node10",
// Critical - now required: "types": ["node"] }, "include": ["src/**/*"]}What changed:
- Removed
strict: true(now default) - Removed
module: "commonjs"(now"esnext") - Removed
target: "es2015"(now"es2025") - Removed
esModuleInterop(alwaystruenow) - Added
types: ["node"](was auto-included before)
New project example
With TypeScript 6.0, a minimal tsconfig is much smaller:
{ "compilerOptions": { "rootDir": "./src", "types": ["node", "jest"], "outDir": "./dist", "moduleResolution": "bundler }, "include": ["./src"]}All the modern defaults are already set:
strict: truemodule: "esnext"target: "es2025"
You only specify what’s different.
Summary
In this post, I explained the five new default compiler options in TypeScript 6.0. The key point is that the new defaults align with modern JavaScript development in 2026.
For new projects: You get better defaults immediately. No more copying the same strict config across projects.
For existing projects: You may need to add types arrays or set rootDir explicitly. Most other changes are improvements you already want.
Performance gain: Expect 20-50% faster builds if you were previously auto-loading many @types packages.
The new defaults reflect 2026’s JavaScript ecosystem, not 2015’s.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments