christopherthielen / check-peer-dependencies

Checks peer dependencies of the current NodeJS package. Offers solutions for any that are unmet.
MIT License
60 stars 19 forks source link

--install installs everything as non-dev dependency #21

Closed openreply-dleinhaeuser closed 2 years ago

openreply-dleinhaeuser commented 3 years ago

When using check-peer-dependencies --install it properly identifies and installs missing peer dependencies, however peer dependencies of dev-dependencies are not installed as dev-dependencies.

Example:

> npm install --save-dev eslint-config-airbnb on a freshly initialized otherwise empty project complains about missing peer dependencies

Expected behavior

> npx check-peer-dependencies --install installs missing peer dependencies of eslint-config-airbnb as dev-dependencies since it is itself a dev-dependency

Actual behavior

> npx check-peer-dependencies --install installs missing peer dependencies of eslint-config-airbnb as non-dev dependencies

christopherthielen commented 2 years ago

check-peer-dependencies does attempt to install as devDependencies if the peer dep is from a devDependency. Something must not be working correctly.

christopherthielen commented 2 years ago

note to self: npm install --save-dev eslint-config-airbnb installs all peer dependencies now (npm 8) so to reproduce, delete node_modules/eslint

christopherthielen commented 2 years ago

I misread the code, this isn't currently implemented. I agree it is the proper/desired behavior