Skip to content

ESLint setup

marcoFijan edited this page Jun 22, 2020 · 2 revisions

We make use of ESlint to make sure everyone uses the same code structure. This is our ESlint setup:

Our ESlint setup

{
    "env": {
        "commonjs": true,
        "es6": true,
        "node": true
    },
    "globals": {
        "Atomics": "readonly",
        "SharedArrayBuffer": "readonly"
    },
    "parserOptions": {
        "ecmaVersion": 11
    },
    "extends": ["airbnb-base", "eslint:recommended"],
    "rules": {
        "quotes": ["error",
            "single", {
                "allowTemplateLiterals": true
            }
        ],
        "semi": [2, "never"],
        "comma-dangle": ["error"],
        "indent": ["error"],
        "no-console": ["off"],
        "arrow-body-style": ["error"],
        "import/newline-after-import": ["error"],
        "prefer-arrow-callback": ["error", {
            "allowNamedFunctions": true
        }],
        "prefer-const": ["error", {
            "destructuring": "any",
            "ignoreReadBeforeAssign": false
        }],
        "consistent-return": ["warn"]
    }
}