git hooks
This commit is contained in:
23
.githooks/pre-commit
Executable file
23
.githooks/pre-commit
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
# prettier
|
||||
echo "Checking by Prettier..."
|
||||
prettier --check . &> /dev/null
|
||||
|
||||
if [[ "$?" == 0 ]]; then
|
||||
echo "✅ Prettier"
|
||||
else
|
||||
echo "⛔ Prettier error"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# editorconfig
|
||||
echo "Checking by EditorConfig..."
|
||||
ec . &> /dev/null
|
||||
|
||||
if [[ "$?" == 0 ]]; then
|
||||
echo "✅ EditorConfig"
|
||||
else
|
||||
echo "⛔ EditorConfig error"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user