Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort conditional exports objects #239

Open
jonahsnider opened this issue Jan 10, 2022 · 1 comment
Open

Sort conditional exports objects #239

jonahsnider opened this issue Jan 10, 2022 · 1 comment

Comments

@jonahsnider
Copy link

jonahsnider commented Jan 10, 2022

The default field should be sorted to appear last in the a conditional exports object.
Additionally, the types field should be sorted to appear first when present.

The Node.js documentation has some information on ordering rules:

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

Nested conditions should also be sorted.

Related to #197

@jonahsnider jonahsnider changed the title Sort exports.default to appear last inexports Sort conditional exports objects Jan 10, 2022
@keithamus
Copy link
Owner

PRs welcome! I think also getting opinions from folks in #197 (@dandv, @Xunnamius) would be useful.

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

No branches or pull requests

2 participants