This repository has been archived by the owner on Oct 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gitcole
committed
Mar 2, 2016
1 parent
027727e
commit d8974fb
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Coding Standards | ||
|
||
## ALL Files | ||
- 2 spaces per tab | ||
|
||
## HTML Files | ||
- Double quotes over single quotes for attributes | ||
- Comment at closing of element where it closes via class i.e. | ||
```HTML | ||
<div class="row"> | ||
... | ||
</div><!-- end: row --> | ||
``` | ||
|
||
## Javascript Files | ||
- Single quotes over double quotes | ||
- Brackets immediately follow function/conditional for which they open i.e. | ||
```JavaScript | ||
var doStuff = function () { | ||
// Body of function | ||
}; | ||
|
||
if (true) { | ||
// true | ||
} | ||
``` | ||
- Use semicolons when not required | ||
- Conditionals must be on a new line from the closing previous one i.e. | ||
```Javascript | ||
if (true) { | ||
// true | ||
} | ||
else { | ||
// false | ||
} | ||
``` | ||
- Use '===' instead of '==' | ||
```JavaScript | ||
if (1 === 2) | ||
``` | ||
...instead of... | ||
```JavaScript | ||
if (1 == 2) | ||
``` | ||
- (optional) Comment code blocks are strongly encouraged, but not required for functions | ||
```JavaScript | ||
/** | ||
* Does foo with bar | ||
* @param {type} bar | ||
* @returns {undefined} | ||
*/ | ||
var foo = function (bar) { | ||
// Function body | ||
}; | ||
``` | ||
|
||
## CSS Files | ||
- Double quotes over single quotes where required | ||
- Brackets immediately follow selector for which they open i.e. | ||
```CSS | ||
.selector { | ||
attribute: value; | ||
} | ||
``` | ||
- All colors should be in hexidecimal/ascii i.e. | ||
```CSS | ||
.selector { | ||
color: #FFFFFF; | ||
color: white; | ||
} | ||
``` |