Skip to content

ESM types are wrong #205

@wooorm

Description

@wooorm

Expected Behavior

Be able to use the default normally from ESM.

Actual Behavior

The CJS types are specified for ESM users.
But the CJS types are for CJS, not for ESM.

Steps to Reproduce

Should be possible to reproduce from any ESM file.

Reproducible Demo

syntax-tree/hast-util-to-jsx-runtime@89b9292

Environment

n/a

Keywords

Extra

a) you can drop the root types field in package.json
b) generate an esm/index.d.mts
c) you can drop the exports.types fields, they are the defaults for cjs/index.js -> cjs/index.d.ts, esm/index.mjs -> esm/index.d.mts

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions