Skip to content

Clean code rules/quality

Code quality

  • Use a code quality standard
  • no loose equals (==) to avoid implicit coercion bugs
  • capitalize constants with underscores (js convention)
  • Do not use indexes as a key in a list to avoid rerendering of the while list if an item gets added in the middle
  • Do not use var
  • Do not use insecure packages (check with npm audit, yarn audit)
  • Do not use subscribe inside subscribe to avoid memory leaks(Rxjs)
  • Do not use map inside map. Try to solve with reduce
  • Write tests
  • Write utils for frequently used functions
  • Use component based design

Frontend quality

  • Use alt for every image tag
  • Use different image sizes for different screen widths
  • Use a-tags instead of routerlinks so you can hover over it and see the link + open it with right mouse click
  • Use responsive design
  • Follow WCAG guidelines for accessibility
  • Add validation to all input fields
Published inJS

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *