Skip to content

Commit e5c34b1

Browse files
committed
Adding react void-dom-elements-no-children and forbid-foreign-prop-types rules.
1 parent f38c1e7 commit e5c34b1

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 2.23.0
4+
- Added react/void-dom-elements-no-children rule
5+
- Added react/forbid-foreign-prop-types rule
6+
37
## 2.22.0
48
- Added style/template-tag-spacing rule
59

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-smartthings",
3-
"version": "2.22.0",
3+
"version": "2.23.0",
44
"description": "SmartThings's ESLint config",
55
"main": "index.js",
66
"repository": {

rules/react.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ module.exports = {
1313
'react/display-name': 0,
1414
// Forbid certain props on Components
1515
'react/forbid-component-props': 0,
16+
// Forbid certain elements (forbid-elements)
17+
'react/forbid-elements': 0,
18+
// Forbid foreign propTypes (forbid-foreign-prop-types)
19+
'react/forbid-foreign-prop-types': 2,
1620
// Checks all JSX components and verifies that no forbidden propsTypes are used.
1721
'react/forbid-prop-types': 0,
1822
// Enforce boolean attributes notation in JSX
@@ -141,6 +145,8 @@ module.exports = {
141145
// Enforce propTypes declarations alphabetical sorting
142146
'react/sort-prop-types': 0,
143147
// Enforce style prop value being an object
144-
'react/style-prop-object': 2
148+
'react/style-prop-object': 2,
149+
// Prevent void DOM elements (e.g. <img />, <br />) from receiving children
150+
'react/void-dom-elements-no-children': 2
145151
}
146152
};

0 commit comments

Comments
 (0)