File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,17 @@ This rule aims to prevent user generated links from creating security vulnerabil
12
12
` rel='noreferrer noopener' ` for external links, and optionally any dynamically generated links.
13
13
14
14
## Rule Options
15
-
16
- There are two main options for the rule:
17
-
18
- * ` {"enforceDynamicLinks": "always"} ` enforces the rule if the href is a dynamic link (default)
19
- * ` {"enforceDynamicLinks": "never"} ` does not enforce the rule if the href is a dynamic link
20
-
21
15
``` json
22
- "react/jsx-no-target-blank" : [<enabled>, { enforceDynamicLinks: <enforce> } ]
16
+ ...
17
+ "react/jsx-no-target-blank" : [<enabled>, { "enforceDynamicLinks": <enforce> } ]
18
+ ...
23
19
```
24
20
25
21
* enabled: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.
26
- * enforce: optional string, defaults to "always"
27
-
22
+ * enforce: optional string, 'always' or 'never'
28
23
29
24
### always (default)
25
+ ` {"enforceDynamicLinks": "always"} ` enforces the rule if the href is a dynamic link (default)
30
26
31
27
When {"enforceDynamicLinks": "always"} is set, the following patterns are considered errors:
32
28
@@ -47,6 +43,8 @@ var Hello = <a></a>
47
43
48
44
### never
49
45
46
+ ` {"enforceDynamicLinks": "never"} ` does not enforce the rule if the href is a dynamic link
47
+
50
48
When {"enforceDynamicLinks": "never"} is set, the following patterns are ** not** considered errors:
51
49
52
50
``` jsx
You can’t perform that action at this time.
0 commit comments