-
Notifications
You must be signed in to change notification settings - Fork 728
Contribution Requirement
Your contributions are welcome and appreciated. However, I would like to lay down a few requirements to save your time (and mine) when you submit a pull request.
-
Do not submit contributions with pure code-refactoring that provides no benefits of speed or features. I know you want the code look "your" way, so do I.
-
Bug fixes, small enhancements, some refactoring (where it makes sense) are welcome and it is the way most people contribute.
-
If you changes are involved or you want to add some awesome new feature, talk to me before coding. It might save you lot of energy talking to me afterwards in your pull request.
-
Make sure your branch is up-to-date with current master.
-
Follow same code-style guidelines used in the files
I like my code to look pretty, and for your contribution to make it you need to make it look pretty. You can use any general style guide (for example https://github.com/airbnb/javascript). In particular I also look for this
-
Indentation with spaces (4 spaces per tab stop)
-
Align variables and properties nicely
// GOOD var obj = { prop1 : 1, otherVar : 2, prop3 : 3 }
// BAD var obj = { prop1: 1, otherProp2: 2, prop3: 3 }
-
Conditional statements
// GOOD if (some condition) { ... } else { ... }
Anything else is bad.
- always use space after if and before (
- always use { and } (except when the whole statement is one line)
-
Always use space after comma:
// GOOD function name (param1, param2, param3) { ... }
// BAD function name(param1,param2,param3) { ... }
-
Comments: alway put space after // or /* and before */
// GOOD
//BAD
I will add more as I encounter them.