|
| 1 | +{ |
| 2 | + "parser": "babel-eslint", |
| 3 | + "plugins": [ |
| 4 | + "react", |
| 5 | + "flowtype" |
| 6 | + ], |
| 7 | + "parserOptions": { |
| 8 | + "ecmaVersion": 6, |
| 9 | + "sourceType": "module", |
| 10 | + "ecmaFeatures": { |
| 11 | + "jsx": true, |
| 12 | + "impliedStrict": true |
| 13 | + } |
| 14 | + }, |
| 15 | + "env": { |
| 16 | + "browser": true, |
| 17 | + "amd": true, |
| 18 | + "es6": true, |
| 19 | + "node": true, |
| 20 | + "mocha": true |
| 21 | + }, |
| 22 | + "extends": ["eslint:recommended", "plugin:react/recommended"], |
| 23 | + "rules": { |
| 24 | + "no-undef": ["warn"], |
| 25 | + "global-strict": ["off"], |
| 26 | + "no-extra-semi": ["warn"], |
| 27 | + "no-underscore-dangle": ["off"], |
| 28 | + "no-console": ["off"], |
| 29 | + "no-unused-vars": ["off"], |
| 30 | + "no-trailing-spaces": ["warn", { |
| 31 | + "skipBlankLines": true |
| 32 | + }], |
| 33 | + "no-unreachable": ["warn"], |
| 34 | + "no-spaced-func": ["warn"], |
| 35 | + "no-new-func": ["error"], |
| 36 | + "no-new-wrappers": ["error"], |
| 37 | + "no-invalid-regexp": ["error"], |
| 38 | + "no-extra-bind": ["error"], |
| 39 | + "no-magic-numbers": ["error"], |
| 40 | + "consistent-return": ["error"], |
| 41 | + "valid-jsdoc": ["error"], |
| 42 | + "no-use-before-define": ["error"], |
| 43 | + "camelcase": ["warn"], |
| 44 | + "array-callback-return": ["error"], |
| 45 | + "dot-location": ["warn", "property"], |
| 46 | + "guard-for-in": ["error"], |
| 47 | + "no-useless-call": ["warn"], |
| 48 | + "no-useless-escape": ["warn"], |
| 49 | + "no-useless-concat": ["warn"], |
| 50 | + "brace-style": ["warn", "1tbs"], |
| 51 | + "comma-style": ["warn", "last"], |
| 52 | + "space-before-function-paren": ["warn", "never"], |
| 53 | + "space-before-blocks": ["warn", "always"], |
| 54 | + "keyword-spacing": ["warn", { |
| 55 | + "before": true, |
| 56 | + "after": true |
| 57 | + }], |
| 58 | + |
| 59 | + // dangling commas required, but only for multiline objects/arrays |
| 60 | + "comma-dangle": ["warn", "always-multiline"], |
| 61 | + // always === instead of ==, unless dealing with null/undefined |
| 62 | + "eqeqeq": ["error", "smart"], |
| 63 | + // always use curly braces, even with single statements |
| 64 | + "curly": ["error", "all"], |
| 65 | + // phasing out var in favour of let/const is a good idea |
| 66 | + "no-var": ["warn"], |
| 67 | + // always require semicolons |
| 68 | + "semi": ["error", "always"], |
| 69 | + // prefer rest and spread over the Old Ways |
| 70 | + "prefer-spread": ["warn"], |
| 71 | + "prefer-rest-params": ["warn"], |
| 72 | + |
| 73 | + /** react **/ |
| 74 | + |
| 75 | + // bind or arrow function in props causes performance issues |
| 76 | + "react/jsx-no-bind": ["error"], |
| 77 | + "react/jsx-key": ["error"], |
| 78 | + "react/prefer-stateless-function": ["warn"], |
| 79 | + "react/sort-comp": ["warn"], |
| 80 | + |
| 81 | + /** flowtype **/ |
| 82 | + "flowtype/require-parameter-type": 1, |
| 83 | + "flowtype/require-return-type": [ |
| 84 | + 1, |
| 85 | + "always", |
| 86 | + { |
| 87 | + "annotateUndefined": "never" |
| 88 | + } |
| 89 | + ], |
| 90 | + "flowtype/space-after-type-colon": [ |
| 91 | + 1, |
| 92 | + "always" |
| 93 | + ], |
| 94 | + "flowtype/space-before-type-colon": [ |
| 95 | + 1, |
| 96 | + "never" |
| 97 | + ] |
| 98 | + }, |
| 99 | + "settings": { |
| 100 | + "flowtype": { |
| 101 | + "onlyFilesWithFlowAnnotation": true |
| 102 | + } |
| 103 | + } |
| 104 | +} |
0 commit comments