| OLD | NEW |
| (Empty) |
| 1 module.exports = { | |
| 2 "root": true, | |
| 3 | |
| 4 "env": { | |
| 5 "browser": true, | |
| 6 "es6": true | |
| 7 }, | |
| 8 | |
| 9 /** | |
| 10 * ESLint rules | |
| 11 * | |
| 12 * All available rules: http://eslint.org/docs/rules/ | |
| 13 * | |
| 14 * Rules take the following form: | |
| 15 * "rule-name", [severity, { opts }] | |
| 16 * Severity: 2 == error, 1 == warning, 0 == off. | |
| 17 */ | |
| 18 "rules": { | |
| 19 /** | |
| 20 * Enforced rules | |
| 21 */ | |
| 22 | |
| 23 | |
| 24 // syntax preferences | |
| 25 // "indent": [2, 2, { "SwitchCase": 1, "CallExpression": {"arguments": 2
}, "MemberExpression": 2 }], | |
| 26 "quotes": [2, "single", { | |
| 27 "avoidEscape": true, | |
| 28 "allowTemplateLiterals": true | |
| 29 }], | |
| 30 "semi": 2, | |
| 31 "no-extra-semi": 2, | |
| 32 "comma-style": [2, "last"], | |
| 33 "wrap-iife": [2, "inside"], | |
| 34 "spaced-comment": [2, "always", { | |
| 35 "markers": ["*"] | |
| 36 }], | |
| 37 "eqeqeq": [2], | |
| 38 "arrow-body-style": [2, "as-needed"], | |
| 39 "accessor-pairs": [2, { | |
| 40 "getWithoutSet": false, | |
| 41 "setWithoutGet": false | |
| 42 }], | |
| 43 | |
| 44 // anti-patterns | |
| 45 "no-with": 2, | |
| 46 "no-multi-str": 2, | |
| 47 "no-caller": 2, | |
| 48 "no-implied-eval": 2, | |
| 49 "no-labels": 2, | |
| 50 "no-new-object": 2, | |
| 51 "no-octal-escape": 2, | |
| 52 "no-self-compare": 2, | |
| 53 "no-shadow-restricted-names": 2, | |
| 54 | |
| 55 // es2015 features | |
| 56 // "no-useless-constructor": 2, | |
| 57 "require-yield": 2, | |
| 58 "template-curly-spacing": [2, "never"], | |
| 59 | |
| 60 // spacing details | |
| 61 "space-infix-ops": 2, | |
| 62 "space-in-parens": [2, "never"], | |
| 63 "space-before-function-paren": [2, "never"], | |
| 64 "no-whitespace-before-property": 2, | |
| 65 "keyword-spacing": [2, { | |
| 66 "overrides": { | |
| 67 "if": {"after": true}, | |
| 68 "else": {"after": true}, | |
| 69 "for": {"after": true}, | |
| 70 "while": {"after": true}, | |
| 71 "do": {"after": true}, | |
| 72 "switch": {"after": true}, | |
| 73 "return": {"after": true} | |
| 74 } | |
| 75 }], | |
| 76 "arrow-spacing": [2, { | |
| 77 "after": true, | |
| 78 "before": true | |
| 79 }], | |
| 80 | |
| 81 // file whitespace | |
| 82 "no-multiple-empty-lines": [2, {"max": 2}], | |
| 83 "no-mixed-spaces-and-tabs": 2, | |
| 84 "no-trailing-spaces": 2, | |
| 85 "linebreak-style": [ 2, "unix" ], | |
| 86 | |
| 87 | |
| 88 /** | |
| 89 * Disabled, aspirational rules | |
| 90 */ | |
| 91 | |
| 92 // brace-style is disabled, as eslint cannot enforce 1tbs as default, bu
t allman for functions | |
| 93 "brace-style": [0, "allman", { "allowSingleLine": true }], | |
| 94 | |
| 95 // key-spacing is disabled, as some objects use value-aligned spacing, s
ome not. | |
| 96 "key-spacing": [0, { | |
| 97 "beforeColon": false, | |
| 98 "afterColon": true, | |
| 99 "align": "value" | |
| 100 }], | |
| 101 // quote-props is diabled, as property quoting styles are too varied to
enforce. | |
| 102 "quote-props": [0, "as-needed"], | |
| 103 | |
| 104 // no-implicit-globals will prevent accidental globals | |
| 105 "no-implicit-globals": [0] | |
| 106 } | |
| 107 }; | |
| OLD | NEW |