@@ -71,49 +71,49 @@ ruleTester.run('jsx-no-bind', rule, {
71
71
72
72
// Redux connect
73
73
{
74
- code : [
75
- ' class Hello extends Component {' ,
76
- ' render() {' ,
77
- ' return <div>Hello</div>;' ,
78
- ' }' ,
79
- '}' ,
80
- ' export default connect()(Hello);'
81
- ] . join ( '\n' ) ,
74
+ code : `
75
+ class Hello extends Component {
76
+ render() {
77
+ return <div>Hello</div>;
78
+ }
79
+ }
80
+ export default connect()(Hello);
81
+ ` ,
82
82
options : [ { allowBind : true } ] ,
83
83
parser : 'babel-eslint'
84
84
} ,
85
85
// Backbone view with a bind
86
86
{
87
- code : [
88
- ' var DocumentRow = Backbone.View.extend({' ,
89
- ' tagName: "li",' ,
90
- ' render: function() {' ,
91
- ' this.onTap.bind(this);' ,
92
- ' }' ,
93
- ' });'
94
- ] . join ( '\n' ) ,
87
+ code : `
88
+ var DocumentRow = Backbone.View.extend({
89
+ tagName: "li",
90
+ render: function() {
91
+ this.onTap.bind(this);
92
+ }
93
+ });
94
+ ` ,
95
95
parser : 'babel-eslint'
96
96
} ,
97
97
{
98
- code : [
99
- ' const foo = {' ,
100
- ' render: function() {' ,
101
- ' this.onTap.bind(this);' ,
102
- ' return true;' ,
103
- ' }' ,
104
- '};'
105
- ] . join ( '\n' ) ,
98
+ code : `
99
+ const foo = {
100
+ render: function() {
101
+ this.onTap.bind(this);
102
+ return true;
103
+ }
104
+ };
105
+ ` ,
106
106
parser : 'babel-eslint'
107
107
} ,
108
108
{
109
- code : [
110
- ' const foo = {' ,
111
- ' render() {' ,
112
- ' this.onTap.bind(this);' ,
113
- ' return true;' ,
114
- ' }' ,
115
- '};'
116
- ] . join ( '\n' ) ,
109
+ code : `
110
+ const foo = {
111
+ render() {
112
+ this.onTap.bind(this);
113
+ return true;
114
+ }
115
+ };
116
+ ` ,
117
117
parser : 'babel-eslint'
118
118
}
119
119
] ,
@@ -141,61 +141,61 @@ ruleTester.run('jsx-no-bind', rule, {
141
141
parser : 'babel-eslint'
142
142
} ,
143
143
{
144
- code : [
145
- ' var Hello = createReactClass({' ,
146
- ' render: function() {' ,
147
- ' const click = this.someMethod.bind(this);' ,
148
- ' return <div onClick={click}>Hello {this.state.name}</div>;' ,
149
- ' }' ,
150
- ' });'
151
- ] . join ( '\n' ) ,
144
+ code : `
145
+ var Hello = createReactClass({
146
+ render: function() {
147
+ const click = this.someMethod.bind(this);
148
+ return <div onClick={click}>Hello {this.state.name}</div>;
149
+ }
150
+ });
151
+ ` ,
152
152
errors : [ { message : 'JSX props should not use .bind()' } ] ,
153
153
parser : 'babel-eslint'
154
154
} ,
155
155
{
156
- code : [
157
- ' class Hello23 extends React.Component {' ,
158
- ' render() {' ,
159
- ' const click = this.someMethod.bind(this);' ,
160
- ' return <div onClick={click}>Hello {this.state.name}</div>;' ,
161
- ' }' ,
162
- '};'
163
- ] . join ( '\n' ) ,
156
+ code : `
157
+ class Hello23 extends React.Component {
158
+ render() {
159
+ const click = this.someMethod.bind(this);
160
+ return <div onClick={click}>Hello {this.state.name}</div>;
161
+ }
162
+ };
163
+ ` ,
164
164
errors : [ { message : 'JSX props should not use .bind()' } ] ,
165
165
parser : 'babel-eslint'
166
166
} ,
167
167
{
168
- code : [
169
- ' const foo = {' ,
170
- ' render: function() {' ,
171
- ' const click = this.onTap.bind(this);' ,
172
- ' return <div onClick={onClick}>Hello</div>;' ,
173
- ' }' ,
174
- '};'
175
- ] . join ( '\n' ) ,
168
+ code : `
169
+ const foo = {
170
+ render: function() {
171
+ const click = this.onTap.bind(this);
172
+ return <div onClick={onClick}>Hello</div>;
173
+ }
174
+ };
175
+ ` ,
176
176
errors : [ { message : 'JSX props should not use .bind()' } ] ,
177
177
parser : 'babel-eslint'
178
178
} ,
179
179
{
180
- code : [
181
- ' const foo = {' ,
182
- ' render: ({onClick}) => (' ,
183
- ' <div onClick={onClick.bind(this)}>Hello</div>' ,
184
- ' )' ,
185
- '};'
186
- ] . join ( '\n' ) ,
180
+ code : `
181
+ const foo = {
182
+ render: ({onClick}) => (
183
+ <div onClick={onClick.bind(this)}>Hello</div>
184
+ )
185
+ };
186
+ ` ,
187
187
errors : [ { message : 'JSX props should not use .bind()' } ] ,
188
188
parser : 'babel-eslint'
189
189
} ,
190
190
{
191
- code : [
192
- ' const foo = {' ,
193
- ' render() {' ,
194
- ' const click = this.onTap.bind(this);' ,
195
- ' return <div onClick={onClick}>Hello</div>;' ,
196
- ' }' ,
197
- '};'
198
- ] . join ( '\n' ) ,
191
+ code : `
192
+ const foo = {
193
+ render() {
194
+ const click = this.onTap.bind(this);
195
+ return <div onClick={onClick}>Hello</div>;
196
+ }
197
+ };
198
+ ` ,
199
199
errors : [ { message : 'JSX props should not use .bind()' } ] ,
200
200
parser : 'babel-eslint'
201
201
} ,
0 commit comments