1 | {
|
2 | "parserOptions": {
|
3 | "ecmaVersion": 6
|
4 | },
|
5 | "env": {
|
6 | "browser": false,
|
7 | "commonjs": true,
|
8 | "mocha": true,
|
9 | "es6": true,
|
10 | },
|
11 | // add global vars for chai, etc
|
12 | "globals": {
|
13 | "expect": false,
|
14 | "chai": false,
|
15 | "sinon": false
|
16 | },
|
17 | "rules": {
|
18 | // possible errors
|
19 | "no-extra-parens": 1,
|
20 | "valid-jsdoc": [1, {
|
21 | "requireReturn": false,
|
22 | "requireParamDescription": false,
|
23 | "requireReturnDescription": false
|
24 | }],
|
25 | // best practices
|
26 | "complexity": [2, 8],
|
27 | "default-case": 2,
|
28 | "guard-for-in": 2,
|
29 | "no-alert": 1,
|
30 | "no-floating-decimal": 1,
|
31 | "no-self-compare": 2,
|
32 | "no-throw-literal": 2,
|
33 | "no-void": 2,
|
34 | "quote-props": [2, "as-needed"],
|
35 | "vars-on-top": 2,
|
36 | "wrap-iife": 2,
|
37 | // strict mode
|
38 | "strict": [2, "safe"],
|
39 | // variables
|
40 | "no-unused-vars": 2,
|
41 | // node.js
|
42 | "handle-callback-err": [2, "^.*(e|E)rr"],
|
43 | "no-mixed-requires": 0,
|
44 | "no-new-require": 2,
|
45 | "no-path-concat": 2,
|
46 | // stylistic issues
|
47 | "brace-style": [2, "1tbs", { "allowSingleLine": true }],
|
48 | "comma-style": [2, "last"],
|
49 | "indent": [2, 2, { "SwitchCase": 1 }],
|
50 | "max-nested-callbacks": [2, 4],
|
51 | "newline-after-var": [2, "always"],
|
52 | "no-nested-ternary": 2,
|
53 | "no-spaced-func": 0,
|
54 | "no-trailing-spaces": 2,
|
55 | "no-underscore-dangle": 0,
|
56 | "no-unneeded-ternary": 1,
|
57 | "one-var": 2,
|
58 | "quotes": [2, "single", "avoid-escape"],
|
59 | "semi": [2, "always"],
|
60 | "keyword-spacing": 2,
|
61 | "space-before-blocks": [2, "always"],
|
62 | "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
|
63 | "space-infix-ops": [1, {"int32Hint": false}],
|
64 | "spaced-comment": [2, "always"],
|
65 | // es6
|
66 | "generator-star-spacing": [2, "before"],
|
67 | // legacy jshint rules
|
68 | "max-depth": [2, 4],
|
69 | "max-params": [2, 4]
|
70 | }
|
71 | }
|