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

Is there a reason for partial package.json in dist directory? #613

Open
lyleunderwood opened this issue May 31, 2021 · 0 comments
Open

Is there a reason for partial package.json in dist directory? #613

lyleunderwood opened this issue May 31, 2021 · 0 comments

Comments

@lyleunderwood
Copy link

lyleunderwood commented May 31, 2021

This package seems to ship with a partial package.json in the dist directory because of this line:

echo '{"type": "module"}' > esm/package.json

I was having several weird eslint issue around this package, and I think I've tracked them down to this. This isn't a valid package.json file according to npm docs.

The popular eslint plugin eslint-plugin-import attempts to find package names from resolved file paths:

https://github.com/benmosher/eslint-plugin-import/blob/7aea664b8f6859aa9e8a0d808ab71cf96576f299/src/core/packagePath.js#L15-L18

This means in certain cases eslint will find this bad package.json and not be able to find a package name for the corresponding file.

It seems like ideally there would be no package.json included in the dist directory, but if one is necessary it should probably be complete and valid. If a direction can be decided upon here I can probably work on a PR.

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

No branches or pull requests

2 participants