This repository uses Git hooks to automatically format code with Prettier before each commit.
After cloning the repository, run this command to enable the hooks:
git config core.hooksPath .githooksThat's it! The hooks will now run automatically before each commit.
The pre-commit hook will:
- Automatically run
npx prettier --write .before each commit - Format all supported files (JS, CSS, HTML, JSON, Markdown)
- Stage the formatted files automatically
- Continue with the commit
If you need to skip the formatting for a particular commit:
git commit --no-verify -m "your message"Check if the hooks path is set correctly:
git config core.hooksPath
# Should output: .githooksMake sure Node.js and npm are installed:
node --version
npm --version