Skip to content

Instantly share code, notes, and snippets.

@lrecknagel
Last active August 4, 2020 14:50
Show Gist options
  • Save lrecknagel/72a0bb7a73cc6394d27f1f43bf7fb346 to your computer and use it in GitHub Desktop.
Save lrecknagel/72a0bb7a73cc6394d27f1f43bf7fb346 to your computer and use it in GitHub Desktop.
eslint based on recommendation and some own rules
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 9
},
"globals":{
"BigInt": true
},
"extends": "eslint:recommended",
"rules": {
"array-callback-return": 2,
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": ["error", "as-needed"],
"arrow-spacing": "error",
"callback-return": 2,
"camelcase": "error",
"comma-style": [2, "last"],
"comma-dangle": ["error", "always-multiline"],
"curly": [2, "multi-line", "consistent"],
"dot-location": [2, "object"],
"dot-notation": 2,
"eqeqeq": 2,
"generator-star-spacing": "error",
"id-length": [
"error",
{
"min": 3,
"exceptions": ["_", "__", "id", "ID", "fs", "ip", "fe", "to", "_f", "_g", "m", "t", "p", "ui"]
}
],
"indent": [2, 2],
"new-cap": ["error", { "capIsNewExceptions": ["BigInt"] }],
"new-parens": 2,
"no-async-promise-executor": "error",
"no-console": "off",
"no-dupe-keys": 2,
"no-mixed-operators": "error",
"no-multi-str": 2,
"no-multi-spaces": 2,
"no-param-reassign": 2,
"no-shadow-restricted-names": 2,
"no-unneeded-ternary": 2,
"no-unsafe-negation": 2,
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"no-useless-constructor": "error",
"no-useless-return": 2,
"object-shorthand": 2,
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": 2,
"prefer-rest-params": 2,
"prefer-spread": "error",
"prefer-template": 2,
"quote-props": [2, "as-needed"],
"quotes": [
2,
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": 2,
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-infix-ops": [
"error",
{
"int32Hint": false
}
],
"spaced-comment": ["error", "always"],
"template-curly-spacing": [2, "always"],
"valid-jsdoc": 1,
"yoda": 2,
"require-atomic-updates": "off",
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[arguments.length=1] > MemberExpression.callee > Identifier.property[name='reduce']",
"message": "Provide initialValue to .reduce()."
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment