One interesting feature in a package.json
file is the ability to include a types property:
...
"types": "index.d.ts"
...
However, it seems like there are no strict requirements on what this types file contains. It doesn't necessarily have to match the actual exports of the module or be valid.
The problem I encountered was due to not updating the types
file after renaming an exported file. This led to import failures when using the module later.
What I'm looking for now is a way to automatically test whether the file referenced by the types
property accurately represents the module's exports.