lint: remove spaces from array brackets
Henry Zhu committed
Feb 19, 2015 at 00:13 UTC
eba5d1365c106261a85c806bd8a93b22bd8dafac
6 files changed
+67
-67
src/classic/element/__tests__/ReactElementValidator-test.js
+3
-3
@@ -40,7 +40,7 @@ describe('ReactElementValidator', function() {
40
spyOn(console, 'warn');
41
var Component = React.createFactory(ComponentClass);
42
43
- Component(null, [ Component(), Component() ]);
43
+ Component(null, [Component(), Component()]);
44
45
expect(console.warn.argsForCall.length).toBe(1);
46
expect(console.warn.argsForCall[0][0]).toContain(
@@ -64,7 +64,7 @@ describe('ReactElementValidator', function() {
64
var ComponentWrapper = React.createClass({
65
displayName: 'ComponentWrapper',
66
render: function() {
67
- return InnerComponent({childSet: [ Component(), Component() ] });
67
+ return InnerComponent({childSet: [Component(), Component()] });
68
}
69
});
70
@@ -108,7 +108,7 @@ describe('ReactElementValidator', function() {
108
spyOn(console, 'warn');
109
var Component = React.createFactory(ComponentClass);
110
111
- Component(null, [ Component({key: '#1'}), Component({key: '#2'}) ]);
111
+ Component(null, [Component({key: '#1'}), Component({key: '#2'})]);
112
113
expect(console.warn.argsForCall.length).toBe(0);
114
});
src/core/__tests__/ReactComponentLifeCycle-test.js
+2
-2
@@ -291,10 +291,10 @@ describe('ReactComponentLifeCycle', function() {
291
spyOn(console, 'warn');
292
var Component = React.createClass({
293
getInitialState: function() {
294
- return { isMounted: false };
294
+ return {isMounted: false};
295
},
296
componentDidMount: function() {
297
- this.setState({ isMounted: true });
297
+ this.setState({isMounted: true});
298
},
299
render: function() {
300
if (this.state.isMounted) {
src/core/__tests__/ReactCompositeComponentNestedState-test.js
+11
-11
@@ -99,17 +99,17 @@ describe('ReactCompositeComponentNestedState-state', function() {
99
);
100
101
expect(logger.mock.calls).toEqual([
102
- [ 'parent-render', 'blue' ],
103
- [ 'getInitialState', 'blue' ],
104
- [ 'render', 'dark blue', 'blue' ],
105
- [ 'handleHue', 'dark blue', 'blue' ],
106
- [ 'parent-handleColor', 'blue' ],
107
- [ 'parent-render', 'green' ],
108
- [ 'setState-this', 'dark blue', 'blue' ],
109
- [ 'setState-args', 'dark blue', 'green' ],
110
- [ 'render', 'light green', 'green' ],
111
- [ 'parent-after-setState', 'green' ],
112
- [ 'after-setState', 'light green', 'green' ]
102
+ ['parent-render', 'blue'],
103
+ ['getInitialState', 'blue'],
104
+ ['render', 'dark blue', 'blue'],
105
+ ['handleHue', 'dark blue', 'blue'],
106
+ ['parent-handleColor', 'blue'],
107
+ ['parent-render', 'green'],
108
+ ['setState-this', 'dark blue', 'blue'],
109
+ ['setState-args', 'dark blue', 'green'],
110
+ ['render', 'light green', 'green'],
111
+ ['parent-after-setState', 'green'],
112
+ ['after-setState', 'light green', 'green']
113
]);
114
});
115
});
src/core/__tests__/ReactCompositeComponentState-test.js
+47
-47
@@ -155,67 +155,67 @@ describe('ReactCompositeComponent-state', function() {
155
156
expect(stateListener.mock.calls).toEqual([
157
// there is no state when getInitialState() is called
158
- [ 'getInitialState', null ],
159
- [ 'componentWillMount-start', 'red' ],
158
+ ['getInitialState', null],
159
+ ['componentWillMount-start', 'red'],
160
// setState()'s only enqueue pending states.
161
- [ 'componentWillMount-after-sunrise', 'red' ],
162
- [ 'componentWillMount-end', 'red' ],
161
+ ['componentWillMount-after-sunrise', 'red'],
162
+ ['componentWillMount-end', 'red'],
163
// pending state queue is processed
164
- [ 'before-setState-sunrise', 'red' ],
165
- [ 'after-setState-sunrise', 'sunrise' ],
166
- [ 'after-setState-orange', 'orange' ],
164
+ ['before-setState-sunrise', 'red'],
165
+ ['after-setState-sunrise', 'sunrise'],
166
+ ['after-setState-orange', 'orange'],
167
// pending state has been applied
168
- [ 'render', 'orange' ],
169
- [ 'componentDidMount-start', 'orange' ],
168
+ ['render', 'orange'],
169
+ ['componentDidMount-start', 'orange'],
170
// setState-sunrise and setState-orange should be called here,
171
// after the bug in #1740
172
// componentDidMount() called setState({color:'yellow'}), which is async.
173
// The update doesn't happen until the next flush.
174
- [ 'componentDidMount-end', 'orange' ],
175
- [ 'shouldComponentUpdate-currentState', 'orange' ],
176
- [ 'shouldComponentUpdate-nextState', 'yellow' ],
177
- [ 'componentWillUpdate-currentState', 'orange' ],
178
- [ 'componentWillUpdate-nextState', 'yellow' ],
179
- [ 'render', 'yellow' ],
180
- [ 'componentDidUpdate-currentState', 'yellow' ],
181
- [ 'componentDidUpdate-prevState', 'orange' ],
182
- [ 'setState-yellow', 'yellow' ],
183
- [ 'initial-callback', 'yellow' ],
184
- [ 'componentWillReceiveProps-start', 'yellow' ],
174
+ ['componentDidMount-end', 'orange'],
175
+ ['shouldComponentUpdate-currentState', 'orange'],
176
+ ['shouldComponentUpdate-nextState', 'yellow'],
177
+ ['componentWillUpdate-currentState', 'orange'],
178
+ ['componentWillUpdate-nextState', 'yellow'],
179
+ ['render', 'yellow'],
180
+ ['componentDidUpdate-currentState', 'yellow'],
181
+ ['componentDidUpdate-prevState', 'orange'],
182
+ ['setState-yellow', 'yellow'],
183
+ ['initial-callback', 'yellow'],
184
+ ['componentWillReceiveProps-start', 'yellow'],
185
// setState({color:'green'}) only enqueues a pending state.
186
- [ 'componentWillReceiveProps-end', 'yellow' ],
186
+ ['componentWillReceiveProps-end', 'yellow'],
187
// pending state queue is processed
188
// before-setState-receiveProps never called, due to replaceState.
189
- [ 'before-setState-again-receiveProps', undefined ],
190
- [ 'after-setState-receiveProps', 'green' ],
191
- [ 'shouldComponentUpdate-currentState', 'yellow' ],
192
- [ 'shouldComponentUpdate-nextState', 'green' ],
193
- [ 'componentWillUpdate-currentState', 'yellow' ],
194
- [ 'componentWillUpdate-nextState', 'green' ],
195
- [ 'render', 'green' ],
196
- [ 'componentDidUpdate-currentState', 'green' ],
197
- [ 'componentDidUpdate-prevState', 'yellow' ],
198
- [ 'setState-receiveProps', 'green' ],
199
- [ 'setProps', 'green' ],
189
+ ['before-setState-again-receiveProps', undefined],
190
+ ['after-setState-receiveProps', 'green'],
191
+ ['shouldComponentUpdate-currentState', 'yellow'],
192
+ ['shouldComponentUpdate-nextState', 'green'],
193
+ ['componentWillUpdate-currentState', 'yellow'],
194
+ ['componentWillUpdate-nextState', 'green'],
195
+ ['render', 'green'],
196
+ ['componentDidUpdate-currentState', 'green'],
197
+ ['componentDidUpdate-prevState', 'yellow'],
198
+ ['setState-receiveProps', 'green'],
199
+ ['setProps', 'green'],
200
// setFavoriteColor('blue')
201
- [ 'shouldComponentUpdate-currentState', 'green' ],
202
- [ 'shouldComponentUpdate-nextState', 'blue' ],
203
- [ 'componentWillUpdate-currentState', 'green' ],
204
- [ 'componentWillUpdate-nextState', 'blue' ],
205
- [ 'render', 'blue' ],
206
- [ 'componentDidUpdate-currentState', 'blue' ],
207
- [ 'componentDidUpdate-prevState', 'green' ],
208
- [ 'setFavoriteColor', 'blue' ],
201
+ ['shouldComponentUpdate-currentState', 'green'],
202
+ ['shouldComponentUpdate-nextState', 'blue'],
203
+ ['componentWillUpdate-currentState', 'green'],
204
+ ['componentWillUpdate-nextState', 'blue'],
205
+ ['render', 'blue'],
206
+ ['componentDidUpdate-currentState', 'blue'],
207
+ ['componentDidUpdate-prevState', 'green'],
208
+ ['setFavoriteColor', 'blue'],
209
// forceUpdate()
210
- [ 'componentWillUpdate-currentState', 'blue' ],
211
- [ 'componentWillUpdate-nextState', 'blue' ],
212
- [ 'render', 'blue' ],
213
- [ 'componentDidUpdate-currentState', 'blue' ],
214
- [ 'componentDidUpdate-prevState', 'blue' ],
215
- [ 'forceUpdate', 'blue' ],
210
+ ['componentWillUpdate-currentState', 'blue'],
211
+ ['componentWillUpdate-nextState', 'blue'],
212
+ ['render', 'blue'],
213
+ ['componentDidUpdate-currentState', 'blue'],
214
+ ['componentDidUpdate-prevState', 'blue'],
215
+ ['forceUpdate', 'blue'],
216
// unmountComponent()
217
// state is available within `componentWillUnmount()`
218
- [ 'componentWillUnmount', 'blue' ]
218
+ ['componentWillUnmount', 'blue']
219
]);
220
});
221
});
src/modern/element/__tests__/ReactJSXElementValidator-test.js
+2
-2
@@ -61,7 +61,7 @@ describe('ReactJSXElementValidator', function() {
61
render() {
62
return (
63
<InnerComponent
64
- childSet={[ <Component />, <Component /> ]}
64
+ childSet={[<Component />, <Component />]}
65
/>
66
);
67
}
@@ -103,7 +103,7 @@ describe('ReactJSXElementValidator', function() {
103
it('does not warns for arrays of elements with keys', function() {
104
spyOn(console, 'warn');
105
106
- <Component>{[ <Component key="#1" />, <Component key="#2" /> ]}</Component>;
106
+ <Component>{[<Component key="#1" />, <Component key="#2" />]}</Component>;
107
108
expect(console.warn.argsForCall.length).toBe(0);
109
});
src/utils/__tests__/ReactChildren-test.js
+2
-2
@@ -434,7 +434,7 @@ describe('ReactChildren', function() {
434
it('should warn if a fragment is accessed', function() {
435
spyOn(console, 'warn');
436
var child = React.createElement('span');
437
- var frag = ReactChildren.map([ child, child ], function(c) {
437
+ var frag = ReactChildren.map([child, child], function(c) {
438
return c;
439
});
440
for (var key in frag) {
@@ -444,7 +444,7 @@ describe('ReactChildren', function() {
444
expect(console.warn.calls.length).toBe(1);
445
expect(console.warn.calls[0].args[0]).toContain('is an opaque type');
446
447
- var frag2 = ReactChildren.map([ child, child ], function(c) {
447
+ var frag2 = ReactChildren.map([child, child], function(c) {
448
return c;
449
});
450
for (var key in frag2) {