Skip to content

Commit 43bbd3b

Browse files
committed
add husky doc
1 parent 156818f commit 43bbd3b

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run lint-staged
1+
npx lint-staged

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,32 @@ Navigate to Settings > Environments > github-pages > 🗑️
137137
- [GitHub Pages Documentation](https://docs.github.com/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site)
138138
- [actions-deploy-pages](https://github.com/actions/deploy-pages)
139139

140+
## 🐶 Husky & Typo Checking
141+
142+
### Automatic Typo Checking
143+
144+
This project uses Husky to automatically check for typos during commits. The check is performed using the `typos` tool and only runs on staged files (files that have been `git add`ed).
145+
146+
### Manual Typo Checking
147+
148+
To manually check for typos without committing:
149+
150+
```bash
151+
npx typos
152+
```
153+
154+
This command checks all files in the project, regardless of whether they are staged for commit or not.
155+
156+
### Disabling Git Hooks
157+
158+
To temporarily disable all git hooks (including lint, format, and typo validation) during commit:
159+
160+
```bash
161+
export HUSKY=0
162+
```
163+
164+
You can re-enable hooks by unsetting the variable or starting a new terminal session.
165+
140166
## 📄 License
141167

142168
[CC-BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"lint": "eslint src/",
1414
"typos": "typos",
1515
"typos:fix": "typos --write-changes",
16-
"prepare": "husky",
17-
"lint-staged": "lint-staged"
16+
"prepare": "husky"
1817
},
1918
"author": "denkiwakame <denkivvakame@gmail.com>",
2019
"license": "CC-BY-SA4.0",

0 commit comments

Comments
 (0)