Skip to content

Latest commit

 

History

History
41 lines (22 loc) · 2.46 KB

CONTRIBUTING.md

File metadata and controls

41 lines (22 loc) · 2.46 KB

Contributing

Questions, comments, bug reports, and pull requests are all welcome. Submit them at the project on GitHub. If you haven't contributed to a Medium project before please head over to the Open Source Project and fill out an contributor license agreement (it should be pretty painless).

Bug reports that include steps-to-reproduce (including code) are the best. Even better, make them in the form of pull requests.

Workflow

Pull requests

Fork the project on GitHub and make a pull request from your feature branch against the upstream master branch. Consider rebasing your branch onto the latest master before sending a pull request to make sure there are no merge conflicts, failing tests, or other regressions.

Code style

Your code should pass JS Hint (part of the npm test script). When in doubt, try to follow existing conventions and these basic rules:

  • Don't use semi-colons. We think our code looks sleeker without them.
  • Indent using two spaces. Never use tabs.
  • Delete trailing whitespace. It's ugly.
  • Use spaces after the function keyword, like this: function () {}

Documentation

JSDoc

We use Closure-style JSDoc for inline documentation. There is no formal guideline, but please try to follow the existing conventions for documentation. For example, function paramaters and return values should always be documented, and functions should also have a brief, clear description.

Use examples and in-line documentation when they're helpful. Avoid comments like This adds 1 to the variable "i".

Readme

If you introduce changes or new features that will affect users, consider updating or adding the relevant section of the readme.

Tests

Unit tests

Tests use Mocha and can be run with npm test. Tests will automatically be run on Travis CI for new pull requests, and pull requests will only be merged if the tests pass.

New features and bug fixes should have new unit tests. Don't be afraid to make the tests fun to read, we will all be fine without another example of asserting "foobar" or "example data". I like Vampire Weekend lyrics. Be creative.