Loading...
Loading...
TypeScript 6+ guidance for project development, tsconfig configuration, diagnostics, module resolution, deprecations, and modern standard-library typings. Use when building or maintaining TypeScript 6+ projects, debugging compiler behavior, or working through TS 6-specific defaults and tooling such as `#/` subpath imports, `ignoreDeprecations`, `RegExp.escape`, `Temporal`, and `--stableTypeOrdering`. Triggers on typescript 6, ts 6, stableTypeOrdering, ignoreDeprecations, types array, noUncheckedSideEffectImports, baseUrl deprecated, moduleResolution node deprecated, and subpath imports.
npx skill4agent add nodnarbnitram/claude-code-extensions typescript-v6Build, configure, and debug TypeScript 6+ projects with precise compiler guidance and modern module/runtime patterns.
| Metric | Without Skill | With Skill |
|---|---|---|
| Upgrade Investigation Time | ~90 min | ~30 min |
| Common tsconfig Regressions | 5+ | 0-1 |
| Token Usage | High (manual diffing) | Low (release-note-grounded guidance) |
typesdist/src/...rootDirmoduleResolution nodebaseUrlbundlernodenextignoreDeprecations: "6.0"--stableTypeOrderingtypes{
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"types": ["node"],
"strict": true
},
"include": ["src/**/*"]
}rootDirtypes{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
}
}moduleResolution: "node""node10"bundlernodenextconst escaped = RegExp.escape('(hello)');
const value = new Map<string, number>().getOrInsert('count', 0);
const tomorrow = Temporal.Now.instant().add({ hours: 24 });npx tsc --noEmit
npx tsc --showConfig
npx tsc --explainFilesrootDirtsconfig.jsontypesmoduleResolution: "bundler"moduleResolution: "nodenext"ignoreDeprecations: "6.0"pathsbaseUrltypesTemporalgetOrInsertRegExp.escape--stableTypeOrderingsatisfiesnevertsc --noEmitmoduleResolution: "node""node10"moduleResolution: "classic"types@types/nodeignoreDeprecations: "6.0"skipDefaultLibCheckdownlevelIteration{
"compilerOptions": {
"outDir": "./dist"
}
}{
"compilerOptions": {
"outDir": "./dist",
"types": ["node"]
}
}types{
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"@app/*": ["app/*"]
}
}
}paths{
"compilerOptions": {
"paths": {
"@app/*": ["./src/app/*"]
}
}
}baseUrlpathsconst compilerMode = {
moduleResolution: 'bundler',
strict: true,
};const compilerMode = {
moduleResolution: 'bundler',
strict: true,
} satisfies {
moduleResolution: 'bundler' | 'nodenext';
strict: boolean;
};satisfiestype ResolutionMode = 'bundler' | 'nodenext' | 'preserve';
function describeMode(mode: ResolutionMode) {
if (mode === 'bundler') return 'bundled app';
return 'node-style runtime';
}type ResolutionMode = 'bundler' | 'nodenext' | 'preserve';
function describeMode(mode: ResolutionMode) {
switch (mode) {
case 'bundler':
return 'bundled app';
case 'nodenext':
return 'node-style runtime';
case 'preserve':
return 'mixed emit strategy';
default: {
const exhaustive: never = mode;
return exhaustive;
}
}
}neverstableTypeOrderingtsc --stableTypeOrdering --buildtsc --noEmit --stableTypeOrdering| Issue | Root Cause | Solution |
|---|---|---|
| The project relied on ambient type discovery that is no longer safe to assume during TS 6 migration work | Add explicit entries like |
Output moves to | The project relied on inferred source-root behavior that TS 6 migration work often needs to replace with explicit config | Set |
| Upgrade warnings explode | Deprecated module resolution or emit-era options survived from older configs | Migrate to |
| Side-effect imports suddenly error | Side-effect import checking is stricter in TS 6+ projects | Fix typos, add explicit files, or tighten import paths intentionally |
| Runtime or resolution mode does not match TS 6 support requirements | Use Node 20+ support with |
| New ES APIs compile but fail at runtime | TS lib types are present, runtime support is not | Verify runtime compatibility and polyfill strategy separately |
| Type ordering changes create noisy diffs | TS 6/TS 7 ordering differs during migration experiments | Use |
references/migration-v6-reference.mdreferences/defaults-migration-reference.mdreferences/deprecations-reference.md#/references/module-resolution-imports-reference.mdreferences/stdlib-types-reference.mdreferences/workflow-diagnostics-reference.mdreferences/type-patterns-reference.mdstableTypeOrderingreferences/stable-ordering-ts7-reference.mdreferences/README.md{
"compilerOptions": {
"target": "es2025",
"module": "esnext",
"moduleResolution": "bundler",
"lib": ["es2025", "dom"],
"rootDir": "./src",
"outDir": "./dist",
"strict": true,
"noUncheckedSideEffectImports": true
},
"include": ["src/**/*"]
}rootDirdist/src/...typesmoduleResolution: "bundler"target: "es2025"lib: ["es2025", ...]RegExp.escape{
"compilerOptions": {
"target": "es2022",
"module": "nodenext",
"moduleResolution": "nodenext",
"lib": ["es2022"],
"rootDir": "./src",
"outDir": "./dist",
"types": ["node"],
"strict": true
},
"include": ["src/**/*"]
}nodenext.jspackage.jsonmy-ts-project/
├── src/
├── dist/
├── package.json
└── tsconfig.jsonpaths{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}baseUrl#/{
"name": "my-package",
"type": "module",
"imports": {
"#/*": "./dist/*"
}
}import * as utils from '#/utils.js';imports{
"compilerOptions": {
"ignoreDeprecations": "6.0"
}
}{
"compilerOptions": {
"composite": true,
"declaration": true,
"isolatedDeclarations": true,
"rootDir": "./src",
"outDir": "./dist"
}
}.d.tsisolatedDeclarationsnpx tsc --noEmit
npx tsc --showConfig
npx tsc --explainFiles
npx tsc --traceResolution--noEmit--showConfig--explainFiles--traceResolutionpathstypes#/types@types/*rootDirignoreDeprecations: "6.0"RegExp.escapeTemporalgetOrInsertrootDirtsconfig.jsontypesmoduleResolutionbundlernodenextnodenode10classicskipDefaultLibCheckdownlevelIterationbaseUrldownlevelIterationtsc --showConfigtsc --explainFilesignoreDeprecations: "6.0"--stableTypeOrdering