fetch-mock icon indicating copy to clipboard operation
fetch-mock copied to clipboard

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

Open lyleunderwood opened this issue 4 years ago • 0 comments

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

https://github.com/wheresrhys/fetch-mock/blob/4b54e6db42a3e87700ef37a27a7a4d7df29cb3d7/Makefile#L50

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.

lyleunderwood avatar May 31 '21 02:05 lyleunderwood