cd divecloud-react
npm installThis automatically runs the prepare script, which sets up Husky git hooks. No extra setup is needed.
# From the project root
docker compose up --buildThis starts:
- React app at http://localhost:3000
- PostgreSQL at
localhost:5432 - pgAdmin at http://localhost:5050
Dependencies are declared in divecloud-react/package.json, api/package.json, and the root package.json. A summary of direct npm packages, container images, and how to list full transitive license information is in THIRD_PARTY_NOTICES.md. The client app was bootstrapped with Create React App; see divecloud-react/README.md for the upstream project’s own notice.
This project uses Prettier for formatting and ESLint for linting, enforced via Husky git hooks and lint-staged.
All scripts run from divecloud-react/:
| Script | Description |
|---|---|
npm run format |
Auto-format all source files with Prettier |
npm run format:check |
Check formatting without writing changes |
npm run lint |
Run ESLint with zero warnings allowed |
npm run lint:fix |
Run ESLint and auto-fix what it can |
npm run typecheck |
Run strict TypeScript compile checks without emitting files |
Hooks are installed automatically when you run npm install inside divecloud-react/.
| Hook | Trigger | What it runs |
|---|---|---|
pre-commit |
Every git commit |
Runs Prettier and ESLint (with auto-fix) via lint-staged on staged .js, .jsx, .ts, .tsx, .json, .css, .md files |
pre-push |
Every git push |
Runs format:check, lint, then typecheck across all source files |
If formatting or linting fails, the commit or push is blocked until the issues are fixed.
If you cloned the repo and the hooks aren't firing, run:
cd divecloud-react
npm run prepareThis configures git to use the hooks in divecloud-react/.husky/.
In rare cases where you need to skip the hooks:
git commit --no-verify -m "your message"
git push --no-verifyA Lint workflow (.github/workflows/lint.yml) runs on every push to main and on every pull request targeting main. It:
- Checks out the code
- Sets up Node.js 20 with npm caching
- Installs dependencies (
npm ci) - Checks Prettier formatting (
npm run format:check) - Runs ESLint (
npm run lint) - Runs TypeScript type checks (
npm run typecheck)
If either check fails, the workflow fails and the PR shows a red check. To make this a hard gate, enable branch protection on main:
- Go to Settings > Branches > Branch protection rules
- Add a rule for
main - Check Require status checks to pass before merging
- Search for and select the ESLint status check
- Optionally check Require branches to be up to date before merging
This ensures no code can be merged into main without passing formatting and linting checks, even if someone bypasses local hooks.