Skip to content

Instantly share code, notes, and snippets.

@nicholaschuayunzhi
Last active January 21, 2018 05:13
Show Gist options
  • Select an option

  • Save nicholaschuayunzhi/bfe53dbb5f1a0f02d545d55956f9ab7e to your computer and use it in GitHub Desktop.

Select an option

Save nicholaschuayunzhi/bfe53dbb5f1a0f02d545d55956f9ab7e to your computer and use it in GitHub Desktop.
markbind-cli eslintrc.js
module.exports = {
"env": {
"node": true, //enables parsing of predefined node.js global variables and node.js scoping
"es6": true //enables es6 syntax and new es6 global variables
},
"extends": "airbnb-base", //team decision to use airbnb as base style guide https://github.com/airbnb/javascript on top of
//nus oss standard https://github.com/oss-generic/process/blob/master/docs/CodingStandards.adoc
"rules": {
"array-bracket-newline": ["error", { "multiline": true }], //to be consistent with object-curly-newline rule and nus oss standard
"func-names": "off", //we have many anonymous functions, leaving it on will result in many linter warnings
"function-paren-newline": "off", //based on nus oss standard, we allow for linebreaks within our function parentheses
//if on function parameters are on a new line, they mustbe aligned with the first parameter
//see "FunctionDeclaration", "FunctionExpression" and "CallExpression" in "indent"
"indent": [
"error",
2, //team decision to use 2-space indentation over 4-space indentation
{
"CallExpression": { "arguments": "first" } ,
"FunctionExpression": { "parameters": "first" },
"FunctionDeclaration": { "parameters": "first" },
}
],
"max-len": ["error", { "code": 110 }], //based on nus oss standard
"operator-linebreak": ["error", "before"], //based on nus oss standard not published to npm yet in airbnb-base (https://github.com/airbnb/javascript/commit/6e1f11185d95432ba90a647efc027bd32983f17d)
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment