-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.js
129 lines (128 loc) · 3.63 KB
/
react.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
module.exports = {
"extends": [
"plugin:react/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
// React
"react/button-has-type": "error",
"react/default-props-match-prop-types": "error",
"react/no-access-state-in-setstate": "error",
"react/no-array-index-key": "error",
"react/no-arrow-function-lifecycle": "error",
"react/no-danger": "error",
"react/no-did-mount-set-state": "error",
"react/no-did-update-set-state": "error",
"react/no-invalid-html-attribute": "error",
"react/no-multi-comp": [
"error",
{
"ignoreStateless": true
}
],
"react/no-unused-prop-types": "error",
"react/prefer-es6-class": "error",
"react/prefer-stateless-function": "error",
"react/no-namespace": "error",
"react/no-redundant-should-component-update": "error",
"react/no-this-in-sfc": "error",
"react/no-typos": "error",
"react/no-unsafe": "error",
"react/no-unused-state": "error",
"react/self-closing-comp": [
"error",
{
"component": true,
"html": false
}
],
"react/sort-comp": "error",
"react/sort-prop-types": [
"warn",
{
"callbacksLast": true,
"ignoreCase": true,
"requiredFirst": true
}
],
"react/void-dom-elements-no-children": "error",
// JSX
"react/jsx-closing-tag-location": "error",
"react/jsx-curly-newline": [
"error",
"consistent"
],
"react/jsx-equals-spacing": [
"error",
"never"
],
"react/jsx-handler-names": "error",
"react/jsx-indent": [
"error",
4,
{
"checkAttributes": true,
"indentLogicalExpressions": true
}
],
"react/jsx-key": [
"error",
{
"checkFragmentShorthand": true,
"warnOnDuplicates": true
}
],
"react/jsx-max-props-per-line": [
"error",
{
"maximum": 1,
"when": "multiline"
}
],
"react/jsx-no-bind": [
"error",
{
"ignoreRefs": true
}
],
"react/jsx-no-constructed-context-values": "error",
"react/jsx-no-duplicate-props": [
"error",
{
"ignoreCase": true
}
],
"react/jsx-no-leaked-render": "error",
"react/jsx-no-script-url": "error",
"react/jsx-no-target-blank": [
"error",
{
"warnOnSpreadAttributes": true
}
],
"react/jsx-no-useless-fragment": "error",
"react/jsx-one-expression-per-line": [
"error",
{
"allow": "single-child"
}
],
"react/jsx-pascal-case": "error",
"react/jsx-props-no-multi-spaces": "warn",
"react/jsx-sort-default-props": "warn",
"react/jsx-tag-spacing": "error",
"react/jsx-wrap-multilines": "error"
}
};