Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
22 changes: 22 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

BASIC_RED="\033[0;31m"
BASIC_GREEN="\033[0;32m"
BASIC_YELLOW="\033[0;33m"
BASIC_CYAN="\033[0;36m"
ENDCOLOR="\033[0m"

run_prettier () {
echo -e "${BASIC_CYAN}✨ Formatting staged files with Prettier${ENDCOLOR}"
npx lint-staged
if [[ $? -ne 0 ]]
then
echo -e "${BASIC_RED}❌ Prettier formatting failed.${ENDCOLOR}"
echo -e "${BASIC_YELLOW}⚠️ Please fix the errors and try again.${ENDCOLOR}"
exit 1
fi
}

run_prettier

printf "${BASIC_GREEN}✅ Prettier formatting completed successfully.${ENDCOLOR}\n"
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*": "prettier --write --ignore-unknown"
}
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "all",
"arrowParens": "always",
"endOfLine": "auto",
"printWidth": 120,
"semi": true
}
Loading
Loading