charlierudolph / dependency-lint

Lints NPM dependencies and devDependencies
MIT License
14 stars 6 forks source link

[super minor] fix error when duplicate devDep has higher version #39

Closed tychedelia closed 7 years ago

tychedelia commented 7 years ago

Given the following situation:

dependencies: {
  "myModule": "0.9.1"
},
devDependencies: {
  "myModule": "1.0.0"
}

the linter will check for installed version 1.0.0, even though npm resolves duplicate modules in favor of the non-dev dependency version. This error incorrectly suggests that the wrong version is installed (i.e. 0.9.1), when it should instead suggest that MyModule be moved to dependencies.

This scenario is a bit contrived and a result of user error, but caused me a moment of confusion with the utility since the "wrong version" error fails fast and doesn't suggest a duplicate. Took me a minute to spot the duplicate because the "wrong version" was the correct version listed in dependencies. :)

charlierudolph commented 7 years ago

Can you please add a unit test for this?

tychedelia commented 7 years ago

will do

charlierudolph commented 7 years ago

Thanks for your contribution!

4.3.0 released with this change