Loading views...

HAI code review

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2025 Oct 28 15:12
Editor
Edited
Edited
2026 Jan 26 15:13
Refs

Type

  • zod type, type inference, No return type as much as can. No as
  • less type definition

Error

  • error catching, early return

React

  • unnecessary use memo, callback
  • error, split return based on condition
  • use cn

Naming

  • locality convention
  • 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
  • always ;
  • No Promise.all
  • 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
 
 
 
 
 
 
 

Recommendations