Some good tips in order to keep your JavaScript in check.

tldr;

  • Keep JavaScript code consistent
  • Use patterns such as Revealing module or observer pattern
  • Document code
  • Run static analysis tools regularly
  • Unit test

    • I recommend also using something like Nightwatch to do behavioral testing

  • Measure

    • Code coverage, I personally think this doesn't matter as code with 100% coverage can be broken and code with none/little can work correctly. Unit testing isn't the be all and end all.
    • Function complexity, this will help later with performance enhancements.

  • Automate every process of the project to save you time
  • Handle exceptions