@@ -29,103 +29,103 @@ ruleTester.run('no-unescaped-entities', rule, {
29
29
30
30
valid : [
31
31
{
32
- code : [
33
- ' var Hello = createReactClass({' ,
34
- ' render: function() {' ,
35
- ' return (' ,
36
- ' <div/>' ,
37
- ' );' ,
38
- ' }' ,
39
- ' });'
40
- ] . join ( '\n' )
32
+ code : `
33
+ var Hello = createReactClass({
34
+ render: function() {
35
+ return (
36
+ <div/>
37
+ );
38
+ }
39
+ });
40
+ `
41
41
} , {
42
- code : [
43
- ' var Hello = createReactClass({' ,
44
- ' render: function() {' ,
45
- ' return <div>Here is some text!</div>;' ,
46
- ' }' ,
47
- ' });'
48
- ] . join ( '\n' )
42
+ code : `
43
+ var Hello = createReactClass({
44
+ render: function() {
45
+ return <div>Here is some text!</div>;
46
+ }
47
+ });
48
+ `
49
49
} , {
50
- code : [
51
- ' var Hello = createReactClass({' ,
52
- ' render: function() {' ,
53
- ' return <div>I’ve escaped some entities: > < &</div>;' ,
54
- ' }' ,
55
- ' });'
56
- ] . join ( '\n' )
50
+ code : `
51
+ var Hello = createReactClass({
52
+ render: function() {
53
+ return <div>I’ve escaped some entities: > < &</div>;
54
+ }
55
+ });
56
+ `
57
57
} , {
58
- code : [
59
- ' var Hello = createReactClass({' ,
60
- ' render: function() {' ,
61
- ' return <div>first line is ok' ,
62
- ' so is second' ,
63
- ' and here are some escaped entities: > < &</div>;' ,
64
- ' }' ,
65
- ' });'
66
- ] . join ( '\n' )
58
+ code : `
59
+ var Hello = createReactClass({
60
+ render: function() {
61
+ return <div>first line is ok
62
+ so is second
63
+ and here are some escaped entities: > < &</div>;
64
+ }
65
+ });
66
+ `
67
67
} , {
68
- code : [
69
- ' var Hello = createReactClass({' ,
70
- ' render: function() {' ,
71
- ' return <div>{">" + "<" + "&" + \'"\ '}</div>;' ,
72
- ' },' ,
73
- ' });'
74
- ] . join ( '\n' )
68
+ code : `
69
+ var Hello = createReactClass({
70
+ render: function() {
71
+ return <div>{">" + "<" + "&" + '" '}</div>;
72
+ },
73
+ });
74
+ `
75
75
}
76
76
] ,
77
77
78
78
invalid : [
79
79
{
80
- code : [
81
- ' var Hello = createReactClass({' ,
82
- ' render: function() {' ,
83
- ' return <div>></div>;' ,
84
- ' }' ,
85
- ' });'
86
- ] . join ( '\n' ) ,
80
+ code : `
81
+ var Hello = createReactClass({
82
+ render: function() {
83
+ return <div>></div>;
84
+ }
85
+ });
86
+ ` ,
87
87
errors : [ { message : 'HTML entities must be escaped.' } ]
88
88
} , {
89
- code : [
90
- ' var Hello = createReactClass({' ,
91
- ' render: function() {' ,
92
- ' return <div>first line is ok' ,
93
- ' so is second' ,
94
- ' and here are some bad entities: ></div>' ,
95
- ' }' ,
96
- ' });'
97
- ] . join ( '\n' ) ,
89
+ code : `
90
+ var Hello = createReactClass({
91
+ render: function() {
92
+ return <div>first line is ok
93
+ so is second
94
+ and here are some bad entities: ></div>
95
+ }
96
+ });
97
+ ` ,
98
98
errors : [ { message : 'HTML entities must be escaped.' } ]
99
99
} , {
100
- code : [
101
- ' var Hello = createReactClass({' ,
102
- ' render: function() {' ,
103
- ' return <div>\ '</div>;' ,
104
- ' }' ,
105
- ' });'
106
- ] . join ( '\n' ) ,
100
+ code : `
101
+ var Hello = createReactClass({
102
+ render: function() {
103
+ return <div>'</div>;
104
+ }
105
+ });
106
+ ` ,
107
107
errors : [ { message : 'HTML entities must be escaped.' } ]
108
108
} , {
109
- code : [
110
- ' var Hello = createReactClass({' ,
111
- ' render: function() {' ,
112
- ' return <div>Multiple errors: \ '>></div>;' ,
113
- ' }' ,
114
- ' });'
115
- ] . join ( '\n' ) ,
109
+ code : `
110
+ var Hello = createReactClass({
111
+ render: function() {
112
+ return <div>Multiple errors: '>></div>;
113
+ }
114
+ });
115
+ ` ,
116
116
errors : [
117
117
{ message : 'HTML entities must be escaped.' } ,
118
118
{ message : 'HTML entities must be escaped.' } ,
119
119
{ message : 'HTML entities must be escaped.' }
120
120
]
121
121
} , {
122
- code : [
123
- ' var Hello = createReactClass({' ,
124
- ' render: function() {' ,
125
- ' return <div>{"Unbalanced braces"}}</div>;' ,
126
- ' }' ,
127
- ' });'
128
- ] . join ( '\n' ) ,
122
+ code : `
123
+ var Hello = createReactClass({
124
+ render: function() {
125
+ return <div>{"Unbalanced braces"}}</div>;
126
+ }
127
+ });
128
+ ` ,
129
129
errors : [ { message : 'HTML entities must be escaped.' } ]
130
130
}
131
131
]
0 commit comments