@@ -53,88 +53,88 @@ ruleTester.run('forbid-foreign-prop-types', rule, {
53
53
} ] ,
54
54
55
55
invalid : [ {
56
- code : [
57
- ' var Foo = createReactClass({' ,
58
- ' propTypes: Bar.propTypes,' ,
59
- ' render: function() {' ,
60
- ' return <Foo className="bar" />;' ,
61
- ' }' ,
62
- ' });'
63
- ] . join ( '\n' ) ,
56
+ code : `
57
+ var Foo = createReactClass({
58
+ propTypes: Bar.propTypes,
59
+ render: function() {
60
+ return <Foo className="bar" />;
61
+ }
62
+ });
63
+ ` ,
64
64
errors : [ {
65
65
message : ERROR_MESSAGE ,
66
66
type : 'Identifier'
67
67
} ]
68
68
} ,
69
69
{
70
- code : [
71
- ' var Foo = createReactClass({' ,
72
- ' propTypes: Bar["propTypes"],' ,
73
- ' render: function() {' ,
74
- ' return <Foo className="bar" />;' ,
75
- ' }' ,
76
- ' });'
77
- ] . join ( '\n' ) ,
70
+ code : `
71
+ var Foo = createReactClass({
72
+ propTypes: Bar["propTypes"],
73
+ render: function() {
74
+ return <Foo className="bar" />;
75
+ }
76
+ });
77
+ ` ,
78
78
errors : [ {
79
79
message : ERROR_MESSAGE ,
80
80
type : 'Literal'
81
81
} ]
82
82
} ,
83
83
{
84
- code : [
85
- ' var { propTypes } = SomeComponent' ,
86
- ' var Foo = createReactClass({' ,
87
- ' propTypes,' ,
88
- ' render: function() {' ,
89
- ' return <Foo className="bar" />;' ,
90
- ' }' ,
91
- ' });'
92
- ] . join ( '\n' ) ,
84
+ code : `
85
+ var { propTypes } = SomeComponent
86
+ var Foo = createReactClass({
87
+ propTypes,
88
+ render: function() {
89
+ return <Foo className="bar" />;
90
+ }
91
+ });
92
+ ` ,
93
93
errors : [ {
94
94
message : ERROR_MESSAGE ,
95
95
type : 'Property'
96
96
} ]
97
97
} ,
98
98
{
99
- code : [
100
- ' var { propTypes: things, ...foo } = SomeComponent' ,
101
- ' var Foo = createReactClass({' ,
102
- ' propTypes,' ,
103
- ' render: function() {' ,
104
- ' return <Foo className="bar" />;' ,
105
- ' }' ,
106
- ' });'
107
- ] . join ( '\n' ) ,
99
+ code : `
100
+ var { propTypes: things, ...foo } = SomeComponent
101
+ var Foo = createReactClass({
102
+ propTypes,
103
+ render: function() {
104
+ return <Foo className="bar" />;
105
+ }
106
+ });
107
+ ` ,
108
108
parser : 'babel-eslint' ,
109
109
errors : [ {
110
110
message : ERROR_MESSAGE ,
111
111
type : 'Property'
112
112
} ]
113
113
} ,
114
114
{
115
- code : [
116
- ' class MyComponent extends React.Component {' ,
117
- ' static fooBar = {' ,
118
- ' baz: Qux.propTypes.baz' ,
119
- ' };' ,
120
- '}'
121
- ] . join ( '\n' ) ,
115
+ code : `
116
+ class MyComponent extends React.Component {
117
+ static fooBar = {
118
+ baz: Qux.propTypes.baz
119
+ };
120
+ }
121
+ ` ,
122
122
parser : 'babel-eslint' ,
123
123
errors : [ {
124
124
message : ERROR_MESSAGE ,
125
125
type : 'Identifier'
126
126
} ]
127
127
} ,
128
128
{
129
- code : [
130
- ' var { propTypes: typesOfProps } = SomeComponent' ,
131
- ' var Foo = createReactClass({' ,
132
- ' propTypes: typesOfProps,' ,
133
- ' render: function() {' ,
134
- ' return <Foo className="bar" />;' ,
135
- ' }' ,
136
- ' });'
137
- ] . join ( '\n' ) ,
129
+ code : `
130
+ var { propTypes: typesOfProps } = SomeComponent
131
+ var Foo = createReactClass({
132
+ propTypes: typesOfProps,
133
+ render: function() {
134
+ return <Foo className="bar" />;
135
+ }
136
+ });
137
+ ` ,
138
138
errors : [ {
139
139
message : ERROR_MESSAGE ,
140
140
type : 'Property'
0 commit comments