summaryrefslogtreecommitdiff
path: root/.eslintrc
blob: c28a798ce83f3bbe6ea01466befc02a7f85c1c95 (plain)
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
{
    "env": {
        "browser": true,
        "es6": true
    },
    "parserOptions": {
        "sourceType": "module"
    },
    "extends": "eslint:recommended",
    "rules": {
        // Unsafe or confusing stuff that we forbid

        "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
        "no-constant-condition": ["error", { "checkLoops": false }],
        "no-var": "error",
        "no-useless-constructor": "error",
        "object-shorthand": ["error", "methods", { "avoidQuotes": true }],
        "prefer-arrow-callback": "error",
        "arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": false } ],
        "arrow-parens": ["error", "as-needed", { "requireForBlockBody": true }],
        "arrow-spacing": ["error"],
        "no-confusing-arrow": ["error", { "allowParens": true }],

        // Enforced coding style

        "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
        "indent": ["error", 4, { "SwitchCase": 1,
                                 "CallExpression": { "arguments": "first" },
                                 "ArrayExpression": "first",
                                 "ObjectExpression": "first",
                                 "ignoreComments": true }],
        "comma-spacing": ["error"],
        "comma-style": ["error"],
        "func-call-spacing": ["error"],
        "func-names": ["error"],
        "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
        "key-spacing": ["error"],
        "keyword-spacing": ["error"],
        "no-trailing-spaces": ["error"],
    }
}