forbid-dom-props
Configuration
Forbid certain props from being used on DOM Nodes (e.g. <div />). This rule
only applies to DOM Nodes and does not affect Components (e.g. <Foo />). The
list of forbidden props is configured via the forbid option.
Rule Details
This rule checks all JSX elements and verifies that no forbidden props are used on DOM Nodes. This rule is off by default.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Rule Options
forbid
An array specifying the names of props that are forbidden. The default value of
this option is []. Each array element can either be a string with the
property name, or an object specifying the property name, an optional custom
message, and DOM nodes the prop is disallowedFor:
You can also forbid a prop only when it has a particular value, by using the
disallowedValues option:
disallowedValues and disallowedFor can be combined to restrict a prop to a
particular value on a particular DOM Node: