Development Guidelines for Javascript
Use NPM and Gulp
There is no constraint over which development environment people use.
However, the build tools are NPM and Gulp. So, use them.
Before every commit or pull request, run…
gulp dist
Follow Google’s linter
This linter is configured by default in our build tools.
It verifies the code is formatted correctly. Unlike what we do with Java,
code formatting is very strict in our Javascript projects.
Git Commit Messages
This section is widely inspired (and partially copied) from Atom.io’s web site.
- Use the present tense (“Add feature” not “Added feature”).
- Use the imperative mood (“Move cursor to…” not “Moves cursor to…”).
- Limit the first line to 72 characters or less.
- Reference issues and pull requests liberally (with #<issue-number>).
-
Optionally, consider starting the commit message with an applicable emoji.
-
:art:
when improving the format or structure of the code -
:racehorse:
when improving performance -
:bomb:
when fixing a bug -
:green_hart:
when fixing the CI build -
:heavy_check_mark:
when adding tests -
:lock:
when dealing with security -
:arrow_up:
when upgrading dependencies -
:arrow_down:
when downgrading dependencies
-
Squash your Commits
Sometimes, and for whatever reason, it takes several commits to solve an issue.
To improve the readability and the history browsing, it is better to squash your commits when you can.
Squashing means merging contiguous commits into a single one.
Squashing should be ONLY be done on forks. They are acceptable on pull requests provided they have not yet been
accepted (git push -force
will be necessary then).
To squash your commits, we suggest you follow this very good tutorial from the web.