Skip to content

Conversation

@Harris-Miller
Copy link

This PR does a small but important backwards support update to package.json for some common node-resolvers in 3rd party utilities such as eslint

My understanding is that the default node/deno/bun resolvers, as well as for bundlers such as webpack, vite, rollup, etc, all know to prioritize "exports" and should never fallback to "main" ever, so setting "main" the same as "default" should be of no concern. Adding "main" back in is just for backwards support of older resolvers that don't yet meet current standards

@broofa
Copy link
Member

broofa commented Dec 11, 2025

Hi Harris, thanks for the contribution.

eslint-plugin-import uses a custom node-resolver that doesn't support "exports" correctly

Please lean on the eslint-plugin-import team to fix this problem. 'Not something I'm interested in addressing here.

See also #881.

typescript looks at "export[].types"

It looks like exports.types is an Angular thing . I'm struggling to find much evidence of it's use elsewhere. While I can see why exports.types might make sense (it's consistent with how ESM prefers to exposes the internals of a project), I think it's reasonable to look to the TS docs as the more authoritative source, and I don't see any mention of exports.types there.

Unless / until the TS team weighs in on this, I'm inclined to leave this as is.

... there was a bug in an older version of typescript where it wasn't

This projects supports typescript@>=5.2.2, soon to be typescript@>=5.3 (TS versions within the last two years.) Unless that "older version" falls within that range, it's not something I'm going to worry about.

@Harris-Miller
Copy link
Author

Welp worth a shot ¯\_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants