Skip to content

chore: update main field in package.json #73

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ClementMindflow
Copy link

@ClementMindflow ClementMindflow commented Jun 10, 2021

When using this plugin with node 16.2.0 , i get the following warning:

(node:64536) [DEP0128] DeprecationWarning: Invalid 'main' field in '......./eslint-plugin-react-redux/package.json' of 'dist/index.js'. Please either fix that or report it to the module author

It seems like the dist folder should be created by the build script but:

  • This build script is not called in a prepublish step
  • The dist folder is not part of the package shipped on npm

I guess that's a mistake, so this PR just remove the main field in package.json.
According to the node resolution algorithm, the root index.js file should be used as the module entrypoint.

In my case that fix the warning.

@ljharb
Copy link
Collaborator

ljharb commented Jun 10, 2021

Definitely do not remove the “main” field. Either explicitly point it at the correct location, or fix the bug that causes this location not to exist.

@ClementMindflow ClementMindflow changed the title chore: remove main field in package.json chore: update main field in package.json Jun 11, 2021
@ClementMindflow
Copy link
Author

@ljharb I've restored the main field and set it to point directly to index.js.

Just curious, but why do you think it's preferable to keep the main field pointing to index.js instead of letting node resolving it by default ? For sake of explicitness ?

@ljharb
Copy link
Collaborator

ljharb commented Jun 11, 2021

Yes, exactly.

@ClementMindflow
Copy link
Author

Test for version 7.x are failing, i do not think it's related to my changes as the same issue occurs on other MR created by dependabot.

I'd really like to see this MR merged but i really don't know how to fix that.

@DianaSuvorova @ljharb how can i help ? Can we merge it anyway ?

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