HAI code review
Created
2025 Oct 28 15:12Type
- zod type, type inference, No return type as much as can. No
as
Error
- error catching, early return
React
- unnecessary use memo, callback
- error, split return based on condition
Naming
- for function arguments if many or somethings are similar, use named variable instead of positional params
Typescript
- do not unnecessary export
- Never single line without bracket
- no variable! non-null assertion operator
- use early return or setting with if
- less optional
?. || ?? non readable codes - never replace it to ternary operator which is not readable
- prefer for of for in loop. Never use c style for loop that has ; and ++. No
.map if it is not required only for list projection. Never use for each
weaker rule
- instead of inline function prefer to make explicit named function for debugging