-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
99 lines (99 loc) · 2.17 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
module.exports = {
env: {
es6: true,
node: true,
browser: true
},
extends: 'eslint:recommended',
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
classes: true
},
ecmaVersion: 2015,
sourceType: 'module'
},
plugins: ['react'],
rules: {
'max-len': [
'error',
{
code: 150
}
],
'prefer-template': 'error',
'no-console': 'warn',
'no-unused-vars': 'warn',
'no-case-declarations': 'warn',
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'prefer-destructuring': 'error',
'react/boolean-prop-naming': 'error',
'react/no-danger': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-this-in-sfc': 'error',
'react/sort-prop-types': [
'error',
{
ignoreCase: true,
callbacksLast: true,
requiredFirst: true,
sortShapeProp: true
}
],
'react/jsx-curly-spacing': [
'error',
{
when: 'always',
spacing: {
objectLiterals: 'never'
}
}
],
'react/jsx-first-prop-new-line': ['error', 'multiline'],
'react/jsx-handler-names': 'error',
'react/jsx-key': 'error',
'react/jsx-max-props-per-line': [
'error',
{
maximum: 1,
when: 'always'
}
],
'react/jsx-curly-brace-presence': 0,
'react/jsx-sort-default-props': [
'error',
{
ignoreCase: true
}
],
'react/jsx-sort-props': 0,
'react/jsx-tag-spacing': [
'error',
{
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
beforeClosing: 'never'
}
],
'react/jsx-wrap-multilines': [
'error',
{
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'ignore',
logical: 'ignore',
prop: 'parens-new-line'
}
]
}
}