-
-
Notifications
You must be signed in to change notification settings - Fork 22
feat: Add codemod for DEP0185 - Instantiating node:repl classes without new
#242
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: AugustinMauroy <[email protected]>
node:repl classes without new
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.
@copilot could you allow the codemod to support dynamic import
…ove README and update author Co-authored-by: AugustinMauroy <[email protected]>
Added support for dynamic imports using Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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.
WOW that suprisingliy cool
LGMT
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.
ai is crazy
I just prompt "take example of recipes/http-classes-with-new" |
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.
Wow 😳 Aside from authorship, this looks fine
Co-authored-by: AugustinMauroy <[email protected]>
|
need a fresh approval then we can merge and publish |
Implementation Summary
Successfully implemented a codemod for DEP0185 with all requested features:
✅ Handles both
REPLServerandRecoverableclasses✅ Supports CommonJS imports (
require("node:repl"))✅ Supports ESM imports (
import { REPLServer } from "node:repl")✅ Supports dynamic imports (
await import("node:repl"))✅ Destructured imports work correctly
✅ Namespace imports work correctly
✅ Preserves constructor arguments
✅ Correctly skips cases that already have
new✅ Early return optimization when no imports present
✅ Updated README with consolidated example
✅ Author correctly attributed as "GitHub Copilot"
All tests pass and code quality checks pass.
Original prompt
Fixes #240
💡 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.