This repository has been archived by the owner on Jun 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreact.js
152 lines (145 loc) · 4.17 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/**
* react.js: ESLint configuration for React based projects
*
* Copyright 2016-2018 Sudaraka Wijesinghe <[email protected]>
*
* This program comes with ABSOLUTELY NO WARRANTY;
* This is free software, and you are welcome to redistribute it and/or modify
* it under the terms of the BSD 2-clause License. See the LICENSE file for more
* details.
*
*/
module.exports = {
'extends': './default.js',
'plugins': [ 'react' ],
'parserOptions': { 'ecmaFeatures': { 'jsx': true } },
'env': {
'browser': true,
'node': true
},
'rules': {
// Possible Errors
'no-extra-parens': [
'error',
'functions'
],
// React standard
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/display-name': 'off',
'react/default-props-match-prop-types': 'error',
'react/destructuring-assignment': [
'error',
'always'
],
'react/forbid-component-props': 'error',
'react/forbid-dom-props': 'error',
'react/forbid-elements': [
'error',
{ 'forbid': [] }
],
'react/forbid-foreign-prop-types': 'error',
'react/forbid-prop-types': 'error',
'react/no-access-state-in-setstate': 'error',
'react/no-array-index-key': 'error',
'react/no-children-prop': 'error',
'react/no-danger': 'error',
'react/no-danger-with-children': 'error',
'react/no-deprecated': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'error',
'react/no-is-mounted': 'error',
'react/no-multi-comp': 'error',
'react/no-redundant-should-component-update': 'error',
'react/no-render-return-value': 'error',
'react/no-set-state': 'error',
'react/no-string-refs': 'error',
'react/no-this-in-sfc': 'error',
'react/no-typos': 'error',
'react/no-unescaped-entities': 'error',
'react/no-unknown-property': 'error',
'react/no-unused-state': 'error',
'react/no-unused-prop-types': 'error',
'react/no-will-update-set-state': 'error',
'react/prefer-es6-class': 'error',
'react/prefer-stateless-function': 'error',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'error',
'react/require-default-props': 'error',
'react/require-optimization': 'error',
'react/require-render-return': 'error',
'react/self-closing-comp': 'error',
'react/sort-comp': 'error',
'react/sort-prop-types': 'error',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error',
// React standard: JSX
'react/jsx-boolean-value': [
'error',
'always'
],
'react/jsx-child-element-spacing': 'off',
'react/jsx-closing-bracket-location': [
'error',
'line-aligned'
],
'react/jsx-closing-tag-location': 'error',
'react/jsx-curly-brace-presence': 'off',
'react/jsx-curly-spacing': [
'error',
'always'
],
'react/jsx-equals-spacing': [
'error',
'never'
],
'react/jsx-filename-extension': [
'error',
{
'extensions': [
'.js',
'.jsx'
]
}
],
'react/jsx-first-prop-new-line': [
'error',
'multiline'
],
'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': 'off',
'react/jsx-no-bind': 'error',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-literals': 'off',
'react/jsx-no-target-blank': 'off',
'react/jsx-no-undef': 'error',
'react/jsx-one-expression-per-line': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-sort-props': 'off',
'react/jsx-sort-default-props': 'off',
'react/jsx-space-before-closing': 'off',
'react/jsx-tag-spacing': [
'error',
{
'closingSlash': 'never',
'beforeSelfClosing': 'always',
'afterOpening': 'never'
}
],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-wrap-multilines': 'error'
}
}