|
1 | 1 | { |
2 | | - "extend": "eslint-config-airbnb", |
| 2 | + "extends": "eslint-config-airbnb", |
3 | 3 |
|
4 | 4 | "parserOptions": { |
5 | 5 | "ecmaVersion": 6, |
|
20 | 20 |
|
21 | 21 | "plugins": [ |
22 | 22 | "import", |
23 | | - "react" |
| 23 | + "react", |
| 24 | + "dependencies" |
24 | 25 | ], |
25 | 26 |
|
| 27 | + "globals": { |
| 28 | + "__CLIENT__": true, |
| 29 | + "__SERVER__": true, |
| 30 | + "__DEVELOPMENT__": true, |
| 31 | + "__DISABLE_SSR__": true |
| 32 | + }, |
| 33 | + |
26 | 34 | "rules": { |
27 | 35 | //Possible Errors |
28 | 36 | "no-console": "error", |
29 | 37 | "no-unexpected-multiline": "error", |
30 | 38 |
|
31 | 39 | // Best Practices |
| 40 | + "class-methods-use-this": "off", |
| 41 | + "consistent-return": ["error", { "treatUndefinedAsUnspecified": true }], |
32 | 42 | "dot-location": ["error", "property"], |
33 | 43 | "no-implicit-globals": "error", |
34 | 44 | "no-invalid-this": "error", |
| 45 | + "no-param-reassign": ["error", { "props": false }], |
35 | 46 | "no-unmodified-loop-condition": "error", |
36 | 47 | "no-useless-call": "error", |
| 48 | + "no-void": "off", |
37 | 49 |
|
38 | 50 | // Variables |
39 | 51 | "no-catch-shadow": "error", |
40 | 52 | "no-label-var": "error", |
| 53 | + "no-shadow": ["error", { "allow": ["cb", "next", "req", "res", "err", "error"] }], |
41 | 54 | "no-undef-init": "error", |
42 | 55 | "no-undefined": "error", |
43 | 56 | "no-use-before-define": ["error", "nofunc"], |
| 57 | + "no-unused-expressions": ["error", { "allowShortCircuit": true }], |
| 58 | + "no-unused-vars": ["error", { "args": "none" }], |
44 | 59 |
|
45 | 60 | // Node.js |
46 | 61 | "callback-return": "error", |
47 | 62 | "no-path-concat": "error", |
48 | 63 |
|
49 | 64 | // Stylistic Issues |
| 65 | + "comma-dangle": ["error", "always-multiline"], |
50 | 66 | "linebreak-style": ["error", "unix"], |
| 67 | + "no-plusplus": "off", |
51 | 68 |
|
52 | 69 | // ECMAScript 6 |
53 | | - "arrow-parens": "error", |
| 70 | + "arrow-parens": ["error", "always"], |
54 | 71 | "constructor-super": "error", |
55 | 72 | "generator-star-spacing": ["error", "after"], |
56 | 73 | "no-this-before-super": "error", |
| 74 | + "prefer-arrow-callback": ["error", { "allowNamedFunctions": true }], |
57 | 75 | "prefer-spread": "error", |
| 76 | + "prefer-template": "off", |
58 | 77 |
|
59 | 78 | // React |
| 79 | + "react/forbid-prop-types": "off", |
60 | 80 | "react/no-danger": "error", |
61 | | - "react/no-deprecated": "error", |
62 | | - "react/no-did-mount-set-state": "error", |
63 | | - "react/no-did-update-set-state": "error", |
64 | 81 | "react/no-direct-mutation-state": "error", |
65 | | - "react/no-is-mounted": "error", |
66 | 82 | "react/no-set-state": "error", |
67 | | - "react/no-string-refs": "error", |
68 | | - "react/require-extension": ["error", {"extensions": [".js", ".jsx"]}], |
69 | | - "react/wrap-multilines": "error", |
| 83 | + "react/no-unused-prop-types": "off", |
| 84 | + "react/prefer-stateless-function": "off", |
| 85 | + "react/prop-types": "off", |
| 86 | + "react/self-closing-comp": "off", |
70 | 87 |
|
71 | 88 | // JSX |
72 | | - "react/jsx-equals-spacing": "error", |
73 | | - "react/jsx-indent": ["error", 2], |
| 89 | + "react/jsx-filename-extension": ["error", { "extensions": [".js", ".jsx"] }], |
74 | 90 | "react/jsx-key": "error", |
75 | 91 | "react/jsx-max-props-per-line": ["error", {"maximum": 3}], |
76 | | - "react/jsx-no-duplicate-props": "error", |
77 | | - "react/jsx-space-before-closing": "error" |
| 92 | + |
| 93 | + // dependencies |
| 94 | + "dependencies/case-sensitive": "error", |
| 95 | + "dependencies/no-cycles": "error", |
| 96 | + "dependencies/no-unresolved": "error", |
| 97 | + |
| 98 | + // coding styles |
| 99 | + "max-len": ["error", 100] |
78 | 100 | } |
79 | 101 | } |
0 commit comments