1. Pick a Javascript style guide. 2. Make the code conform to it. Optionally enforce the style guide where possible with eslint.