-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.eslintrc.json
More file actions
50 lines (50 loc) · 1.83 KB
/
.eslintrc.json
File metadata and controls
50 lines (50 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"env": {
"node": true, // this is the best starting point
"browser": true, // for react web
"es6": true, // enables es6 features
"jest": true // unit testing
},
"parser": "babel-eslint", // needed to make babel stuff work properly
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/no-named-as-default": 0,
"function-paren-newline": ["error", "consistent"],
"no-console": "off", // console logging is extremely useful
"no-mixed-operators": "off", // I personally don't see anything wrong with x + y / z
"prefer-rest-params": "off",
"no-underscore-dangle": "off", // firebase loves returning props with leading underscores
"prefer-destructuring": [
"error",
{
"array": false,
"object": true
}
],
"react/require-default-props": "off",
"arrow-body-style": 0, // don't enforce arrow-body-style, block body (() => { ... }) and single expression (() => ...) depends on use case
"object-curly-newline": "off",
"react/no-did-update-set-state": "off", // sometimes this is necessary
"arrow-parens": "off", // parenthesis around single argument or not, depends on the use case
"no-bitwise": "off",
"no-nested-ternary": "off", // I personally prefer nested ternaries
"react/jsx-indent": "off", // conflicts with prettier
"import/no-extraneous-dependencies": "off", // for this project, we don't want to add dependencies where not necessary
"react/sort-comp": [
1,
{ "order": ["constructor", "static-methods", "lifecycle", "everything-else", "render"] }
]
},
"plugins": ["react", "react-native"],
"globals": {
"__DEV__": true
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".android.js", ".ios.js"]
}
}
}
}