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

Assignees

No one assigned

    Labels

    area: repository toolingconcerning ease of contributionsemver-majorimplementation requires increase of "major" version number; "breaking changes"status: accepting prsMocha can use your help with this one!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions