Skip to content

Commit

Permalink
Feature/#14 husky, lint-staged 세팅 (#52)
Browse files Browse the repository at this point in the history
* feat: husky devDependency로 설치

* feat: lint-staged devDependency로 설치

* feat: husky init 명령어 실행

* feat: lint-staged 명령어 추가

* chore: 불필요한 명령어 삭제

* feat: husky 폴더 추가
  • Loading branch information
ghdtjgus76 authored Dec 20, 2024
1 parent 5078461 commit 245fce2
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .husky/_/h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env sh
[ "$HUSKY" = "2" ] && set -x
n=$(basename "$0")
s=$(dirname "$(dirname "$0")")/$n

[ ! -f "$s" ] && exit 0

if [ -f "$HOME/.huskyrc" ]; then
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh"
fi
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh"
[ -f "$i" ] && . "$i"

[ "${HUSKY-}" = "0" ] && exit 0

export PATH="node_modules/.bin:$PATH"
sh -e "$s" "$@"
c=$?

[ $c != 0 ] && echo "husky - $n script failed (code $c)"
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
exit $c
9 changes: 9 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "husky - DEPRECATED
Please remove the following two lines from $0:
#!/usr/bin/env sh
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
They WILL FAIL in v10.0.0
"
4 changes: 4 additions & 0 deletions .husky/_/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"

pnpm exec lint-staged
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@
"@types/node": "^22.10.2",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"husky": "^9.1.7",
"lint-staged": "^15.2.11",
"prettier": "^3.2.5",
"turbo": "^2.3.3",
"typescript": "5.5.4"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
]
}
}
Loading

0 comments on commit 245fce2

Please sign in to comment.