enigma-bbs/CONTRIBUTING.md

976 B

Contributing

Style & Formatting

  • In general, Prettier is used. See the Prettier installation and basic instructions for more information.
  • Though you'll see a lot of older style callback code, please utilize modern JavaScript. ES6 classes, Arrow Functions, and builtins.
  • There is almost never a reason to use var. Prefer const where you can and and let otherwise.
  • Save with UNIX line feeds, UTF-8 without BOM, and tabs set to 4 spaces.
  • Do not include the .js suffix when Importing (require)

Arrow Functions

Prefer anonymous arrow functions with access to this for callbacks.

// Good!
someApi(foo, bar, (err, result) => {
    // ...
});

// Bad :(
someApi(foo, bar, function callback(err, result) {
    // ...
});

Import (require)

// Good!
const foo = require('foo');

// Bad :(
const foo = require('foo.js');