The term "Style Guidelines" amd "code conventions" are pften used interchangeably. Style guidelines are a type of code convention aimed at the layout of code within a file. Code conventions can also include programming practices, file directory layout, and commenting.
Having all code look the same is incredibly important on a team, because it allows:
-
Any developer to work on any file regardless of who wrote it. There's no need to spend time reformatting or deciphering the logic of the file, because it looks the same as everything else.
-
Errors becomes more obvious. If all the code looks the same, and you come across some code that does not, you have likely found a problem.
-
JSLint incorporates Crockford's style preferences directly.
-
JSHint is a fork of JSLint and its goal is to provide more customization.
-
ESLint, The pluggable linting utility for JavaScript and JSX
- jQuery Core Style Guide
- Douglas Crockford's Code Conventions for the JavaScript Programming Language
- SproutCore Style Guide
- Google JavaScript Style Guide
- Dojo Style Guide
- Android Code Style Guide
- Unofficial Ruby Usage Style Guide
- Python Style Guide
- AirBnB
- Udacidty Code Guidelines for JavaScript, HTML, CSS and Git
JSLint written by Douglas Crockford and a general code quality tool for JavaScript. Douglas wrote his ideas in three pieces.
-
"The Elements of JavaScript Style, Part 1" which covers basic patterns and syntax
-
"The Elements of JavaScript Style, Part 2" which covers common JavaScript idioms.
-
"Code Conventions for the JavaScript Programming Language", a more robust resource that highlights pieces from the first two with the addition of smaller style guidelines.