--- description: Pre-commit quality checks — TypeScript, ESLint, Prettier, Storybook build, token sync, hardcoded values. // turbo --- # Preflight Checks Run all quality gates before committing. Report PASS/FAIL/WARN for each. ## Checks 1. **TypeScript compilation** Run `npx tsc --noEmit` FAIL if any type errors. Report file and line for each error. 2. **ESLint** Run `npm run lint` FAIL if any errors (warnings are WARN). Report count and top issues. 3. **Prettier** Run `npm run format:check` FAIL if any files need formatting. List files. 4. **Storybook build** Run `npx storybook build --quiet` FAIL if build errors. Report the failing component. 5. **Token sync** Compare timestamps: are any `tokens/**/*.json` files newer than `src/theme/generated/`? WARN if generated files are stale. Fix: `npm run build:tokens` 6. **Hardcoded values scan** Search `src/components/**/*.tsx` (excluding `*.stories.tsx`) for hex colour patterns (`#[0-9a-fA-F]{3,8}`). WARN for each match not on a line containing `// ok-hardcode`. 7. **Component exports** For each component folder in `src/components/`, verify `index.ts` exists and re-exports the component. FAIL if any component is missing its barrel export. ## Report format | Check | Status | Details | |-------|--------|---------| | TypeScript | PASS/FAIL | error count | | ESLint | PASS/FAIL/WARN | error/warning count | | Prettier | PASS/FAIL | files needing format | | Storybook | PASS/FAIL | failing component | | Token sync | PASS/WARN | stale files | | Hardcoded values | PASS/WARN | matches found | | Exports | PASS/FAIL | missing index.ts | If all PASS: safe to commit. If any FAIL: fix before committing.