Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 7, 2025

This PR upgrades the project's TypeScript version from 5.1.3 to 5.9.2, bringing performance improvements and modern language features to the codebase.

Changes Made

Core Upgrade

  • TypeScript: Updated from ^5.1.3 to ^5.9.2 in package.json
  • Microsoft ESLint Config: Updated from 0.2.1 to 0.2.4 for better compatibility

TypeScript Configuration Updates

  • Compilation Target: Updated from "es6" to "es2018" to support modern JavaScript features including regex flags used in gulpfile
  • Library Checking: Enabled "skipLibCheck": true to handle type definition incompatibilities in external libraries that haven't been updated for TypeScript 5.9 yet

Code Compatibility Fixes

Fixed Buffer/Uint8Array type compatibility issues in src/commands/tags/TagFileSystem.ts that arose due to stricter type checking in TypeScript 5.9:

Before:

public async readFileImpl(_context: IActionContext, node: ITagsModel): Promise<Uint8Array> {
    const fileContent: string = this.getFileContentFromTags(await this.getTagsFromNode(node));
    return Buffer.from(fileContent); // TypeScript 5.9 error: Buffer not assignable to Uint8Array
}

const buf = Buffer.from(content, 0) // TypeScript 5.9 error: invalid overload

After:

public async readFileImpl(_context: IActionContext, node: ITagsModel): Promise<Uint8Array> {
    const fileContent: string = this.getFileContentFromTags(await this.getTagsFromNode(node));
    return new Uint8Array(Buffer.from(fileContent)); // Explicit conversion
}

const buf = Buffer.from(content.buffer, content.byteOffset, content.byteLength); // Proper buffer creation

Verification

All builds and workflows continue to function correctly:

  • ✅ TypeScript compilation (npm run build)
  • ✅ Webpack development build (npm run webpack)
  • ✅ Webpack production build (npm run webpack-prod)
  • ✅ ESLint linting (shows version support warnings but functions correctly)

Notes

ESLint displays warnings about TypeScript 5.9 not being officially supported by the current @typescript-eslint version, but linting continues to work correctly. The Microsoft ESLint configuration currently constrains the TypeScript ESLint plugin to v5.x, which is sufficient for this upgrade.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: node ./out/test/runTest.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Can you upgrade my project to TypeScript 5.9? Upgrade TypeScript from 5.1.3 to 5.9.2 Aug 7, 2025
Copilot AI requested a review from alexweininger August 7, 2025 21:29
Copilot finished work on behalf of alexweininger August 7, 2025 21:29
@bwateratmsft bwateratmsft deleted the copilot/fix-6891a5c4-5059-4c06-8d91-84994fda061c branch October 30, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants