Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 1.71 KB

contributing.md

File metadata and controls

76 lines (55 loc) · 1.71 KB

How to contribute

I love pull requests. And following this simple guidelines will make your pull request easier to merge.

Submitting pull requests

  1. Create a new branch, please don’t work in master directly.
  2. Add failing tests (if there’re any tests in project) for the change you want to make. Run tests (see below) to see the tests fail.
  3. Hack on.
  4. Run tests to see if the tests pass. Repeat steps 2–4 until done.
  5. Update the documentation to reflect any changes.
  6. Push to your fork and submit a pull request.

JavaScript code style

See ESLint config files for more details.

  • Tab indentation.
  • Single-quotes.
  • Semicolon.
  • Strict mode.
  • No trailing whitespace.
  • Variables where needed.
  • Multiple variable statements.
  • Space after keywords and between arguments and operators.
  • Use === and !== over == and !=.
  • Return early.
  • Limit line lengths to 120 chars.
  • Prefer readability over religion.
  • Use ES6.

Example:

'use strict';

function foo(bar, fum) {
    if (!bar) {
    	return;
    }

    let hello = 'Hello';
    let ret = 0;
    for (let barIdx = 0; barIdx < bar.length; barIdx++) {
        if (bar[barIdx] === hello) {
            ret += fum(bar[barIdx]);
        }
    }

    return ret;
}

Other notes

  • If you have commit access to repo and want to make big change or not sure about something, make a new branch and open pull request.
  • Don’t commit generated files: compiled from Stylus CSS, minified JavaScript, etc.
  • Don’t change version number and changelog.
  • Install EditorConfig plugin for your code editor.

Building and running tests

Install dependencies:

npm install

Build / run tests:

npm test