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

chore: move exports.types field to first spot @ package.json. #2443

Merged
merged 2 commits into from May 21, 2023

Conversation

igalklebanov
Copy link
Contributor

@igalklebanov igalklebanov commented May 18, 2023

Hey 👋

This PR re-arranges package.json's exports object key order and sets types field to first.

This is recommended by TypeScript's official documentation.

The "types" condition should always come first in "exports".
https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing

Ensure types condition to be the first. The TypeScript docs recommends so, but it's also because the exports field is order-based.
For example, a scenario where both the types and import condition could be active, types should be first so that it matches and returns a .d.ts file, rather than a .js file from the import condition.
https://publint.dev/rules#exports_types_should_be_first

@netlify
Copy link

netlify bot commented May 18, 2023

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 96da74d
🔍 Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/64667befb3757d0008542830
😎 Deploy Preview https://deploy-preview-2443--guileless-rolypoly-866f8a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@igalklebanov igalklebanov changed the title chore: move exports.types field to first spot @ package.json. chore: move exports.types field to first spot @ package.json. May 18, 2023
@colinhacks colinhacks merged commit 0a90ed1 into colinhacks:master May 21, 2023
13 checks passed
@colinhacks
Copy link
Owner

Thanks!

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.

None yet

2 participants