forked from locphan87/react-native-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
67 lines (66 loc) · 1.31 KB
/
.eslintrc.js
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const importRules = {
'import/order': [2, { 'newlines-between': 'always' }],
'import/newline-after-import': 2
}
const complexityRules = {
complexity: [2, 10],
'max-statements': [2, 20],
'max-depth': [2, 3],
'max-params': [2, 3],
'max-lines': [
2,
{
max: 500,
skipBlankLines: true,
skipComments: true
}
],
'import/max-dependencies': [2, { max: 30 }]
}
const reactRules = {
'react/jsx-key': 2,
'react/jsx-no-bind': 2,
'react/prefer-stateless-function': ['warn']
}
const fpRules = {
'fp/no-arguments': 2,
'fp/no-delete': 2,
'fp/no-events': 2,
'fp/no-get-set': 2,
'fp/no-let': 2,
'fp/no-loops': 2,
'fp/no-mutating-assign': 2,
'fp/no-mutating-methods': 2,
'fp/no-proxy': 2,
'fp/no-valueof-field': 2,
'no-var': 2,
'prefer-spread': 2
}
const codeStyleRules = {
'arrow-body-style': [2, 'as-needed'],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' }
]
}
const otherRules = {
'no-console': ['error'],
'no-unused-vars': ['error']
}
module.exports = {
extends: ['universe/native'],
plugins: ['fp'],
env: {
browser: true,
node: true,
jest: true
},
rules: {
...complexityRules,
...reactRules,
...fpRules,
...importRules,
...codeStyleRules,
...otherRules
}
}