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

Add main field to package.json for compatibility #3128

Closed
wants to merge 1 commit into from
Closed

Add main field to package.json for compatibility #3128

wants to merge 1 commit into from

Conversation

Baune8D
Copy link

@Baune8D Baune8D commented Oct 27, 2022

Linting with eslint-plugin-import currently breaks with the error Unable to resolve path to module 'ava' import/no-unresolved when importing using CommonJS.

Since this package officially still supports CommonJS, adding back the main field will help with compatibility, and fix the above error.

@sindresorhus
Copy link
Member

exports works for CommonJS too. This is a problem with eslint-plugin-import.

@Baune8D
Copy link
Author

Baune8D commented Oct 27, 2022

exports works for CommonJS too. This is a problem with eslint-plugin-import.

Let me just refer to your answer on another thread chalk/chalk#536 (comment) were you mention main being useful for backwards compatibility with CommonJS, which is my point with this PR since ava does still support CommonJS officially.

But i do also understand your point that this should ultimatly be fixed in eslint-plugin-import, so just reject this PR if you wanna stand by that decision 👍 This just seems like an easy fix with no real downsides for now 🙂

@novemberborn
Copy link
Member

As far as I can tell, we've never had a main, and the exports were introduced in March 2021 #2729. Why is this an issue now?

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.

3 participants