#!/usr/bin/env bash # Stop hook: quickest meaningful check for this repo. No test suite and no # linter are configured, so this syntax-checks every tracked JS file and # validates every tracked JSON file. Fails (blocking) on the first error. set -euo pipefail cd "$(git rev-parse --show-toplevel)" status=0 while IFS= read -r -d '' f; do node --check "$f" || status=1 done < <(git ls-files -z -- '*.js') while IFS= read -r -d '' f; do node -e "JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'))" "$f" || status=1 done < <(git ls-files -z -- '*.json') exit $status