all.bash: add npm lint to bash scripts
Change-Id: Ia3d0353f3922b0af1faaf7ce5a541f56517011d2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/284198
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/all.bash b/all.bash
index 180ad04..c7c4560 100755
--- a/all.bash
+++ b/all.bash
@@ -142,6 +142,10 @@
fi
}
+run_npm_lint() {
+ ./devtools/npm.sh run lint
+}
+
standard_linters() {
check_headers
check_bad_migrations
@@ -168,6 +172,7 @@
prettier - (lint, nonstandard) run prettier on .js and .css files.
templates - (lint, nonstandard) run go-template-lint on templates
script_hashses - (lint) check script hashes
+ npm_lint - (lint, nonstandard) run linters on .ts and .css files
EOUSAGE
}
@@ -189,6 +194,7 @@
"")
standard_linters
run_prettier
+ run_npm_lint
runcmd go mod tidy
runcmd env GO_DISCOVERY_TESTDB=true go test ./...
runcmd go test ./internal/secrets
@@ -215,6 +221,7 @@
templates) check_templates ;;
unparam) check_unparam ;;
script_hashes) check_script_hashes ;;
+ npm_lint) run_npm_lint ;;
*)
usage
exit 1
diff --git a/devtools/npm.sh b/devtools/npm.sh
index f9fff35..e065cc8 100755
--- a/devtools/npm.sh
+++ b/devtools/npm.sh
@@ -6,6 +6,11 @@
source devtools/lib.sh || { echo "Are you at repo root?"; exit 1; }
+if [[ ! -x "$(command -v docker-compose)" ]]; then
+ err "docker-compose must be installed: see https://docs.docker.com/compose/install/"
+ exit 1
+fi
+
# Run npm install if node_modules directory does not exist.
if [ ! -d "node_modules" ]
then