|
| 1 | +{ |
| 2 | + "extends": [ |
| 3 | + "eslint-config-airbnb" |
| 4 | + ], |
| 5 | + "rules": { |
| 6 | + "import/extensions": ["off"], |
| 7 | + "import/first": ["error", null], |
| 8 | + "import/order": "warn", |
| 9 | + "class-methods-use-this": ["error"], |
| 10 | + "no-param-reassign": ["error", { "props": false }], |
| 11 | + "indent": ["warn", 2, {"SwitchCase": 1}], |
| 12 | + "max-len": ["warn", { |
| 13 | + "code": 110 |
| 14 | + }], |
| 15 | + "comma-dangle": ["warn", { |
| 16 | + "arrays": "always-multiline", |
| 17 | + "objects": "always-multiline", |
| 18 | + "imports": "always-multiline", |
| 19 | + "exports": "always-multiline", |
| 20 | + "functions": "ignore" |
| 21 | + }], |
| 22 | + "no-shadow": "off", |
| 23 | + "no-case-declarations": "off", |
| 24 | + "no-restricted-syntax": [ |
| 25 | + "error", |
| 26 | + { |
| 27 | + "selector": "ForInStatement", |
| 28 | + "message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array." |
| 29 | + }, |
| 30 | + { |
| 31 | + "selector": "ForOfStatement", |
| 32 | + "message": "iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations." |
| 33 | + }, |
| 34 | + { |
| 35 | + "selector": "LabeledStatement", |
| 36 | + "message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand." |
| 37 | + }, |
| 38 | + { |
| 39 | + "selector": "WithStatement", |
| 40 | + "message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize." |
| 41 | + } |
| 42 | + ], |
| 43 | + "comma-spacing": ["warn", { "before": false, "after": true }], |
| 44 | + "camelcase": ["warn", { "properties": "never" }], |
| 45 | + "keyword-spacing": ["warn", { |
| 46 | + "before": true, |
| 47 | + "after": true, |
| 48 | + "overrides": { |
| 49 | + "return": { "after": true }, |
| 50 | + "throw": { "after": true }, |
| 51 | + "case": { "after": true } |
| 52 | + } |
| 53 | + }], |
| 54 | + "semi": ["warn", "always"], |
| 55 | + "no-underscore-dangle": ["warn", { "allowAfterThis": false }], |
| 56 | + "no-unused-vars": ["warn", { "vars": "all", "args": "after-used", "ignoreRestSiblings": true }], |
| 57 | + "object-curly-spacing": ["warn", "always"], |
| 58 | + "quote-props": ["warn", "as-needed", { "keywords": false, "unnecessary": true, "numbers": false }], |
| 59 | + "space-before-function-paren": ["warn", { |
| 60 | + "anonymous": "always", |
| 61 | + "named": "never", |
| 62 | + "asyncArrow": "always" |
| 63 | + }], |
| 64 | + "spaced-comment": ["warn", "always", { |
| 65 | + "line": { |
| 66 | + "exceptions": ["-", "+"], |
| 67 | + "markers": ["=", "!"] |
| 68 | + }, |
| 69 | + "block": { |
| 70 | + "exceptions": ["-", "+"], |
| 71 | + "markers": ["=", "!"], |
| 72 | + "balanced": true |
| 73 | + } |
| 74 | + }], |
| 75 | + "prefer-template": "warn", |
| 76 | + "prefer-const": ["warn", { |
| 77 | + "destructuring": "any", |
| 78 | + "ignoreReadBeforeAssign": true |
| 79 | + }], |
| 80 | + "prefer-arrow-callback": ["warn", { |
| 81 | + "allowNamedFunctions": false, |
| 82 | + "allowUnboundThis": true |
| 83 | + }], |
| 84 | + "arrow-parens": ["warn", "as-needed"], |
| 85 | + "no-console": ["warn", { "allow": ["warn", "error"] }], |
| 86 | + "padded-blocks": "off", |
| 87 | + "eol-last": "warn", |
| 88 | + "no-trailing-spaces": "warn", |
| 89 | + "quotes": "warn", |
| 90 | + "no-multiple-empty-lines": "warn" |
| 91 | + }, |
| 92 | + "env" : { |
| 93 | + "jest": true, |
| 94 | + "node": true |
| 95 | + }, |
| 96 | + "parser": "babel-eslint", |
| 97 | + "plugins": ["babel"] |
| 98 | +} |
0 commit comments