Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo "Running pre-commit checks..."
pnpm pre-commit-check
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ We welcome contributions to improve the documentation:
5. Push to the branch (`git push origin feature/amazing-improvement`)
6. Open a Pull Request

### Pre-commit Hooks

This repository uses Husky to run pre-commit hooks that ensure code quality. When you commit changes, the following checks will run automatically:

- Building the project to ensure there are no build errors or warnings

If the build fails, your commit will be aborted. Fix the issues and try committing again.

To manually run the checks:

```bash
npm run pre-commit-check
```

## License

This project is licensed under the MIT License - see the LICENSE file for details.
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "mycoder-docs",
"version": "0.0.0",
"private": true,
"packageManager": "pnpm@10.2.1",
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
Expand All @@ -13,7 +14,9 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"prepare": "husky",
"pre-commit-check": "pnpm lint && pnpm build"
},
"dependencies": {
"@docusaurus/core": "3.7.0",
Expand All @@ -33,6 +36,8 @@
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"husky": "^9.1.7",
"lint-staged": "^15.4.3",
"typescript": "~5.6.2"
},
"browserslist": {
Expand All @@ -49,5 +54,10 @@
},
"engines": {
"node": ">=18.0"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix"
]
}
}
}
Loading
Loading