mattermost-mobile/scripts/pre-commit.sh
Mattermost Build b5b2310f33
update dependencies (#4958) (#4968)
* update dependencies

* revert keychain update

* Update dependencies & Fastlane

* set path agnostic for bash in scrips

* Fix open from push notification race

* patch react-native-localize

(cherry picked from commit b226d451f3)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-11-19 13:37:43 -03:00

32 lines
680 B
Bash
Executable file

#!/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