Similar to how there is a depchecks script, I have made the following depchecks-fix script for a project I am working on which I thought might be useful to have upstream.
The idea is that it will go through each module, run yarn add on the missing deps and run yarn remove on any unneeded deps. In my case since all dev dependencies should be listed in the main package.json for the repo; I remove the devDependencies of any packages in the repo.
Similar to how there is a
depchecks
script, I have made the followingdepchecks-fix
script for a project I am working on which I thought might be useful to have upstream.The idea is that it will go through each module, run
yarn add
on the missing deps and runyarn remove
on any unneeded deps. In my case since all dev dependencies should be listed in the mainpackage.json
for the repo; I remove the devDependencies of any packages in the repo.My current implementation is