If you want to write consistent JavaScript then you can use ESLint to validate your coding style against rules. Add the Airbnb style guide to that and you’ll get a tightly linted stylised JavaScript.
ESLint provides the lint engine, Airbnb delivers the style guide.