Closed snitin315 closed 2 months ago
Updated 👍🏻
Looks like npm-license
expects dependencies to be installed in node_modules
of the start path. But in a workspaces monorepo, dependencies are installed in top-level node_modules
.
When I add console.log(Object.keys(deps));
here, it logs only:
[ 'eslint-scope@8.0.2' ]
In the old eslint-scope repo, it logs:
[ 'eslint-scope@8.0.2', 'esrecurse@4.3.0', 'estraverse@5.3.0' ]
So it seems that the license check effectively wouldn't work? I'm not sure how this could be fixed and whether we need a license check for the eslint-scope package. We have a license check in eslint/eslint, and eslint-scope seems to be the only other package with this check.
In a monorepo, all dependencies end up in the top-level node_modules
, so if we do the license check from the root of the repo, I think it should work.
Providing the top-level path here also didn't work, it was then outputting [ 'eslint-js@1.0.0' ]
only.
For now, I have passed additional metadata (See https://github.com/eslint/espree/pull/615/commits/64059749bc302488c024cb92099bc1709c824d9a) to keep the behavior the same as eslint-scope repo, I think we can follow up on this and see how it can be improved for monorepo.
@snitin315 are you still working on this?
@nzakas Yes, somehow I missed the last review notification. I've updated the PR, PTAL.
@aladdin-add Let's change the eslint/eslint-scope
to eslint/js
in a follow-up PR for all packages, once the repository has been renamed.
All right, moving this forward. I will rename the repo now.
Refers https://github.com/eslint/espree/issues/609