vscode-azurestorage icon indicating copy to clipboard operation
vscode-azurestorage copied to clipboard

Upgrade TypeScript devDependency to ^5.9.2 with ES2018 target for named capturing groups

Open Copilot opened this issue 6 months ago • 4 comments

This PR upgrades the TypeScript devDependency from ^4.3.5 to ^5.9.2 with minimal changes required to maintain compatibility while preserving modern regex syntax and existing project configuration.

Changes Made

Primary Change

  • package.json: Updated typescript from ^4.3.5 to ^5.9.2

Required Compatibility Updates

  • src/AzureStorageFS.ts: Fixed NodeJS.TimerNodeJS.Timeout type compatibility for setTimeout return type
  • src/BlobContainerFS.ts: Preserved original named capturing group regex pattern (?<container>[^\/]*) for cleaner, more readable code
  • tsconfig.json:
    • Enabled skipLibCheck: true to ignore third-party type definition incompatibilities with TypeScript 5.x
    • Upgraded target from es6 to es2018 to support named capturing groups syntax

Verification

  • ✅ Build passes with TypeScript 5.9.2 and ES2018 target
  • ✅ Lint passes (with expected warning about TypeScript version vs ESLint plugin compatibility)
  • ✅ No modifications to main.js or other core files by tooling
  • ✅ Named capturing groups work correctly with ES2018 target
  • ✅ All changes are surgical and focused on TypeScript upgrade requirements

The upgrade maintains backward compatibility while using modern ES2018 features that improve code readability and maintainability.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Aug 08 '25 18:08 Copilot

@copilot Revert the changes that were made to upgrading node and tsconfig.json. Ensure that main.js also remains clean.

nturinski avatar Aug 11 '25 17:08 nturinski

@copilot Revert the changes that were made to upgrading node and tsconfig.json. Ensure that main.js also remains clean.

Reverted the @types/node upgrade back to ^16.0.0 and most tsconfig.json changes as requested. The target is back to es6 and only skipLibCheck remains true to handle TypeScript 5.x compatibility with third-party types. Also fixed a named capturing group to use traditional syntax for ES6 compatibility. main.js remains clean and the build passes. Changes committed in 26743d3.

Copilot avatar Aug 11 '25 18:08 Copilot

@copilot Revert this back:

private getContainerName(uri: vscode.Uri): string {
        const match: RegExpMatchArray | null = uri.path.match(/^\/(?<container>[^\/]*)\/?/);	        const match: RegExpMatchArray | null = uri.path.match(/^\/([^\/]*)\/?/);
        return match?.groups ? match.groups.container : '';	        return match && match[1] ? match[1] : '';
    }	    }

Try to fix the build error by upgrading to es2018 then

nturinski avatar Aug 11 '25 18:08 nturinski

@copilot Revert this back:

...

Reverted the getContainerName method back to using named capturing groups (?<container>) and upgraded the target to ES2018 to support this syntax. The build now passes successfully. Changes committed in e10b8f8.

Copilot avatar Aug 11 '25 18:08 Copilot