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

How to tell sherif to ignore peerDepedencies #61

Closed
KevinVandy opened this issue Mar 19, 2024 · 5 comments
Closed

How to tell sherif to ignore peerDepedencies #61

KevinVandy opened this issue Mar 19, 2024 · 5 comments

Comments

@KevinVandy
Copy link

Just upgraded to the latest version of sherif. How can we tell sherif to ignore the versions of peer dependencies? They should not be considered IMO.

⨯ error Dependency react has multiple versions defined in the workspace. multiple-dependency-versions
  ./packages
      react-table               >=16.8   ↓ lowest
      react-table-devtools      >=16.8   ↓ lowest
  ./examples/react
      basic                     ^18.2.0   ↑ highest
      bootstrap                 ^18.2.0   ↑ highest
      column-dnd                ^18.2.0   ↑ highest
      column-groups             ^18.2.0   ↑ highest
image
@QuiiBz
Copy link
Owner

QuiiBz commented Mar 21, 2024

You can use --ignore-dependency (or -i) followed by the package name to ignore it.

It was requested in #49 but I'm actually not sure if we should keep it or not.

@KevinVandy
Copy link
Author

Maybe a config option? I feel like this would be a common requirement. Maybe even make checking peerDependency opt in?

I think it's the norm, especially in repos for npm packages, to have a different version specifyer than an exact version in the peerDependency fields.

@QuiiBz
Copy link
Owner

QuiiBz commented Mar 21, 2024

One of the goal of this project is to avoid as much as possible for users the need to use cli options, or to introduce a configuration file. But I agree with you that Sherif should be smarter here, and not error.

@moltar
Copy link

moltar commented Apr 7, 2024

Yes, this rule is problematic and IMO wrong.

When you define peers, you typically want to specify the version using a caret, e.g. ^10.3.0.

And then you want to install the exact pinned version (10.3.0) as a devDep to develop against to ensure that the package being developed adheres to the minimum peer version.

Currently, sherif will flag it as an issue.

⨯ error Dependency constructs has multiple versions defined in the workspace. multiple-dependency-versions

@QuiiBz
Copy link
Owner

QuiiBz commented Apr 13, 2024

Sorry for the delay, I reverted #49 and released https://github.com/QuiiBz/sherif/releases/tag/v0.8.4

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

No branches or pull requests

3 participants