@@ -6,36 +6,32 @@ export const cases = run("no-innerhtml", rule, {
6
6
valid : [
7
7
`let el = <div prop1 prop2={2}>Hello world!</div>` ,
8
8
`let el = <Box prop1 prop2={2}>Hello world!</Box>` ,
9
- {
10
- code : `let el = <div prop1 prop2={2} innerHTML="<p>Hello</p><p>world!</p>" />` ,
11
- options : [ { allowStatic : true } ] ,
12
- } ,
13
- {
14
- code : `let el = <div prop1 prop2={2} innerHTML={"<p>Hello</p>" + "<p>world!</p>"} />` ,
15
- options : [ { allowStatic : true } ] ,
16
- } ,
17
- {
18
- code : `let el = <div prop1 prop2={2} innerHTML="<p>Hello</p><p>world!</p>"></div>` ,
19
- options : [ { allowStatic : true } ] ,
20
- } ,
9
+ `let el = <div prop1 prop2={2} innerHTML="<p>Hello</p><p>world!</p>" />` ,
10
+ `let el = <div prop1 prop2={2} innerHTML={"<p>Hello</p>" + "<p>world!</p>"} />` ,
11
+ `let el = <div prop1 prop2={2} innerHTML="<p>Hello</p><p>world!</p>"></div>` ,
21
12
] ,
22
13
invalid : [
23
14
{
24
15
code : `let el = <div prop1 prop2={2} innerHTML="<p>Hello</><p>world!</p>" />` ,
16
+ options : [ { allowStatic : false } ] ,
17
+ errors : [ { messageId : "dangerous" } ] ,
18
+ } ,
19
+ {
20
+ code : `let el = <div innerHTML={"<p>Hello</p><p>world!</p>"} />` ,
21
+ options : [ { allowStatic : false } ] ,
25
22
errors : [ { messageId : "dangerous" } ] ,
26
23
} ,
27
24
{
28
25
code : `let el = <div prop1 prop2={2} innerHTML={"<p>Hello</p>" + "<p>world!</p>"} />` ,
26
+ options : [ { allowStatic : false } ] ,
29
27
errors : [ { messageId : "dangerous" } ] ,
30
28
} ,
31
29
{
32
30
code : `let el = <div prop1 prop2={2} innerHTML={Math.random()} />` ,
33
- options : [ { allowStatic : true } ] ,
34
31
errors : [ { messageId : "dangerous" } ] ,
35
32
} ,
36
33
{
37
34
code : `let el = <div prop1 prop2={2} innerHTML="Hello world!" />` ,
38
- options : [ { allowStatic : true } ] ,
39
35
errors : [
40
36
{
41
37
messageId : "notHtml" ,
@@ -56,7 +52,6 @@ export const cases = run("no-innerhtml", rule, {
56
52
</div>
57
53
);
58
54
` ,
59
- options : [ { allowStatic : true } ] ,
60
55
errors : [ { messageId : "conflict" , type : T . JSXElement } ] ,
61
56
} ,
62
57
{
@@ -68,7 +63,6 @@ export const cases = run("no-innerhtml", rule, {
68
63
</div>
69
64
);
70
65
` ,
71
- options : [ { allowStatic : true } ] ,
72
66
errors : [ { messageId : "conflict" , type : T . JSXElement } ] ,
73
67
} ,
74
68
{
@@ -79,7 +73,6 @@ export const cases = run("no-innerhtml", rule, {
79
73
</div>
80
74
);
81
75
` ,
82
- options : [ { allowStatic : true } ] ,
83
76
errors : [ { messageId : "conflict" , type : T . JSXElement } ] ,
84
77
} ,
85
78
{
@@ -90,7 +83,6 @@ export const cases = run("no-innerhtml", rule, {
90
83
</div>
91
84
);
92
85
` ,
93
- options : [ { allowStatic : true } ] ,
94
86
errors : [ { messageId : "conflict" , type : T . JSXElement } ] ,
95
87
} ,
96
88
{
0 commit comments