Skip to content

Warn when package.json contains an invalid "type" value #60085

@velle

Description

@velle

What is the problem this feature will solve?

Valid (meaningful) values are:

  • commonjs
  • module

I had set CommonJS, and it behaves the same as if type was unset, which is so close to the actual commonjs behavior, that I thought I had set it correctly. But I kept having cases resulting in the MODULE_TYPELESS_PACKAGE_JSON warning, instead of failing hard.

Note that while tsconfig.js ignores case, the canonical version is CommonJS, so I never considered that I was using incorrect case.

What is the feature you are proposing to solve the problem?

Raise warning/error if "type" is set, but value is none of commonjs or module.

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    Status

    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions