Skip to content

Commit

Permalink
Allow for ignoring devDependencies via boolean config option ignoreDe…
Browse files Browse the repository at this point in the history
…vDependencies (#9)
  • Loading branch information
Jason Palmer authored and hzoo committed Nov 29, 2016
1 parent 408ab9b commit 4285954
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ $ ./node_modules/.bin/license-to-fail init

`warnOnUnknown`: instead of erroring on packages with an `UNKNOWN` license, just warn. (false by default)

`ignoreDevDependencies`: do not check licenses for devDependencies. (false by default)

```js
// ./config.js
module.exports = {
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = function checkLicenses(config) {
var allowedPackages = config.allowedPackages || [];
var warnOnUnknown = config.warnOnUnknown || false;
var configPath = config.configPath;
var ignoreDevDependencies = config.ignoreDevDependencies || false;

function log(dep) {
var type = 'INDIRECT DEP';
Expand Down Expand Up @@ -47,7 +48,8 @@ module.exports = function checkLicenses(config) {
}

checker.init({
start: process.cwd()
start: process.cwd(),
production: ignoreDevDependencies
}, function(err, json) {
var prohibitedDeps = Object.keys(json)
.map(function(dep) {
Expand Down

0 comments on commit 4285954

Please sign in to comment.