arethetypeswrong / arethetypeswrong.github.io

Tool for analyzing TypeScript types of npm packages
https://arethetypeswrong.github.io
MIT License
1.18k stars 41 forks source link

Conditional exports syntax #165

Closed barnjamin closed 7 months ago

barnjamin commented 7 months ago

Something I just encountered was a strict interpretation of the exports package field syntax such that the resolver aborted with the message

Module not found: Default condition should be last one

Indeed it is documented that it should come last

"default" - the generic fallback that always matches. Can be a CommonJS or ES module file. This condition should always come last.

I'm not sure this falls into the category of bugs this project aims to detect but if so, it seems like a nice one to warn folks about.

andrewbranch commented 7 months ago

Interesting. I feel like that might be a better fit for https://publint.dev (which may already include that check)