Answering the basic question!! Why do we need coding style guide in the first place?
We need coding style guide because code changes many hands and eyes over its lifecycle. If there are no coding standards then everyone ends up writing code that they only can understand.
Using a standard style guide helps ensure that code is shared easily among developers and any new developer can get up to speed with a given piece of code within no time. Popular open source projects communities like jQuery, Dojo etc. create and publish common style guides so that code written by anyone in the community is understood and updated by everyone else, as required, with ease.
The style guide is available in multiple languages including German, French, Italian, Korean, Russian and Romanian.
Fork it, make changes, if required, and use in your next project or use it as a base style to build one for your organization.
You can get idiomatic.js style guide at – github.com/rwaldron/idiomatic.js/.
You might also like – Nodejs Frameworks.
3. jQuery Core Style Guidelines
You can read more on this at – jquery.org/style-guide/js/.
5. Dojo Style Guide
Dojo toolkit was at its peak somewhere back in 2012, it may not be growing at the same pace now in 2015 but is still very popular and the reason for that can be attributed to the perfectionism Dojo community believes in. There is a comprehensive style guide that core Dojo developers have created for the community.
It derives its basics from the Java programming convention guide, you can check out the java guide at – geosoft.no.
You can read more on this at – dojotoolkit.org.
This is one style to rule them all as stated by “Feross Abukhadijeh”, the one who created and released it as open source under MIT license. There is a node package “standards.js” available to do the styling for you.
You can get this package at – github.com.
7. Node.js Style Guide
Felix Geisendorfer has come up with this style guide by picking up the most commonly used coding practices of Node.js community and adding additional bits as required. If you are working on a node package, you can follow this as is.
If you want to use it for some other project, you can fork it, change it as per your preferences and start using it. It’s free under creative commons license and you can get it at – node-style-guide.
Crockford’s style guide is based on java standards with enhancements made as necessary, you can follow it as is or use it as a base to create a standard for your community. You can get it at – crockford.com.
9. NPM’s ‘funny’ Coding Style
They say, it is a bit unconventional but carefully crafted style guide to reduce the visual clutter. Any contributions to npm are supposed to follow these coding standards.
NPM style guide contains only minimal set of guidelines and talks about using commas, semicolons, indentation, white space, tabs etc. and doesn’t go into guidelines around test code coverage and performance.
You can get npm style guide at – docs.npmjs.com.
WordPress has a huge ecosystem with almost 18% of all the websites on planet built on top of WordPress, but let us not go there right now.
You can get WordPress coding standards at – make.wordpress.org.
Any big community or organization where code is shared among developers and is meant to be reused needs to have a defined style guide. If you look at the coding standards mentioned in this article, you will find that many of these have 70-80% similarities and look very easy to follow.