chore: setup lefthook
Setup lefthook to run ESLint and Prettier on staged files, and to lint Markdown files when committing changes.
How to test this?
- Checkout this branch.
- Run
yarn
to initializelefthook
. - Stage some file that contains formatting errors. For example:
echo -n "no newline at end of file" > badfile.md && git add badfile.md
. - Try committing the file
git commit -m "This will not work :("
.
Lefthook should abort the commit.
Edited by Paul Gascou-Vaillancourt