At the syntaxe level, you can use a linter like ESLint. Rules are personal, experience will make you like one over the other. AirBnB rules are a good start.
At best practice level @arsaw already answer you, but you could check tools like Code Climate. It's really easy to use with github.
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.