A check that any commit that stages package.json dependency changes also changes yarn.lock
npm install check-yarn-lockWhenever changes are made to one of package.json's dependency properties, if no change is staged in yarn.lock as well, this program emits an error message.
To use a commit hook, add an execution check-yarn-lock to your repository's pre-commit hook.
This can be made easier using husky.