-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Labels
Description
Please confirm that you have searched existing issues in the repo
Yes, I have searched the existing issues
Any related issues?
This is a sub issue and blocker for #2615
What is the area that this feature belongs to?
Code Quality
Is your feature request related to a problem? Please describe.
We are currently using legacy CommonJS syntax (require/module.exports) throughout the project. While this works with our current build configuration, it is creating significant technical debt and blocking our migration to ES Modules (ESM).
- Ultimately we want to switch our build output to native ES Modules (ESM) to support modern environments and tree-shaking.
- However, TypeScript does not automatically rewrite CommonJS runtime syntax such as require and module.exports. If we emit ESM without first refactoring these usages to import/export, the generated code will fail at runtime because require is not available in native ESM.
--
- However, TypeScript does not automatically rewrite CommonJS runtime syntax such as require and module.exports. If we emit ESM without first refactoring these usages to import/export, the generated code will fail at runtime because require is not available in native ESM.
Describe the solution you'd like
Standardize on the ES Module syntax (import / export) immediately. Decouples the syntax migration from the configuration migration, allowing us to safely adopt modern syntax now while maintaining our current build pipeline.
- Refactor Syntax: Systematically replace require statements with import statements.
- Add Type Definitions: Create local .d.ts files for untyped dependencies to ensure the new import syntax is fully typed. (Need to find a suitable place and configs appropriately)
--
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status