{
    "extends": "eslint:recommended",
    "parser": "babel-eslint",
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module"
    },
    "env": { "browser": true, "es6":  true, "mocha": true },
    "rules": {
        "complexity": [ "warn", 10 ],

        // Limits.
        "max-len": [ "warn", { "code": 120 } ],
        "max-depth": [ "warn", 3 ],
        "max-lines": [ "warn", 300 ],
        "max-nested-callbacks": [ "warn", 3 ],
        "max-params": [ "warn", 4 ],
        "max-statements": [ "warn", 20 ],

        // General code style
        "comma-dangle": [ "error",  "always-multiline" ],
        "new-cap": "error",
        "no-prototype-builtins": "error",
        "no-proto": "error",
        "no-extend-native": "error",
        "curly": [ "warn", "all" ],
        "comma-style": [ "warn", "last" ],
        "camelcase": [ "warn", { "properties": "always" }],
        "brace-style": [ "warn", "1tbs" ],
        "eol-last": "warn",
        "func-style": [ "warn", "declaration", { "allowArrowFunctions": true } ],
        "implicit-arrow-linebreak": ["warn", "beside"],
        "line-comment-position": [ "warn", "above" ],
        "no-trailing-spaces": "warn",
        "constructor-super": "error",
        "object-shorthand": "warn",
        "prefer-arrow-callback": "warn",
        "prefer-const": "warn",
        "prefer-rest-params": "warn",

        // Spacing
        "array-bracket-spacing": [ "warn", "always"],
        "object-curly-spacing": [ "warn", "always", { "arraysInObjects": false, "objectsInObjects": false } ],
        "func-call-spacing": [ "warn", "never" ],
        "indent": [ "error",  4,  { "SwitchCase": 1 } ],
        "no-tabs": "error",
        "block-spacing": [ "warn", "always" ],
        "space-in-parens": [ "warn", "never" ],
        "space-infix-ops": "warn",
        "space-unary-ops": [ "warn", { "words": true, "nonwords": false } ],
        "spaced-comment": [ "warn", "always", { "block": { "balanced": true } } ],
        "switch-colon-spacing": ["error", {"after": true, "before": false}],
        "arrow-body-style": [ "error", "as-needed" ],
        "arrow-spacing": [ "warn", { "before": true, "after": true } ],

        // Semicolons
        "semi": [ "error", "always" ],
        "semi-spacing": [ "error", { "before": false, "after": true }],
        "semi-style": [ "error", "last" ],

        // Disallow potentially harmful or confusing syntax
        "no-console": [ "error", { "allow": [ "warn", "error", "log" ] } ],
        "no-cond-assign": "off",
        "no-await-in-loop": "warn",
        "no-misleading-character-class": "error",
        "no-alert": "error",
        "no-eval": "error",
        "no-implicit-globals": "warn",
        "no-return-await": "warn",
        "no-throw-literal": "error",
        "radix": "warn",
        "require-await": "warn",
        "no-restricted-globals": "warn",
        "no-shadow": "warn",
        "no-use-before-define": "error",
        "no-lonely-if": "error",
        "no-multi-assign": "error",
        "no-nested-ternary": "error",
        "no-underscore-dangle": "error",
        "no-unneeded-ternary": "error",
        "no-const-assign": "error",
        "no-duplicate-imports": "error",
        "no-var": "error"
    },
    "globals": {
        "__dirname": false,
        "process": false,
        "module": false,
        "require": false,
        "google": false,
        "lightGallery": false
    }
}
