Skip to content

Coding Style

Robert de Forest edited this page Jan 28, 2019 · 1 revision

Defaults

Unless otherwise specified, follow the Google JavaScript style guide.

Project overrides

Class definition

With few exceptions, classes will be defined as follows:

module.exports = function ClassName(args) {
  if (!(this instanceof ClassName))
    ClassName(args);

  ...
};

ClassName.prototype = {
  methodName: function (...) {
      ...
    },

  ...
};

Clone this wiki locally