diff --git a/lints/bin/default_command b/lints/bin/default_command index ee755346d..98e5370a2 100755 --- a/lints/bin/default_command +++ b/lints/bin/default_command @@ -1,4 +1,23 @@ #!/usr/bin/env bash +num_errors=0 + cd /app/code therapist run --use-tracked-files +if [[ $? -ne 0 ]]; then + num_errors=$((num_errors + 1)) +fi + +for directory in *; do + if [[ -f $directory/package.json ]]; then + echo "Checking $directory for known NPM security issues..." + pushd $directory + nsp check + if [[ $? -ne 0 ]]; then + num_errors=$((num_errors + 1)) + fi + popd + fi +done + +exit $num_errors diff --git a/lints/package.json b/lints/package.json index 8410a6407..a2ffb62eb 100644 --- a/lints/package.json +++ b/lints/package.json @@ -20,6 +20,7 @@ "moment": "2.14.1", "node-sass": "3.9.3", "node-uuid": "1.4.7", + "nsp": "^2.6.2", "react": "15.3.1", "react-addons-css-transition-group": "15.3.1", "react-breadcrumbs": "1.3.16",