Pre-PR check for common issues - run before pushing to catch problems early
Run this before creating a PR to catch common issues in changed files.
git diff main --name-only to get list of changed filesfile:line referencesany types - find proper type or use unknown@ts-ignore or @ts-expect-error without explanationProps not ComponentNamePropsmake types if available, else pnpm tsc --noEmit)# Check if 'types' target is available in make output
make 2>/dev/null | grep -q 'types' && make types || pnpm tsc --noEmit
'use client' only where actually needed (hooks, browser APIs, event handlers)dynamic(() => import(...), { ssr: false })console.log left in code (use proper logging or remove)loading.tsx with skeletonerror.tsx with reset buttonselect to specify fields (not bare findMany())validations/ not inline in componentsprocess.env.* outside constants/ directory.env.exampleNEXT_PUBLIC_ prefix only for client-safe values@/ path alias (no ../../../ climbs)dangerouslySetInnerHTML without sanitizationQuick audit check (not full analysis - use /audit for that):
pnpm audit 2>/dev/null | head -20
/audit for full analysis)<<<<<<<, =======, >>>>>>>).only or .skip left in test filesdebugger statements.env.local or other local config committeduseMemo if recreated each renderwidth and height (prevents layout shift)useEffect without dependency arraytext-muted-foreground) not hardcoded (text-gray-500)<Image> from next/imageformatInTimeZone from date-fns-tz, not format from date-fnsfacilityTimezone, store in UTCalt attributesaria-* attributes## Preflight Report
> Note: Not running test suites (vitest/playwright) - assuming you've run them or will before pushing. CI is the backstop.
### TypeScript (2 issues)
- app/users/page.tsx:15 - `any` type used, consider `User[]`
- components/modal.tsx:8 - uses `UserModalProps` instead of `Props`
### Route Structure (1 issue)
- app/bookings/ - missing loading.tsx
### Imports (1 issue)
- lib/utils.ts:3 - relative import `../../components`, use `@/components`
### Passed
- React Patterns
- Data Fetching
- Validation
- Styling
- Dates
- Accessibility
- Code Style
Report issues but don't block. Developer decides what to fix. Some checks are style preferences, others are bugs waiting to happen.
Must fix: Security issues, merge conflict markers, hardcoded secrets, .only/.skip in tests
Should fix: any types, missing error boundaries, N+1 queries, timezone bugs, unused code, performance issues
Nice to fix: Naming conventions, import style, semicolons