Skip to content

Commit 41ce755

Browse files
committed
extend docs
1 parent 15f8835 commit 41ce755

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/rules/forbid-component-props.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ For `propNamePattern` glob string patterns:
7575
}
7676
```
7777

78+
```js
79+
{
80+
"propNamePattern": '**-**',
81+
"allowedForPatterns": ["*Component"],
82+
"message": "Avoid using kebab-case except components that match the `*Component` pattern"
83+
}
84+
```
85+
7886
Use `allowedForPatterns` for glob string patterns:
7987

8088
```js
@@ -95,6 +103,17 @@ Use `disallowedForPatterns` for glob string patterns:
95103
}
96104
```
97105

106+
Combine several properties to cover more cases:
107+
108+
```js
109+
{
110+
"propName": "someProp",
111+
"allowedFor": ['div'],
112+
"allowedForPatterns": ["*Component"],
113+
"message": "Avoid using `someProp` except `div` and components that match the `*Component` pattern"
114+
}
115+
```
116+
98117
### Related rules
99118

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

0 commit comments

Comments
 (0)