- Indent using 2 spaces
- Use single quotes, unless you are writing JSON
- Declare one variable per var statement
- Variables and properties should use lower camel case capitalization
- Class names should be capitalized using upper camel case
- Constants should be declared as regular variables or static class properties, using all uppercase letters
- Use the triple equality operator
- Write the summary line and description of what you have done in the imperative mode, that is as if you were commanding someone. * Write “fix”, “add”, “change” instead of “fixed”, “added”, “changed”.
- Always leave the second line blank.
- Line break the commit message (to make the commit message readable without having to scroll horizontally in gitk).
- The first line should always be 50 characters or less.
- Answer the following questions:
- Why is this change necessary?
- How does it address the issue?
- What side effects does this change have?
- Consider including a link to the issue/story/card in the commit message a standard for your project. Full URLs are more useful than issue numbers, as they are more permanent and avoid confusion over which issue tracker it references. This is generally done as the first paragraph after the summary, on line 3.
- Avoid unrelated changes in a single commit.
- Always be cleaning up your history before pushing.