chore: migrate from CJS to ESM#456
Merged
lwasser merged 12 commits intoall-contributors:mainfrom Feb 27, 2026
Merged
Conversation
jdalrymple
approved these changes
Feb 26, 2026
Contributor
jdalrymple
left a comment
There was a problem hiding this comment.
I've read through it a few times, nothing seems off to me. I had to brush up on some of the babel config docs, but looks good!
Contributor
|
Ran it locally as well, looks good! |
lwasser
approved these changes
Feb 27, 2026
Member
lwasser
left a comment
There was a problem hiding this comment.
@JoshuaKGoldberg this looks great to me! I had to look up the add variable to ensure it wasn't a protected word / builtin function i'm so used to that in python. But this all looks great and i like the inline exports too!! Let's merge this given @jdalrymple already gave it a solid review and test and I just combed through the code as well. THANK YOU so much for this. It should unblock a lot of work around testing!! 🚀
This was referenced Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Switches CommonJS (CJS)
module.exports =andrequire()syntax to ECMAScript Modules (ESM)export ...andimport ....Fixes #435
Why:
ESM is the new standard for Node.js and other JavaScript application modules. It's a more precisely defined syntax that works better with tooling.
How:
package.jsonnow has"type": "module",to change files to ESM by default.jsfiles is migrated to the equivalent ESMdefaultexports and imports in favor of explicitly named onesI verified these changes by running commands like
node dist/cli.js add joshuakgoldberg codelocally.Checklist: