mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-15 02:09:06 +08:00
25 lines
554 B
Bash
Executable File
25 lines
554 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# spell-checker: ignore chdir loglevel
|
|
|
|
. "$(dirname "$0")/_/husky.sh"
|
|
|
|
# Get all staged files, by name only, that have not been deleted
|
|
ALL_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
|
|
|
|
if [ -z "$ALL_FILES" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
TS_FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.ts" "*.tsx" | sed 's| |\\ |g')
|
|
|
|
npx prettier \
|
|
--loglevel=error \
|
|
--ignore-unknown \
|
|
--no-error-on-unmatched-pattern \
|
|
--write \
|
|
$ALL_FILES
|
|
|
|
# Don't fix these, as they could cause errors
|
|
npx eslint $TS_FILES
|