-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Objective
Track when TypeScript adds official ES2025 target support and upgrade when available.
Background
ES2025 was officially finalized on June 25, 2025 by the 129th ECMA General Assembly. However, TypeScript 5.9.3 (latest stable as of November 2025) does not yet support ES2025 as a target option - only up to ES2024 or ESNext.
TypeScript Support Status
- Current: TypeScript 5.9.3 supports targets:
es5, es6, es2015...es2024, esnext - Missing:
es2025is not a valid target yet - Tracking: microsoft/TypeScript#61735 - "Add ES2025 target and library"
- Status: In backlog with "Help Wanted" label, 30+ community reactions
ES2025 Features Beneficial to DocImp
Analysis of the codebase shows several ES2025 features that could improve code quality:
1. Set Methods (9 files use Sets)
Files: file-tracker.ts, interactive-session.ts, plugin-manager.ts, plan.ts, improve.ts, audit.ts, analyze.ts
New methods: intersection(), union(), difference(), symmetricDifference(), isSubsetOf(), isSupersetOf(), isDisjointFrom()
Example improvement:
// Before (ES2024)
const intersection = new Set([...setA].filter(x => setB.has(x)));
// After (ES2025)
const intersection = setA.intersection(setB);2. Iterator Helpers (36 files use iterators)
New methods: .map(), .filter(), .take(), .drop(), .forEach() directly on iterators
Example improvement:
// Before (ES2024) - must convert to array first
const first5 = [...map.entries()].slice(0, 5);
// After (ES2025) - chain directly on iterator
const first5 = map.entries().take(5).toArray();3. Promise.try()
Cleaner promise initialization without try/catch wrapper:
// Before
new Promise((resolve, reject) => {
try { resolve(syncOrAsyncFn()); }
catch (e) { reject(e); }
});
// After (ES2025)
Promise.try(syncOrAsyncFn);4. RegExp.escape()
Safer regex construction from user input (useful for file pattern matching):
// Before - manual escaping
const escaped = str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
// After (ES2025)
const escaped = RegExp.escape(str);Implementation Plan
When TypeScript adds ES2025 support:
-
Update tsconfig.json:
"compilerOptions": { - "target": "ES2024", - "lib": ["ES2024"], + "target": "ES2025", + "lib": ["ES2025"], -
Verify compatibility:
npm run buildnpm test- CI passes
-
(Optional) Modernize code to use new ES2025 features where beneficial
Monitoring
Check periodically:
Related Issues
- Pin Node version to 24.x to prevent accidental Node 25 installation #336 - Pin Node version to 24.x (completed)
- Upgrade TypeScript target to ES2024 and update CLI dependencies #362 - TypeScript target ES2024 upgrade (completed)
- Upgrade Node 24 → 25 (Scheduled: April 15, 2026) #356 - Node 25 upgrade (scheduled April 2026)