본문 바로가기
모바일 APP/React-Native

Husky 설정

by 살길바라냐 2022. 9. 14.

husky 설치

초기설정을 해준다

npx husky-init && npm install       # npm
npx husky-init && yarn              # Yarn 1
yarn dlx husky-init --yarn2 && yarn # Yarn 2+
pnpm dlx husky-init && pnpm install # pnpm

위 명령어를 사용하면

.husky 폴더가 생성된다

 

 

스크립트에 사용할 명령어를 추가 하면된다.

npx husky add .husky/pre-commit "yarn lint"
git add .husky/pre-commit

 

 

https://typicode.github.io/husky/#/

 

Husky - Git hooks

 

typicode.github.io

 

!! 트러블 슈팅

{키워드나, 명령어} command not found 같은 에러가 발생한다면

nvm 사용자 또는 node 설치 경로가 일반적인 경로가 달라서 발생 오류이다. 만약 nvm 사용자인 경우 아래 파일을 home 디렉토리에 넣어주자

index.huskyrc
0.00MB

 

728x90
반응형

'모바일 APP > React-Native' 카테고리의 다른 글

Developer Tools  (0) 2023.01.31
Debugging  (0) 2023.01.31
실제 기기를 사용해야 하는 이유  (0) 2022.02.24
리액트 네이티브란?  (0) 2022.02.24
아이폰 안드로이드 디스플레이 길이  (0) 2021.12.27