Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove jest-validate peer deps #17

Closed
wants to merge 1 commit into from

Conversation

unional
Copy link

@unional unional commented Nov 27, 2022

The peer deps of jest-validate is actually not needed.

jest-validate will always present in the consuming repo since jest transiently include it as dep:

jest -> jest-cli -> jest-validate

https://github.com/facebook/jest/blob/main/packages/jest/package.json
https://github.com/facebook/jest/blob/main/packages/jest-cli/package.json

This will get rid of the unnecessary peer dep warning.

Fixes #19

@SimenB
Copy link
Member

SimenB commented Jan 14, 2023

We use jest-validate and shouldn't rely on hoisting. If anything, a regular dependency should be added rather than the peer dep

@unional
Copy link
Author

unional commented Jan 15, 2023

It depends on how you look at it. IMO this is a plugin so if adding jest-validate as a regular dependency you will end up with version compatibility issue, unless it is "jest-validate": "*".

I think the issue is actually at jest side, where in a plugin system it might work better if all code needed by plugins are exported at one place, e.g.:

import { ValidationError } from 'jest' 

Then it is very clear that it should be a peer dependency.

@tdd tdd closed this Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The peer deps of jest-validate not needed.
3 participants