From 2f715f14de224efad4643781f31888815b8655cf Mon Sep 17 00:00:00 2001 From: Arnost Pleskot Date: Fri, 2 Nov 2018 11:41:59 +0100 Subject: [PATCH] feat: use react/forbid-dom-props move forbid DOM props from unused to recommended for "id" and "style" props --- environments/react/recommended.js | 5 +++++ unused.js | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/environments/react/recommended.js b/environments/react/recommended.js index 89831d8..9efa50e 100644 --- a/environments/react/recommended.js +++ b/environments/react/recommended.js @@ -262,5 +262,10 @@ module.exports = { // Invariant Violation: img is a void element tag and must neither have children nor use // dangerouslySetInnerHTML 'react/void-dom-elements-no-children': 'error', + + // Forbid certain props on DOM Nodes + // This rule checks all JSX elements and verifies that no forbidden props are used on DOM Nodes. + // This rule only applies to DOM Nodes (e.g.
) and not Components (e.g. ). + 'react/forbid-dom-props': ['error', { forbid: ['style', 'id'] }], }, } diff --git a/unused.js b/unused.js index eeb0cd1..5744a84 100644 --- a/unused.js +++ b/unused.js @@ -168,9 +168,6 @@ module.exports = { // Forbid certain props on Components 'react/forbid-component-props': 0, - // Forbid certain props on DOM Nodes - 'react/forbid-dom-props': 0, - // Enforce React components to have a shouldComponentUpdate method 'react/require-optimization': 0,