Coding Standards - OtagoPolytechnic/Air-Quality-Monitoring-System GitHub Wiki

Here is our teams Coding Standards.

This is a living document so please update if there are is anything new you want to add.

  • Use CamelCase naming convention for everything but components
  • Tab spacing
  • No switch cases
  • Apply code SMELLS (see here - https://refactoring.guru/refactoring/smells)
  • Break components down so that each component does only one thing
  • Use import where you can
  • Export each function as such
    • add export default (constName) at the end of the file
    • don't do this export const App
  • Arrow functions for components
    • use const App = () => {}
    • not function App
  • Using Tailwind for CSS
  • Only comment on new/complicated code
  • Replete variable names to the code you are creating
  • Use const for everything unless you have to change what you are doing