Skip to content

Coding Style Guide

segunolalive edited this page Nov 10, 2017 · 2 revisions

We use the Airbnb JavaScript style guide with the following overides:

  "root": true,
  "extends": ["airbnb-base", "plugin:react/recommended"],
  "env": {
    "browser": true,
    "node": true,
    "es6": true,
    "mocha": true
  },
  "parserOptions": {
    "ecmaVersion": 6,
    "ecmaFeatures": { "jsx": true }
  },
  "settings": {
    "import/resolver": {
      "node": {
        "extensions": [".js",".jsx"]
      }
    }
  },
  "rules": {
    "one-var": 0,
    "one-var-declaration-per-line": 0,
    "new-cap": 0,
    "consistent-return": 0,
    "no-param-reassign": 0,
    "comma-dangle": 0,
    "max-len": [1, 80, 2],
    "import/prefer-default-export": 0,
    "curly": ["error", "multi-line"],
    "import/no-unresolved": [2, { "commonjs": true }],
    "import/extensions": "off",
    "no-shadow": ["error", { "allow": ["req", "res", "err"] }],
    "react/jsx-uses-react": "error",
    "react/jsx-uses-vars": "error",
    "valid-jsdoc": ["error", {
      "requireReturn": true,
      "requireReturnType": true,
      "requireParamDescription": false,
      "requireReturnDescription": true
    }],
    "class-methods-use-this": 0,
    "require-jsdoc": ["error", {
        "require": {
            "FunctionDeclaration": true,
            "MethodDefinition": true,
            "ClassDeclaration": true
        }
    }]
  }
}
Clone this wiki locally