-
Notifications
You must be signed in to change notification settings - Fork 1
Contributing
Maximilian Berkmann edited this page Sep 6, 2016
·
4 revisions
Anyone who has at least a basic understanding of JS and a minimum of experience in it is free to contribute.
In order to contribute, you must follow the rules below:
- Charset: UTF-8
- New lines: preferably LF
- Indentation: tabs (1 tab per block) e.g.:
if (...) {
//...
if (...) {
//...
}
}- No trailing white space
- Naming: preferably camel-case or uppercase for acronyms (e.g.: XHR)
- Object declaration: literals (aside from exceptional cases like new Array(len))
- Quotes: preferably double
- 1 line statements: fine (except if it's excessively long and can be broken down)
- Equality: === and !== whenever possible
- Space between brackets and keywords/number: always outside (except for functions/methods) and no need inside
- Semicolon: always but can be omitted for each last statements of each scope e.g.:
return myFunction(x, y) + (z % y);A new module must start with at least something like this:
/**
* @module MyModule
* @description Description of the module
* @version 1.0 (Or something else depending on the version)
* @since First_EssenceJS_version_supporting_that_module
* @license MIT
* @author Full name <user@mail.com>
* @requires essence
* @requires Other_dependency_module
* @type {Module}
* @exports MyModule
*/
var MyModule = new Module("MyModule", "description", ["Other_dependency_module"], ...);
//...It must have the same name as the Module object and end in .js as well as being accessible from the modules folder of the appropriate EssenceJS versioned folder(s)
All other objects/prototypes/methods/functions/variables must be JSDocumented with a bare minimum of information such as the description, what is returned (undefined if nothing is returned), the parameters, properties, first essenceJS version that supports it and reference to the part of the code linked to that.