This repository was archived by the owner on Mar 7, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -24,5 +24,12 @@ module.exports = {
24
24
callbacksLast : false ,
25
25
requiredFirst : false ,
26
26
} ] ,
27
+
28
+ // Forbid foreign propTypes
29
+ // This rule forbids using another component's prop types unless they are explicitly
30
+ // imported/exported. This allows people who want to use
31
+ // babel-plugin-transform-react-remove-prop-types to remove propTypes from their components in
32
+ // production builds, to do so safely
33
+ 'react/forbid-foreign-prop-types' : 1 ,
27
34
} ,
28
35
}
Original file line number Diff line number Diff line change @@ -179,5 +179,13 @@ module.exports = {
179
179
// Enforce style prop value being an object
180
180
// Require that the value of the prop style be an object or a variable that is an object.
181
181
'react/style-prop-object' : 2 ,
182
+
183
+ // Prevent void DOM elements (e.g. <img />, <br />) from receiving children
184
+ // There are some HTML elements that are only self-closing (e.g. img, br, hr). These are
185
+ // collectively known as void DOM elements. If you try to give these children, React will give
186
+ // you a warning:
187
+ // Invariant Violation: img is a void element tag and must neither have children nor use
188
+ // dangerouslySetInnerHTML
189
+ 'react/void-dom-elements-no-children' : 2 ,
182
190
} ,
183
191
}
Original file line number Diff line number Diff line change 9
9
"contributors" : [],
10
10
"dependencies" : {
11
11
"eslint-plugin-import" : " ^2.2.0" ,
12
- "eslint-plugin-react" : " ^6.9 .0"
12
+ "eslint-plugin-react" : " ^6.10 .0"
13
13
},
14
14
"devDependencies" : {
15
15
"eslint" : " ^3.16.0"
Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ module.exports = {
138
138
139
139
// eslint-plugin-react
140
140
141
+ // Forbid certain elements
142
+ 'react/forbid-elements' : 0 ,
143
+
141
144
// Forbid certain propTypes
142
145
// This rule checks all JSX components and verifies that no forbidden propsTypes are used.
143
146
'react/forbid-prop-types' : 0 ,
You can’t perform that action at this time.
0 commit comments