-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.js
87 lines (84 loc) · 2.53 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
'use strict'
module.exports = {
'extends': [ 'plugin:react/recommended' ],
'plugins': [ 'react' ],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
'rules': {
// React
'react/forbid-prop-types': 'error',
'react/no-danger': 'error',
'react/no-did-update-set-state': 'error',
'react/no-multi-comp': [ 'error', { 'ignoreStateless': true } ],
'react/no-render-return-value': 'error',
'react/no-string-refs': 'error',
'react/prefer-es6-class': 'error',
'react/prefer-stateless-function': 'off',
'react/require-optimization': 'off',
'react/self-closing-comp': 'error',
'react/sort-comp': [ 1, {
'order': [
'static-methods',
'type-annotations',
'lifecycle',
'/^on.+$/',
'everything-else',
'render'
],
'groups': {
'lifecycle': [
'displayName',
'propTypes',
'contextTypes',
'defaultProps',
'statics',
'childContextTypes',
'getDefaultProps',
'getInitialState',
'getChildContext',
'mixins',
'state',
'constructor',
'componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'componentDidUpdate',
'componentWillUnmount'
]
}
}
],
'react/sort-prop-types': 'error',
// JSX
'react/jsx-boolean-value': 'error',
'react/jsx-closing-bracket-location': [ 'error', 'line-aligned' ],
'react/jsx-curly-spacing': [ 'error', { "when": "never", "children": true } ],
'react/jsx-equals-spacing': 'error',
'react/jsx-filename-extension': 'off',
'react/jsx-first-prop-new-line': 'error',
'react/jsx-handler-names': 'error',
'react/jsx-indent': [ 'error', 2 ],
'react/jsx-indent-props': [ 'error', 2 ],
'react/jsx-key': 'error',
'react/jsx-max-props-per-line': [ 'error', { 'maximum': 4 } ],
'react/jsx-no-bind': [ 'error', { 'allowArrowFunctions': true } ],
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-literals': 'off',
'react/jsx-no-target-blank': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-sort-props': 'error',
'react/jsx-tag-spacing': [ 'error', {
'closingSlash': 'never',
'beforeSelfClosing': 'always',
'afterOpening': 'never'
} ],
'react/jsx-wrap-multilines': [ 'error', { 'assignment': false } ]
}
}