mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-08 09:12:29 +08:00
chore: add type check and unit test git hooks
This commit is contained in:
13
.github/CONTRIBUTING.md
vendored
13
.github/CONTRIBUTING.md
vendored
@@ -20,7 +20,9 @@ npm run lint # Check lint errors
|
|||||||
npm run check # Run all checks (CI)
|
npm run check # Run all checks (CI)
|
||||||
```
|
```
|
||||||
|
|
||||||
Pre-commit hooks via Husky will run Biome automatically on staged files.
|
Git hooks via Husky run automatically:
|
||||||
|
- **Pre-commit**: Biome (format/lint) + TypeScript type check
|
||||||
|
- **Pre-push**: Unit tests
|
||||||
|
|
||||||
For a better experience, install the [Biome VS Code extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) for real-time linting and format-on-save.
|
For a better experience, install the [Biome VS Code extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) for real-time linting and format-on-save.
|
||||||
|
|
||||||
@@ -48,9 +50,12 @@ npx playwright test --ui
|
|||||||
## Pull Requests
|
## Pull Requests
|
||||||
|
|
||||||
1. Create a feature branch
|
1. Create a feature branch
|
||||||
2. Make changes and ensure `npm run check` passes
|
2. Make changes (pre-commit runs lint + type check automatically)
|
||||||
3. Run tests with `npm run test && npm run test:e2e`
|
3. Run E2E tests with `npm run test:e2e`
|
||||||
4. Submit PR against `main` with a clear description
|
4. Push (pre-push runs unit tests automatically)
|
||||||
|
5. Submit PR against `main` with a clear description
|
||||||
|
|
||||||
|
CI will run the full test suite on your PR.
|
||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
npx lint-staged
|
npx lint-staged
|
||||||
|
npx tsc --noEmit
|
||||||
|
|||||||
4
.husky/pre-push
Normal file
4
.husky/pre-push
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Skip if node_modules not installed (e.g., on EC2 push server)
|
||||||
|
if [ -d "node_modules" ]; then
|
||||||
|
npm run test -- --run
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user