Skip to content

Instantly share code, notes, and snippets.

@aeinbu
Last active May 6, 2019 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aeinbu/d72626da5d9d7d17474be82e5b2af9aa to your computer and use it in GitHub Desktop.
Save aeinbu/d72626da5d9d7d17474be82e5b2af9aa to your computer and use it in GitHub Desktop.
My ESLint file
module.exports = {
"env":
{
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions":
{
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules":
{
"indent": ["error", "tab"],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
"semi": ["error", "always"],
"consistent-return": "error",
"no-empty-function": "error",
"no-lone-blocks": "error",
"no-multi-spaces": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-use-before-define": "error",
"no-multiple-empty-lines": ["error", { max: 2 }],
"prefer-const": "error",
"prefer-rest-params": "error"
}
};
@aeinbu
Copy link
Author

aeinbu commented May 6, 2019

Alternative

{
    "extends": "eslint:recommended",
    "env":{
        "node": true,
        "mocha": true,
        "browser": true,
        "es6": true,
        "commonjs": true
    },
    "parserOptions": {
        "ecmaVersion": 2018,
        "ecmaFeatures": {
            "experimentalObjectRestSpread": true
        },
        "sourceType": "module"
    },
    "rules": {
        "indent": ["off", 4],
        "no-console": ["off"],
        "no-empty": ["warn"],
        "no-extra-semi": ["warn"],
        "no-mixed-spaces-and-tabs": ["off"],
        "no-unused-vars": ["off"],
        "radix": ["error"],
        "no-with": ["error"],
        "for-direction": ["error"],
        "getter-return": ["error"],
        "no-useless-escape": "warn",
        "quotes": ["off", "double"],
        "semi": ["off", "always"],
        "semi-spacing": ["warn", {"before": false, "after": true}]
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment