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

Commit 6df3967

Browse files
Merge pull request #42 from arnostpleskot/master
feat: use react/forbid-dom-props
2 parents 7b42477 + 2f715f1 commit 6df3967

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

environments/react/recommended.js

+5
Original file line numberDiff line numberDiff line change
@@ -262,5 +262,10 @@ module.exports = {
262262
// Invariant Violation: img is a void element tag and must neither have children nor use
263263
// dangerouslySetInnerHTML
264264
'react/void-dom-elements-no-children': 'error',
265+
266+
// Forbid certain props on DOM Nodes
267+
// This rule checks all JSX elements and verifies that no forbidden props are used on DOM Nodes.
268+
// This rule only applies to DOM Nodes (e.g. <div />) and not Components (e.g. <Component />).
269+
'react/forbid-dom-props': ['error', { forbid: ['style', 'id'] }],
265270
},
266271
}

unused.js

-3
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ module.exports = {
168168
// Forbid certain props on Components
169169
'react/forbid-component-props': 0,
170170

171-
// Forbid certain props on DOM Nodes
172-
'react/forbid-dom-props': 0,
173-
174171
// Enforce React components to have a shouldComponentUpdate method
175172
'react/require-optimization': 0,
176173

0 commit comments

Comments
 (0)