본문 바로가기

4. 개인 취미 생활

[34] husky, lint-staged - eslint 자동화하기

husky + lint-staged로 git commit 할 때 staged 된 파일을 자동으로 lint !

husky가 하는 일 : commit 할 때 자동으로 스크립트를 동작!

lint-staged가 하는 일 : staged 된 파일만 lint!


Husky

Husky improves your commits and more 🐶 woof!

 

 

husky 공식 페이지

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

 

Husky - Git hooks

 

typicode.github.io

husky npm 페이지

https://www.npmjs.com/package/husky

 

husky

Modern native Git hooks made easy. Latest version: 8.0.1, last published: 3 months ago. Start using husky in your project by running `npm i husky`. There are 2425 other projects in the npm registry using husky.

www.npmjs.com


🚫💩 lint-staged

Run linters against staged git files and don't let 💩 slip into your code base!

 

 

 

git 으로 commit 할 때 staged 된 파일을 자동으로 eslint를 실행시키자 !

 

 

 

lint-staged npm 페이지

https://www.npmjs.com/package/lint-staged

 

lint-staged

Lint files staged by git. Latest version: 13.0.3, last published: 2 months ago. Start using lint-staged in your project by running `npm i lint-staged`. There are 1751 other projects in the npm registry using lint-staged.

www.npmjs.com