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 = {
2424 callbacksLast : false ,
2525 requiredFirst : false ,
2626 } ] ,
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 ,
2734 } ,
2835}
Original file line number Diff line number Diff line change @@ -179,5 +179,13 @@ module.exports = {
179179 // Enforce style prop value being an object
180180 // Require that the value of the prop style be an object or a variable that is an object.
181181 '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 ,
182190 } ,
183191}
Original file line number Diff line number Diff line change 99 "contributors" : [],
1010 "dependencies" : {
1111 "eslint-plugin-import" : " ^2.2.0" ,
12- "eslint-plugin-react" : " ^6.9 .0"
12+ "eslint-plugin-react" : " ^6.10 .0"
1313 },
1414 "devDependencies" : {
1515 "eslint" : " ^3.16.0"
Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ module.exports = {
138138
139139 // eslint-plugin-react
140140
141+ // Forbid certain elements
142+ 'react/forbid-elements' : 0 ,
143+
141144 // Forbid certain propTypes
142145 // This rule checks all JSX components and verifies that no forbidden propsTypes are used.
143146 'react/forbid-prop-types' : 0 ,
You canβt perform that action at this time.
0 commit comments