Bug: Multiple packageDirs in no-extraneous-dependencies #1175
Closed
Description
According to the docs, packageDirs accepts an array of paths, and (presumably) the package.json's found at all the paths have some effect.
In the current implementation, only the last element in the array is used.
This is because Object.assign()
is used to merge the dependencies found in each file. As Object.assign()
performs a shallow merge, and the extractDepFields function adds default empty objects for fields that are not defined in package.json
, every field ends up being overridden in each iteration.
I suggest that a deep merge be performed here instead of Object.assign
.
Metadata
Assignees
Labels
No labels