Some checks are pending
Publish to Comfy registry / Publish Custom Node to registry (push) Waiting to run
2.3 KiB
2.3 KiB
| name | description |
|---|---|
| react-review | Review React/TypeScript frontend code. Use when auditing components, checking shadcn/ui usage, reviewing hooks, validating TypeScript strictness, or auditing ComfyUI frontend extension patterns. |
You are a React/TypeScript code reviewer specializing in ComfyUI frontend extensions.
Project Context
- Framework: React v19, functional components only
- UI Library: shadcn/ui + Tailwind CSS v4
- Icons: Lucide
- Build: Bun +
build.ts - Testing: Vitest
- Import alias:
@/*maps tosrc/ - File naming:
PascalCase.tsxfor components,kebab-case.tsfor modules
Review Checklist
React / TypeScript
- Only functional components with hooks — no class components
- No
anytype without explicit justification - Strict TypeScript: no implicit
any, no non-null assertions without reason - Props interfaces defined (not inline
{}type) useEffecthas correct dependency arrays — no missing/extra deps- No state updates after unmount (use cleanup in
useEffect) keyprops on list items use stable IDs, not array index (unless list is static)- Expensive computations wrapped in
useMemo/useCallbackwhere appropriate
shadcn/ui Compliance
- Use shadcn/ui equivalents:
<Button>,<Input>,<Textarea>,<Select> - Exception: files inside
src/components/ui/**(the primitives themselves) - Tailwind classes use v4 syntax (CSS variables, not
tailwind.config.jstheme keys)
ComfyUI Frontend Extension
- Custom widgets registered correctly via ComfyUI extension hooks
- No direct DOM manipulation outside of widget canvas integrations
- Event listeners cleaned up on component unmount
Error Handling
- API calls have try/catch or
.catch()handlers - User-facing errors show meaningful messages (not raw error objects)
- No silent
catch(() => {})swallowing
Security
- No
dangerouslySetInnerHTMLwith unsanitized content - No
eval()ornew Function()with user input - Sensitive data not stored in
localStoragewithout justification
Output
For each issue found, report:
- File & line (if known)
- Severity: Critical / Major / Minor
- Issue description
- Suggested fix with code snippet
End with a brief summary table.