Skip to content

Track TypeScript ES2025 target support #401

@nikblanchet

Description

@nikblanchet

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: es2025 is 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:

  1. Update tsconfig.json:

      "compilerOptions": {
    -   "target": "ES2024",
    -   "lib": ["ES2024"],
    +   "target": "ES2025",
    +   "lib": ["ES2025"],
  2. Verify compatibility:

    • npm run build
    • npm test
    • CI passes
  3. (Optional) Modernize code to use new ES2025 features where beneficial

Monitoring

Check periodically:

Related Issues

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCLI layer issuescode-qualityCode quality and maintainability improvementseffort-smallSmall effort: <2 hoursenhancementNew feature or requestimpact-lowLow impact on users or systemscheduledScheduled for future date - not ready to start yettypescriptTypeScript-specific issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions