Skip to content

🛠️ Repo: Convert lib/utils.js to ESM #5964

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Sub-issue of #5400 (Switch from CJS to ESM internally).

lib/utils.js is a widely-consumed utility module still written in CJS. It exports many helper functions via exports.X and is a dependency across much of the core runtime.

File to convert

  • lib/utils.js

Notes

Per AGENTS.md CJS-to-ESM conventions:

  • Prefer named exports over export default
  • Rename to utils.mjs
  • Update all consumers to use const { ... } = require("./utils.mjs") (destructured named imports)
  • There are many call sites across lib/ — a search for require.*utils will surface them all

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions