-
Include tests whenever possible.
-
Make sure all tests pass.
-
We have an editor config file for maintaining a consistent coding style. Read more and download plugins at editorconfig.org.
-
The git pre-commit hook (installed during setup) will automatically run code linters to help you adhere to the these code style guidelines.
-
Adhere to the HTML Code Guide by @mdo.
-
Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
-
Download JS scripts using Bower to be included in the distribution, instead of loading them from third-party URLs.
-
If you have to use third-party JS, use CDNs and HTTPS when possible.
-
Use WAI-ARIA attributes to promote accessibility.
-
Adhere to the CSS Code Guide by @mdo.
-
When feasible, default color palettes should comply with WCAG color contrast guidelines.
-
Adhere to the Airbnb JavaScript Style Guide.
-
We use ESLint to detect errors and potential problems in JavaScript code. Use
gulp lint
in thewebapp
directory to run ESLint on your code. -
ESLint can be suppressed in particular parts of code when necessary. Use this sparingly, though.
-
Do not wrap your AMD modules in
define
calls, as Babel automatically does that. In fact, doing so will cause errors. Use ES6import
statements for specifying dependencies.
NOTE: If you encounter any code not adhering to these guidelines, feel free to open an issue, or better, open a (separate) pull request fixing the violations. Also feel free to discuss changing/adding/removing any guideline if you have a compelling reason for it.