- 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
- 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