Skip to content

Instantly share code, notes, and snippets.

@arcrose
Created March 15, 2017 20:55
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 arcrose/1707cadfafc12e8a55ddfcd9328ecdec to your computer and use it in GitHub Desktop.
Save arcrose/1707cadfafc12e8a55ddfcd9328ecdec to your computer and use it in GitHub Desktop.
A Correctness-Oriented ESLint Configuration
{
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": ["error"],
"arrow-body-style": [
"error",
"as-needed"
],
"arrow-parens": [
"error",
"always"
],
"arrow-spacing": [
"error",
{
"before": true,
"after": true
}
],
"block-spacing": [
"error",
"never"
],
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": false
}
],
"callback-return": ["error"],
"camelcase": ["error"],
"complexity": [
"error",
3
],
"consistent-return": [
"error",
{
"treatUndefinedAsUnspecified": true
}
],
"curly": [
"error",
"all"
],
"default-case": ["error"],
"dot-location": [
"error",
"property"
],
"dot-notation": ["error"],
"eqeqeq": [
"error",
"always"
],
"func-call-spacing": [
"error",
"never"
],
"generator-star-spacing": [
"error",
{
"before": true,
"after": true
}
],
"global-require": ["error"],
"handle-callback-err": ["error"],
"indent": [
"error",
2
],
"init-declarations": [
"error",
"always"
],
"key-spacing": [
"error",
{
"beforeColon": false,
"afterColon": true,
"mode": "strict"
}
],
"keyword-spacing": [
"error",
{
"before": true,
"after": true
}
],
"linebreak-style": [
"error",
"unix"
],
"max-len": [
"error",
120
],
"new-parens": ["error"],
"newline-per-chained-call": ["error"],
"no-array-constructor": ["error"],
"no-catch-shadow": ["error"],
"no-console": [
0
],
"no-const-assign": ["error"],
"no-else-return": ["error"],
"no-empty-function": ["error"],
"no-empty": ["error"],
"no-eval": ["error"],
"no-floating-decimal": ["error"],
"no-implicit-coercion": ["error"],
"no-implied-eval": ["error"],
"no-invalid-this": ["error"],
"no-lone-blocks": ["error"],
"no-loop-func": ["error"],
"no-nested-ternary": ["error"],
"no-new-object": ["error"],
"no-magic-numbers": [
"error",
{
"enforceConst": true,
"ignoreArrayIndexes": true,
"ignore": [-1, 0, 1]
}
],
"no-mixed-requires": ["error"],
"no-mixed-spaces-and-tabs": ["error"],
"no-multiple-empty-lines": ["error"],
"no-multi-assign": ["error"],
"no-multi-spaces": ["error"],
"no-return-assign": [
"error",
"always"
],
"no-sequences": ["error"],
"no-shadow-restricted-names": ["error"],
"no-throw-literal": ["error"],
"no-trailing-spaces": ["error"],
"no-undef-init": ["error"],
"no-undefined": ["error"],
"no-underscore-dangle": ["error"],
"no-unneeded-ternary": ["error"],
"no-unmodified-loop-condition": ["error"],
"no-unused-expressions": ["error"],
"no-useless-computed-key": ["error"],
"no-useless-return": ["error"],
"no-use-before-define": ["error"],
"no-whitespace-before-property": ["error"],
"no-with": ["error"],
"no-var": ["error"],
"no-void": ["error"],
"object-curly-newline": [
"error",
{
"ObjectExpression": {
"minProperties": 1
}
}
],
"object-curly-spacing": [
"error",
"always"
],
"object-property-newline": [
"error",
{
"allowMultiplePropertiesPerLine": false
}
],
"one-var": [
"error",
"never"
],
"operator-linebreak": [
"error",
"after"
],
"prefer-arrow-callback": [
"error",
{
"allowUnboundThis": false
}
],
"prefer-const": ["error"],
"prefer-numeric-literals": ["error"],
"prefer-promise-reject-errors": ["error"],
"prefer-rest-params": ["error"],
"prefer-spread": ["error"],
"prefer-template": ["error"],
"quotes": [
"error",
"single"
],
"quote-props": [
"error",
"as-needed"
],
"semi": [
"error",
"never"
],
"spaced-comment": [
"error",
"always"
],
"space-before-function-paren": [
"error",
"always"
],
"space-infix-ops": ["error"],
"space-in-parens": [
"error",
"never"
],
"space-unary-ops": ["error"],
"template-curly-spacing": [
"error",
"never"
],
"wrap-iife": [
"error",
"inside"
],
"yoda": [
"error",
"never"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment