Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit d8b9bd4

Browse files
Upgrade eslint-plugin-react to 6.10 🤘
1 parent 7d82bd9 commit d8b9bd4

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

‎environments/react/optional.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

‎environments/react/recommended.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
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"

‎unused.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)