@@ -89,6 +89,7 @@ module.exports = {
89
89
'react/sort-prop-types' : [ 0 , {
90
90
ignoreCase : false ,
91
91
callbacksLast : false ,
92
+ requiredFirst : false ,
92
93
} ] ,
93
94
94
95
// Deprecated in favor of react/jsx-sort-props
@@ -99,11 +100,13 @@ module.exports = {
99
100
'react/jsx-sort-props' : [ 0 , {
100
101
ignoreCase : false ,
101
102
callbacksLast : false ,
103
+ shorthandFirst : false ,
104
+ shorthandLast : false ,
102
105
} ] ,
103
106
104
107
// Prevent React to be incorrectly marked as unused
105
108
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
106
- 'react/jsx-uses-react' : [ 2 , { pragma : 'React' } ] ,
109
+ 'react/jsx-uses-react' : [ 2 ] ,
107
110
108
111
// Prevent variables used in JSX to be incorrectly marked as unused
109
112
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
@@ -115,15 +118,15 @@ module.exports = {
115
118
116
119
// Prevent usage of deprecated methods
117
120
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
118
- 'react/no-deprecated' : [ 1 , { react : '0.14.0' } ] ,
121
+ 'react/no-deprecated' : [ 1 ] ,
119
122
120
123
// Prevent usage of setState in componentDidMount
121
124
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
122
- 'react/no-did-mount-set-state' : [ 2 , 'allow-in-func' ] ,
125
+ 'react/no-did-mount-set-state' : [ 2 ] ,
123
126
124
127
// Prevent usage of setState in componentDidUpdate
125
128
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
126
- 'react/no-did-update-set-state' : [ 2 , 'allow-in-func' ] ,
129
+ 'react/no-did-update-set-state' : [ 2 ] ,
127
130
128
131
// Prevent direct mutation of this.state
129
132
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
@@ -167,7 +170,7 @@ module.exports = {
167
170
168
171
// Restrict file extensions that may be required
169
172
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md
170
- 'react/require-extension' : [ 0 , { extensions : [ '.jsx' ] } ] ,
173
+ 'react/require-extension' : [ 0 , { extensions : [ '.jsx' , '.js' ] } ] ,
171
174
172
175
// Require render() methods to return something
173
176
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
@@ -196,12 +199,13 @@ module.exports = {
196
199
} ] ,
197
200
198
201
// Prevent missing parentheses around multilines JSX
199
- // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md
200
- 'react/wrap-multilines' : [ 2 , {
202
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx- wrap-multilines.md
203
+ 'react/jsx- wrap-multilines' : [ 2 , {
201
204
declaration : true ,
202
205
assignment : true ,
203
206
return : true
204
207
} ] ,
208
+ 'react/wrap-multilines' : 0 , // deprecated version
205
209
206
210
// Require that the first prop in a JSX element be on a new line when the element is multiline
207
211
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
@@ -218,7 +222,32 @@ module.exports = {
218
222
// Disallow target="_blank" on links
219
223
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
220
224
// TODO: enable
221
- 'react/jsx-no-target-blank' : 0
225
+ 'react/jsx-no-target-blank' : 0 ,
226
+
227
+ // only .jsx files may have JSX
228
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
229
+ // TODO: enable
230
+ 'react/jsx-filename-extension' : [ 0 , { extensions : [ '.jsx' ] } ] ,
231
+
232
+ // prevent accidental JS comments from being injected into JSX as text
233
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
234
+ // TODO: enable
235
+ 'react/jsx-no-comment-textnodes' : 0 ,
236
+ 'react/no-comment-textnodes' : 0 , // deprecated version
237
+
238
+ // disallow using React.render/ReactDOM.render's return value
239
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
240
+ // TODO: enable
241
+ 'react/no-render-return-value' : 0 ,
242
+
243
+ // require a shouldComponentUpdate method, or PureRenderMixin
244
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md
245
+ 'react/require-optimization' : [ 0 , { allowDecorators : [ ] } ] ,
246
+
247
+ // warn against using findDOMNode()
248
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
249
+ // TODO: enable
250
+ 'react/no-find-dom-node' : 0 ,
222
251
} ,
223
252
224
253
settings : {
0 commit comments