⬅️ NodeJS Best Practice 🔗 GH

  • Use ESLint
    • use eslint-config-prettier for eslint/prettier config
  • Use Node.js eslint extension plugins
  • Name your functions
  • Naming conventions: Use lowerCamelCase when naming constants, variables and functions, UpperCamelCase (capital first letter as well) when naming classes and UPPER_SNAKE_CASE when naming global or static variables
  • Prefer const over let. Ditch the var
  • Require modules at the beginning of each file, before and outside of any functions.
  • Avoid effects outside of functions: Avoid putting code with effects like network or DB calls outside of functions