Skip to content

Commit cf08725

Browse files
author
Ell Bradshaw
committed
Update documentation
1 parent 21c7e1b commit cf08725

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

docs/rules/forbid-component-props.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Examples of **correct** code for this rule:
4545

4646
An array specifying the names of props that are forbidden. The default value of this option is `['className', 'style']`.
4747
Each array element can either be a string with the property name or object specifying the property name, an optional
48-
custom message, and a component allowlist:
48+
custom message, and either a component allowlist or disallowlist:
4949

5050
```js
5151
{
@@ -55,6 +55,16 @@ custom message, and a component allowlist:
5555
}
5656
```
5757

58+
or
59+
60+
```js
61+
{
62+
"propName": "someProp",
63+
"disallowedFor": [SomeComponent, AnotherComponent],
64+
"message": "Avoid using someProp"
65+
}
66+
```
67+
5868
### Related rules
5969

6070
- [forbid-dom-props](./forbid-dom-props.md)

docs/rules/forbid-dom-props.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@ Examples of **correct** code for this rule:
4646

4747
An array of strings, with the names of props that are forbidden. The default value of this option `[]`.
4848
Each array element can either be a string with the property name or object specifying the property name, an optional
49-
custom message, and a DOM nodes disallowed list (e.g. `<div />`):
49+
custom message, and either a DOM nodes allowed or disallowed list (e.g. `div`):
50+
51+
```js
52+
{
53+
"propName": "someProp",
54+
"allowedFor": ["DOMNode", "AnotherDOMNode"],
55+
"message": "Avoid using someProp"
56+
}
57+
```
58+
59+
or
5060

5161
```js
5262
{

0 commit comments

Comments
 (0)