|
1 | 1 | { |
| 2 | + "env": { |
| 3 | + "node": true, |
| 4 | + "browser": false |
| 5 | + }, |
2 | 6 | "rules": { |
| 7 | + // 2-space indentation |
3 | 8 | "indent": [2, 2, {"SwitchCase": 1}], |
| 9 | + // Require strings to use single quotes |
4 | 10 | "quotes": [2, "single"], |
| 11 | + // Allow only unix line-endings |
5 | 12 | "linebreak-style": [2, "unix"], |
| 13 | + // Always require semicolons |
6 | 14 | "semi": [2, "always"], |
| 15 | + // Require curly braces for multi-line control statements |
7 | 16 | "curly": [2, "multi-line"], |
| 17 | + // Always handle callback error cases |
8 | 18 | "handle-callback-err": [2, "^err"], |
| 19 | + // Require JSDoc for all function definitions |
9 | 20 | "valid-jsdoc": [2, { |
10 | 21 | "requireReturn": false, |
11 | 22 | "requireReturnDescription": false, |
|
20 | 31 | }], |
21 | 32 | "no-redeclare": [2, { "builtinGlobals": true }], |
22 | 33 | "no-shadow": [2, { "builtinGlobals": true, "hoist": "all" }], |
| 34 | + // Disallow using variables before they've been defined |
| 35 | + // functions are ok |
23 | 36 | "no-use-before-define": [2, "nofunc"], |
24 | 37 | "no-shadow-restricted-names": 2, |
25 | 38 | "no-extra-semi": 2, |
| 39 | + // Disallow unused variables |
26 | 40 | "no-unused-vars": 2, |
27 | 41 | "no-undef": 2, |
| 42 | + // Use if () { } |
| 43 | + // ^ space |
| 44 | + "space-after-keywords": [2, "always"], |
| 45 | + // Use if () { } |
| 46 | + // ^ space |
| 47 | + "space-before-blocks": [2, "always"], |
| 48 | + // eslint can't handle this, so the check is disabled. |
28 | 49 | "key-spacing": 0, |
29 | 50 | "strict": 0, |
| 51 | + // Do not force dot-notation |
30 | 52 | "dot-notation": 0, |
31 | 53 | "eol-last": 0, |
32 | 54 | "no-new": 0, |
33 | 55 | "semi-spacing": 0, |
| 56 | + // Allow multi spaces around operators since they are |
| 57 | + // used for alignment. This is not consistent in the |
| 58 | + // code. |
34 | 59 | "no-multi-spaces": 0, |
35 | 60 | "eqeqeq": 0, |
36 | 61 | "no-mixed-requires": 0, |
37 | 62 | "no-console": 0 |
38 | | - }, |
39 | | - "env": { |
40 | | - "node": true, |
41 | | - "browser": false |
42 | 63 | } |
43 | 64 | } |
0 commit comments