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

Peer dependencies in npm 3+ #255

Closed
vsimonian opened this issue Sep 9, 2015 · 7 comments

Comments

@vsimonian
Copy link

commented Sep 9, 2015

Getting these warnings:

npm WARN peerDependencies The peer dependency eslint@>=0.24.1 included from eslint-config-standard-react will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint@^1.0.0 included from eslint-config-standard will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint@^1.0.0 included from eslint-plugin-standard will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
@dcousens

This comment has been minimized.

Copy link
Member

commented Sep 9, 2015

Indeed, seems a bit explicit?

feross added a commit to standard/eslint-config-standard that referenced this issue Sep 9, 2015

feross added a commit to standard/eslint-config-standard-react that referenced this issue Sep 9, 2015

@julien-f

This comment has been minimized.

Copy link

commented Sep 10, 2015

@feross I don't think removing the peer dependencies is a good idea, they are here to express the compatibility of the configs with specific versions of ESLint. However, what should be done is adding eslint as a dependency to standard.

@mcollina

This comment has been minimized.

Copy link

commented Sep 11, 2015

A good way to remove the peerDependency is to check for versions explicitly when we require those modules. An example on how this can be done is in levelup's codebase: https://github.com/Level/levelup/blob/master/lib/util.js#L28-L56

I would say that it is the best possible solution, peerdependencies do not really work in complex cases anyway.

@julien-f

This comment has been minimized.

Copy link

commented Sep 11, 2015

Hmmm, it seems like a bad idea doing this by hand when npm has a support for it.
And the use case here is far for complex: standard just requires eslint and eslint-config-*.

@julien-f

This comment has been minimized.

Copy link

commented Sep 11, 2015

LevelUp does it manually because it can work with other backends than LevelDown.

@mcollina

This comment has been minimized.

Copy link

commented Sep 11, 2015

I'm just saying that either:

  1. we add each peerDependency as dependency
  2. or we require and check those manually if they are needed.

The warning is quite annoying.

feross added a commit to standard/eslint-plugin-standard that referenced this issue Sep 16, 2015

@feross

This comment has been minimized.

Copy link
Member

commented Sep 22, 2015

These warnings are gone in the latest versions of standard. 👍

@julien-f It would be confusing to add eslint as a dependency to standard since the version that actually gets used is installed by standard-engine.

We want these shared configs to work with standard-engine and well as eslint directly. In this way, it's actually similar to the the leveldown backend situation.

@feross feross closed this Sep 22, 2015

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
5 participants
You can’t perform that action at this time.