-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Remove any from terminal in server #276272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances type safety across the terminal subsystem by replacing any types with more appropriate TypeScript types (unknown, proper generics, and specific type definitions). The changes enable the removal of several files from the eslint ignore list for the @typescript-eslint/no-explicit-any rule.
Key changes:
- Replaced
anywithunknownfor untyped data in IPC channels and command execution contexts - Added default type parameter to
IProcessProperty<T>interface to make it more ergonomic - Introduced
ITraceRpcArgsinterface and improvedtraceRpcdecorator type safety with proper generic constraints - Updated event emitter types throughout the terminal codebase to remove explicit
anytype parameters
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| eslint.config.js | Removed 6 terminal-related files from @typescript-eslint/no-explicit-any exception list |
| src/vs/platform/terminal/common/terminal.ts | Added default type parameter to IProcessProperty<T> and removed any from event types |
| src/vs/platform/terminal/node/ptyHostService.ts | Removed any from onDidChangeProperty event type |
| src/vs/platform/terminal/node/ptyService.ts | Introduced ITraceRpcArgs interface, improved traceRpc decorator signature, and updated event/map types |
| src/vs/platform/terminal/node/terminalProcess.ts | Removed any from event emitter type and updated eslint disable comment with GitHub issue reference |
| src/vs/platform/terminal/node/windowsShellHelper.ts | Changed traverseTree parameter from any to proper WindowsProcessTreeType.IProcessTreeNode | undefined |
| src/vs/server/node/remoteTerminalChannel.ts | Replaced any with unknown throughout, added generic type parameter to listen method with type casts |
| src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts | Added type assertion to properly type the property value access |
Part of #274723
Merge first: