Barebones code for v2

This commit is contained in:
Elias Nahum
2020-11-14 11:06:43 -03:00
commit 22e82dfc2a
444 changed files with 75871 additions and 0 deletions

32
scripts/pre-commit.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
jsfiles=$(git diff --cached --name-only --diff-filter=ACM | grep -E '.js$|.ts$|.tsx$')
if [ -z "jsfiles" ]; then
exit 0
fi
if [ -n "$jsfiles" ]; then
echo "Checking lint for:"
for js in $jsfiles; do
echo "$js"
e=$(node_modules/.bin/eslint --quiet --fix $js)
if [ -n "$e" ]; then
echo "ERROR: Check eslint hints."
echo "$e"
exit 1 # reject
fi
done
echo "Checking for TSC"
tsc=$(node_modules/.bin/tsc --noEmit)
if [ -n "$tsc" ]; then
echo "ERROR: Check TSC hints."
echo "$tsc"
exit 1 # reject
fi
fi
# scripts/precommit/i18n.sh
exit 0