Skip to content

Commit

Permalink
corrected order in which deps are located and applied
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Hargrove committed Feb 7, 2018
1 parent 275c6c7 commit 980b087
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/rules/no-extraneous-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ function getDependencies(context, packageDir) {
}

if (packageDir) {
paths.unshift(packageDir)
} else {
Object.assign(
packageContent,
extractDepFields(
readPkgUp.sync({cwd: context.getFilename(), normalize: false}).pkg
)
)
paths.push(packageDir)
}

if (paths.length) {
Expand All @@ -56,6 +49,14 @@ function getDependencies(context, packageDir) {
})
}

if (!packageDir) {
Object.assign(
packageContent,
extractDepFields(
readPkgUp.sync({cwd: context.getFilename(), normalize: false}).pkg
)
)
}

if (![
packageContent.dependencies,
Expand Down

0 comments on commit 980b087

Please sign in to comment.