Last active
October 22, 2018 21:55
-
-
Save angrykoala/783a7b5eecfd84ae0c88f0479853a186 to your computer and use it in GitHub Desktop.
My rules for javascript eslint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"mocha": true, | |
"node": true, | |
"browser": true, | |
"es6": true | |
}, | |
"parserOptions": { | |
"ecmaVersion": 8, | |
"sourceType": "script" | |
}, | |
"plugins": [], | |
"globals": {}, | |
"extends": [ | |
"eslint:recommended" | |
], | |
"rules": { | |
"no-await-in-loop": "warn", | |
"no-template-curly-in-string": "warn", | |
"require-atomic-updates": "error", | |
"array-callback-return": "off", | |
"block-scoped-var": "error", | |
"complexity": ["warn", 6], | |
"dot-notation": "error", | |
"dot-location": ["error", "property"], | |
"eqeqeq": ["error", "always"], | |
"guard-for-in": "error", | |
"max-classes-per-file": ["error", 6], | |
"no-alert": "error", | |
"no-caller": "error", | |
"no-empty-function": "warn", | |
"no-eval": "error", | |
"no-extend-native": "error", | |
"no-extra-bind": "error", | |
"no-floating-decimal": "warn", | |
"no-implicit-coercion": "error", | |
"no-implied-eval": "error", | |
"no-iterator": "error", | |
"no-labels": "error", | |
"no-multi-spaces": "warn", | |
"no-multi-str": "error", | |
"no-new": "warn", | |
"no-new-func": "error", | |
"no-new-wrappers": "error", | |
"no-proto": "error", | |
"no-return-assign": "error", | |
"no-return-await": "warn", | |
"no-script-url": "error", | |
"no-self-compare": "warn", | |
"no-sequences": "error", | |
"no-throw-literal": "warn", | |
"no-unused-expressions": "warn", | |
"no-useless-call": "error", | |
"no-useless-concat": "warn", | |
"no-useless-return": "warn", | |
"no-void": "error", | |
"no-with": "error", | |
"prefer-promise-reject-errors": "off", | |
"yoda": "warn", | |
"strict": ["error", "global"], | |
"no-shadow": "warn", | |
"no-use-before-define": "warn", | |
"no-new-require": "error", | |
"array-bracket-spacing": ["warn", "never"], | |
"block-spacing": "warn", | |
"brace-style": "error", | |
"camelcase": "error", | |
"comma-dangle": ["warn", "never"], | |
"comma-spacing": "warn", | |
"comma-style": ["warn", "last"], | |
"computed-property-spacing": ["warn", "never"], | |
"func-call-spacing": ["warn", "never"], | |
"func-style": ["error", "declaration"], | |
"function-paren-newline": ["error", "never"], | |
"implicit-arrow-linebreak": ["error", "beside"], | |
"indent": ["error", 4, { | |
"SwitchCase": 1 | |
}], | |
"key-spacing": ["error", { | |
"beforeColon": false, | |
"afterColon": true | |
}], | |
"keyword-spacing": ["error", { | |
"before": true | |
}], | |
"lines-between-class-members": ["error", "always"], | |
"max-depth": ["error", 6], | |
"max-len": ["warn", 150], | |
"max-lines": ["error", 300], | |
"max-nested-callbacks": ["error", 3], | |
"max-params": ["error", 4], | |
"new-cap": "error", | |
"new-parens": "error", | |
"no-array-constructor": "error", | |
"no-bitwise": "error", | |
"no-continue": "error", | |
"no-lonely-if": "warn", | |
"no-mixed-operators": "error", | |
"no-multi-assign": "error", | |
"no-multiple-empty-lines": "warn", | |
"no-nested-ternary": "warn", | |
"no-new-object": "error", | |
"no-trailing-spaces": "warn", | |
"no-underscore-dangle": ["error", { | |
"allowAfterThis": true, | |
"allowAfterSuper": true | |
}], | |
"no-unneeded-ternary": "warn", | |
"no-whitespace-before-property": "error", | |
"space-before-blocks": "warn", | |
"object-curly-spacing": ["warn", "never"], | |
"object-property-newline": "warn", | |
"operator-linebreak": ["error", "after"], | |
"padded-blocks": ["error", "never"], | |
"semi-spacing": "warn", | |
"semi": ["error", "always"], | |
"space-before-function-paren": ["warn", "never"], | |
"switch-colon-spacing": "error", | |
"arrow-spacing": "error", | |
"prefer-template": "error", | |
"prefer-arrow-callback": "error", | |
"no-useless-computed-key": "error", | |
"no-useless-constructor": "warn", | |
"space-infix-ops": "warn", | |
"no-var": "error", | |
"prefer-const": "warn" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment