Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit 813641c

Browse files
committed
Add --no-peer option
Fixes #81
1 parent dd929b1 commit 813641c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cli.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if (args.help || args._.length === 0) {
2929
console.log('--missing (default) Check to make sure that all modules in your code are listed in your package.json')
3030
console.log('--unused, --extra The inverse of the --missing check and will tell you which modules in your package.json *were not* used in your code')
3131
console.log("--no-dev Won't tell you about devDependencies that are missing or unused")
32+
console.log("--no-peer Won't tell you about peerDependencies that are missing or unused")
3233
console.log("--ignore-module, -i Won't tell you about these module names when missing or unused")
3334
console.log('--entry By default your main and bin entries from package.json will be parsed, but you can add more the list of entries by passing them in as --entry')
3435
console.log("--no-default-entries Won't parse your main and bin entries from package.json will be parsed")
@@ -78,6 +79,7 @@ check({
7879
var failed = 0
7980
var options = {
8081
excludeDev: args.dev === false,
82+
excludePeer: args.peer === false,
8183
ignore: [].concat(args.i || [])
8284
}
8385
if (args.extra) {

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ function configure (pkg, options) {
109109

110110
if (typeof ignore === 'string') ignore = [ignore]
111111

112+
if (!options.excludePeer) {
113+
allDeps = allDeps.concat(Object.keys(pkg.peerDependencies || {}))
114+
}
115+
112116
if (!options.excludeDev) {
113117
allDeps = allDeps.concat(Object.keys(pkg.devDependencies || {}))
114118
}

0 commit comments

Comments
 (0)