omgovich / colord

👑 A tiny yet powerful tool for high-performance color manipulations and conversions
https://colord.omgovich.ru
MIT License
1.63k stars 48 forks source link

Types not compatible with moduleResolution Node16 #101

Open privatenumber opened 1 year ago

privatenumber commented 1 year ago

The export map specifies the types incorrectly: https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/package.json#L32-L98

You can verify that it's not working by setting compilerOptions.moduleResolution to Node16.

It should look closer to:

    "exports": {
        "require": {
            "types": "./dist/index.d.cts",
            "default": "./dist/index.cjs"
        },
        "import": {
            "types": "./dist/index.d.mts",
            "default": "./dist/index.mjs"
        }
    },

Detailed explanation here: https://github.com/microsoft/TypeScript/issues/50067