Javascript Style Guide

What is and kind of javascript style guideline is and how to use it?

As far as i know, there is 2 JS style guides: Google Js style guide https://google.github.io/styleguide/javascriptguide.xml.
And airbnb style guide https://github.com/airbnb/javascript.

I am not an expert to recommend one or to give my opinion about which is better, but i think you should use the one you feel comfortable while using.

I really like airbnb JS style guide and have been following it up in most of my side projects. Seems pragmatic enough.
Recently, I have started using using Standard JS guide for Node.js/REST API projects. You can check it here: https://github.com/feross/standard

1 Like

A style guide checks your code against a set style pattern and highlights “bad” practices like spellcheck in MS Word. There are many style guides, I personally prefer airbnb guide, because it seems to fit what I’ve always done. “Standard style” by feross, is good because its very easy to setup, but some of its styles like space before function parenthesis, and no semicolons are hotly contested style patterns, and are best left up to your own judgment.

1 Like

Also look into linters in general. https://en.wikipedia.org/wiki/Lint_(software)


http://jshint.com

1 Like