[Feature request] Fail command if peer deps are not met
danielfigueiredo opened this issue · comments
Hi there, thanks for writing this lib! One thing that would be really helpful is to automate this check on CI, to prevent merges with peer dependencies not met.
There are ways obviously to store the output of this lib and parse the file, but it would be awesome to:
- Have some error code to identify when they are not met for easy grep. I think right now the only indicator it is not met is the ❌ at the beginning of the line.
- Fail the process with exit code 1 so that we know it failed to verify peer deps are met. This could be an optional flag for backwards compatibility, but it would be very helpful!
Thanks!
Maybe exactly the same as is done for yarn-deduplicate
with --fail
option: https://github.com/scinos/yarn-deduplicate#usage-in-ci. Supporting --fail
would be a backwards compatible change as well as nothing would change when that is not supplied.
And while testing this library out actually, I just realized that this is already supported? Call fails with process.exit(1)
if there are peer warnings: https://github.com/christopherthielen/check-peer-dependencies/blob/master/src/checkPeerDependencies.ts#L171.
Yes, as @gonadarian noticed, the process already exits with non-zero error code if anything fails, or peer deps are unsatisfied.