File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -64,3 +64,20 @@ This rule can take one argument to ignore some specific props during validation.
64
64
65
65
* ` enabled ` : for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.
66
66
* ` ignore ` : optional array of props name to ignore during validation.
67
+
68
+ ### As for "exceptions"
69
+
70
+ It would seem that some common properties such as ` props.children ` or ` props.className `
71
+ (and alike) need to be treated as exceptions.
72
+
73
+ As it aptly noticed in
74
+ [ #7 ] ( https://github.com/yannickcr/eslint-plugin-react/issues/7 )
75
+
76
+ > Why should children be an exception?
77
+ > Most components don't need ` this.props.children ` , so that makes it extra important
78
+ to document ` children ` in the propTypes.
79
+
80
+ > If ` children ` is difficult to figure out which type to use,
81
+ one can always use ` React.PropTypes.any `
82
+
83
+ Since 2.0.0 children is no longer ignored for props validation.
Original file line number Diff line number Diff line change 4
4
*/
5
5
'use strict' ;
6
6
7
+ // As for exceptions for props.children or props.className (and alike) look at
8
+ // https://github.com/yannickcr/eslint-plugin-react/issues/7
9
+
7
10
var componentUtil = require ( '../util/component' ) ;
8
11
var ComponentList = componentUtil . List ;
9
12
You can’t perform that action at this time.
0 commit comments