Skip to content

Commit a3b7044

Browse files
committed
docs: add documentation for new introduced options
1 parent caf714e commit a3b7044

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/rules/no-danger.md

+19
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ var React = require('react');
2424
var Hello = <div>Hello World</div>;
2525
```
2626

27+
## Rule Options
28+
29+
```js
30+
...
31+
"react/no-danger": [<enabled>, {
32+
"checkCustomComponents": boolean,
33+
"customComponentNames": Array<string>,
34+
}]
35+
...
36+
```
37+
38+
### checkCustomComponents
39+
40+
Defaults to `false`, when `enabled` allows the rule to check for custom components.
41+
42+
### customComponentNames
43+
44+
If you want to enable this rule for a specific set of custom components, you can pass `checkCustomComponents` as `true` and `customComponentNames` as the array of name of your custom components.
45+
2746
## When Not To Use It
2847

2948
If you are certain the content passed to dangerouslySetInnerHTML is sanitized HTML you can disable this rule.

lib/rules/no-danger.js

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const messages = {
4343
dangerousProp: 'Dangerous property \'{{name}}\' found',
4444
};
4545

46+
/** @type {import('eslint').Rule.RuleModule} */
4647
module.exports = {
4748
meta: {
4849
docs: {

0 commit comments

Comments
 (0)