Skip to content

Updates for main with no exports#21

Closed
benmccann wants to merge 1 commit intopublint:masterfrom
benmccann:main-no-exports
Closed

Updates for main with no exports#21
benmccann wants to merge 1 commit intopublint:masterfrom
benmccann:main-no-exports

Conversation

@benmccann
Copy link
Copy Markdown
Contributor

The current message is quite confusing to me because exports doesn't have anything to do with ESM. You can use it with CJS as well. This updates it to apply whether the code is CJS or ESM.

@bluwy
Copy link
Copy Markdown
Member

bluwy commented Jan 14, 2023

I think this PR changes the intent though. The idea was that if you have main but no exports, you should use exports instead. It looks like I didn't check this right, it should be if (expectFormat === 'ESM' && !exports) { 😦

I think we should fix it and keep it that way for now. The message needs an update too. I can fix this myself too.

With that said, I think the idea of this PR is good, but it'd need to be a new rule, and maybe apply to module field too.

@bluwy
Copy link
Copy Markdown
Member

bluwy commented Jan 14, 2023

Aight that's fixed at 57fdc43. Sorry for the new conflicts and thanks for spotting the bug 😬

@bluwy
Copy link
Copy Markdown
Member

bluwy commented Jan 16, 2023

I'll close this one for now and write a new issue so we keep track of this.

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