Skip to content

🛠 Repo: Add explicit type: 'commonjs'/'module' to all package.json files #113

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Tooling Suggestion Checklist

Overview

In the latest versions of Node 23, I'm seeing in some packages warnings like:

(node:12365) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12365) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///Users/josh/repos/mocha-examples/packages/typescript/src/index.spec.ts is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /Users/josh/repos/mocha-examples/packages/typescript/package.json.

This does not reproduce on older versions of Node, such as 20.10.0.

Proposal: let's do what the warning suggests and add explicit "type"s to the package.json files?

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions