-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
65 lines (57 loc) · 2.74 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"extends": "eslint:recommended",
"rules": {
// 0 = allowed, 1 = warning, 2 = error.
"no-multiple-empty-lines": [2, {"max": 2}],
"max-len": ["error", {
"code": 136,
"tabWidth": 4,
"ignoreComments": true,
"ignoreTrailingComments": true,
"ignoreStrings": true,
"ignoreUrls": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}],
// Javascript
"no-unused-vars": 0, /* Allow unused variables. Good for leaving unused function parameters visible */
"no-extra-boolean-cast": 0, /* Allow for unnecessary '!!value'. FIXME: let's try tighten this */
"no-redeclare": 0, /* Allow for variables to be redefined. There are scenarios where this allows for cleaner code. */
"block-scoped-var": 2, // Enforces vars defined aren't used outwith their defined block.
"dot-notation": 2, // Enforces accessing object properites via dot notation.
"no-alert": 1, // Throws warning use of alert, confirm and prompt dialogues.
"no-extend-native": 2, // Prevents extending native JS objects.
"no-floating-decimal": 2, // Prevents using decimal place with prefixing / suffixing with numeric e.g. '.5'
"no-lone-blocks": 2, // Prevents use of an empty block e.g. {}
"no-self-compare": 2, // Prevents comparing vars to themselves
"yoda": 2, // Prevents reversed comparison.
"no-undef-init": 2, // Prevents settings a var to undefined.
"prefer-const": 2,
// Node JS
"global-require": 1, // Enforces all require statements to be made at the top of the file. TODO: Enfore this.
"handle-callback-err": 0, // TODO: We want to enforce this, but it's quite a large change to codebase. Integrate this once we've solidified loading an error page.
"no-sync": 2, // warns whever a synchronous methods is used. TODO: @andi, does the readFileSync in app.js need to be synchronous?
// Stylistic
"comma-dangle": ["error", "always-multiline"],
"consistent-this": 2, // Enforces consisten naming of "this" object assignment to be named "that".
"func-call-spacing": 2, // Enforces function calls to have no spacing e.g. doSomething(param).
"indent": ["error", 4, { "SwitchCase": 1 }], // Enforces project to use 4 spaces as a tab, including case statements
"no-var": 2,
"semi": [2, "always"],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}], // Enforces same-line "} else ..." statements.
"eol-last": ["error", "always"],
"object-curly-spacing": ["error", "always"]
},
/* Sets which variables are available & globally accessible */
"env": {
"node": true,
"mocha": true
}
}