lint: remove spaces from object braces
Henry Zhu committed
Feb 19, 2015 at 00:10 UTC
07cfd6602842efb957b4ab6ab5100bcfb397fc97
39 files changed
+164
-164
grunt/config/browserify.js
+1
-1
@@ -29,7 +29,7 @@ var LICENSE_TEMPLATE =
29
*/';
30
31
function minify(src) {
32
- return UglifyJS.minify(src, { fromString: true }).code;
32
+ return UglifyJS.minify(src, {fromString: true}).code;
33
}
34
35
// TODO: move this out to another build step maybe.
grunt/config/webdriver-all.js
+22
-22
@@ -23,7 +23,7 @@ module.exports = function(props) {
23
24
exports.local = {
25
webdriver: {
26
- remote: { protocol: 'http:', hostname: '127.0.0.1', port: 9515, path: '/' }
26
+ remote: {protocol: 'http:', hostname: '127.0.0.1', port: 9515, path: '/'}
27
},
28
url: props.url,
29
onStart: props.onStart,
@@ -68,33 +68,33 @@ module.exports = function(props) {
68
/*eslint-disable camelcase*/
69
/* https://saucelabs.com/platforms */
70
exports.saucelabs_ios =
71
- exports.saucelabs_ios7 = sauceItUp({ browserName: 'iphone', version: '7', platform:'OS X 10.9' });
72
- exports.saucelabs_ios6_1 = sauceItUp({ browserName: 'iphone', version: '6.1', platform:'OS X 10.8' });
73
- exports.saucelabs_ios6 = sauceItUp({ browserName: 'iphone', version: '6', platform:'OS X 10.8' });
74
- exports.saucelabs_ios5_1 = sauceItUp({ browserName: 'iphone', version: '5.1', platform:'OS X 10.8' });
75
- exports.saucelabs_ios5 = sauceItUp({ browserName: 'iphone', version: '5', platform:'OS X 10.6' });
76
- exports.saucelabs_ios4 = sauceItUp({ browserName: 'iphone', version: '4', platform:'OS X 10.6' });
71
+ exports.saucelabs_ios7 = sauceItUp({browserName: 'iphone', version: '7', platform:'OS X 10.9'});
72
+ exports.saucelabs_ios6_1 = sauceItUp({browserName: 'iphone', version: '6.1', platform:'OS X 10.8'});
73
+ exports.saucelabs_ios6 = sauceItUp({browserName: 'iphone', version: '6', platform:'OS X 10.8'});
74
+ exports.saucelabs_ios5_1 = sauceItUp({browserName: 'iphone', version: '5.1', platform:'OS X 10.8'});
75
+ exports.saucelabs_ios5 = sauceItUp({browserName: 'iphone', version: '5', platform:'OS X 10.6'});
76
+ exports.saucelabs_ios4 = sauceItUp({browserName: 'iphone', version: '4', platform:'OS X 10.6'});
77
78
exports.saucelabs_ipad =
79
- exports.saucelabs_ipad7 = sauceItUp({ browserName: 'ipad', version: '7', platform:'OS X 10.9' });
80
- exports.saucelabs_ipad6_1 = sauceItUp({ browserName: 'ipad', version: '6.1', platform:'OS X 10.8' });
81
- exports.saucelabs_ipad6 = sauceItUp({ browserName: 'ipad', version: '6', platform:'OS X 10.8' });
82
- exports.saucelabs_ipad5_1 = sauceItUp({ browserName: 'ipad', version: '5.1', platform:'OS X 10.8' });
83
- exports.saucelabs_ipad5 = sauceItUp({ browserName: 'ipad', version: '5', platform:'OS X 10.6' });
84
- exports.saucelabs_ipad4 = sauceItUp({ browserName: 'ipad', version: '4', platform:'OS X 10.6' });
79
+ exports.saucelabs_ipad7 = sauceItUp({browserName: 'ipad', version: '7', platform:'OS X 10.9'});
80
+ exports.saucelabs_ipad6_1 = sauceItUp({browserName: 'ipad', version: '6.1', platform:'OS X 10.8'});
81
+ exports.saucelabs_ipad6 = sauceItUp({browserName: 'ipad', version: '6', platform:'OS X 10.8'});
82
+ exports.saucelabs_ipad5_1 = sauceItUp({browserName: 'ipad', version: '5.1', platform:'OS X 10.8'});
83
+ exports.saucelabs_ipad5 = sauceItUp({browserName: 'ipad', version: '5', platform:'OS X 10.6'});
84
+ exports.saucelabs_ipad4 = sauceItUp({browserName: 'ipad', version: '4', platform:'OS X 10.6'});
85
86
- exports.saucelabs_android = sauceItUp({ browserName: 'android', version: '4.0', platform:'Linux' });
87
- exports.saucelabs_android_tablet = sauceItUp({ browserName: 'android', version: '4.0', platform:'Linux', 'device-type':'tablet' });
86
+ exports.saucelabs_android = sauceItUp({browserName: 'android', version: '4.0', platform:'Linux'});
87
+ exports.saucelabs_android_tablet = sauceItUp({browserName: 'android', version: '4.0', platform:'Linux', 'device-type':'tablet'});
88
89
- exports.saucelabs_safari = sauceItUp({ browserName: 'safari' });
90
- exports.saucelabs_chrome = sauceItUp({ browserName: 'chrome' });
91
- exports.saucelabs_firefox = sauceItUp({ browserName: 'firefox' });
89
+ exports.saucelabs_safari = sauceItUp({browserName: 'safari'});
90
+ exports.saucelabs_chrome = sauceItUp({browserName: 'chrome'});
91
+ exports.saucelabs_firefox = sauceItUp({browserName: 'firefox'});
92
93
exports.saucelabs_ie =
94
- exports.saucelabs_ie8 = sauceItUp({ browserName: 'internet explorer', version: 8 });
95
- exports.saucelabs_ie9 = sauceItUp({ browserName: 'internet explorer', version: 9 });
96
- exports.saucelabs_ie10 = sauceItUp({ browserName: 'internet explorer', version: 10 });
97
- exports.saucelabs_ie11 = sauceItUp({ browserName: 'internet explorer', version: 11, platform:'Windows 8.1' });
94
+ exports.saucelabs_ie8 = sauceItUp({browserName: 'internet explorer', version: 8});
95
+ exports.saucelabs_ie9 = sauceItUp({browserName: 'internet explorer', version: 9});
96
+ exports.saucelabs_ie10 = sauceItUp({browserName: 'internet explorer', version: 10});
97
+ exports.saucelabs_ie11 = sauceItUp({browserName: 'internet explorer', version: 11, platform:'Windows 8.1'});
98
/*eslint-enable camelcase*/
99
100
function sauceItUp(desiredCapabilities) {
grunt/tasks/npm.js
+2
-2
@@ -59,7 +59,7 @@ module.exports = function() {
59
'install',
60
'--production',
61
tgz
62
- ], { cwd: dir }, function() {
62
+ ], {cwd: dir}, function() {
63
var nodePath = path.join(dir, 'node_modules');
64
var pkgDir = path.join(nodePath, pkg.name);
65
var doneCount = 2;
@@ -83,7 +83,7 @@ module.exports = function() {
83
'/** @jsx React.DOM */ <div>oyez</div>;'
84
) + ')'
85
], {
86
- env: { NODE_PATH: nodePath }
86
+ env: {NODE_PATH: nodePath}
87
}, function(result, code) {
88
assert.ok(result.stdout.indexOf(
89
'React.DOM.div(null, \'oyez\');'
grunt/tasks/release.js
+4
-4
@@ -30,7 +30,7 @@ function _gitCommitAndTag(cwd, commitMsg, tag, cb) {
30
// `git add -u` to make sure we remove deleted files
31
// `git commit -m {commitMsg}`
32
// `git tag -a {tag}`
33
- var opts = { cwd: cwd};
33
+ var opts = {cwd: cwd};
34
var gitAddAll = {
35
cmd: 'git',
36
args: ['add', '*'],
@@ -91,7 +91,7 @@ function bower() {
91
// clean out the bower folder in case we're removing files
92
var files = grunt.file.expand(BOWER_GLOB);
93
files.forEach(function(file) {
94
- grunt.file.delete(file, { force: true });
94
+ grunt.file.delete(file, {force: true});
95
});
96
97
// Update bower package version and save the file back.
@@ -113,7 +113,7 @@ function docs() {
113
114
var files = grunt.file.expand(GH_PAGES_GLOB);
115
files.forEach(function(file) {
116
- grunt.file.delete(file, { force: true });
116
+ grunt.file.delete(file, {force: true});
117
});
118
119
grunt.file.copy('build/react-' + VERSION + '.zip', 'docs/downloads/react-' + VERSION + '.zip');
@@ -123,7 +123,7 @@ function docs() {
123
var rakeOpts = {
124
cmd: 'rake',
125
args: ['release'],
126
- opts: { cwd: 'docs' }
126
+ opts: {cwd: 'docs'}
127
};
128
grunt.util.spawn(rakeOpts, function() {
129
// Commit the repo. We don't really care about tagging this.
jest/ts-preprocessor.js
+1
-1
@@ -4,7 +4,7 @@ var fs = require('fs');
4
var path = require('path');
5
var ts = require('typescript');
6
7
-var tsOptions = { module: 'commonjs' };
7
+var tsOptions = {module: 'commonjs'};
8
9
function formatErrorMessage(error) {
10
return (
perf/lib/BrowserPerfRunnerApp.react.js
+2
-2
@@ -164,7 +164,7 @@ BrowserPerfRunnerApp.renderBenchmarkCell = function(props, row, col) {
164
return (
165
React.DOM.td({key:key, style:{textAlign:'center', width:234, verticalAlign:'top'}},
166
benchmark.error && benchmark.error.message || '',
167
- React.DOM.div({style: benchmark.isTheWinner ? { backgroundColor:'#0A5', color:'#AFA' } : {backgroundColor:'transparent', color:'inherit'}},
167
+ React.DOM.div({style: benchmark.isTheWinner ? {backgroundColor:'#0A5', color:'#AFA'} : {backgroundColor:'transparent', color:'inherit'}},
168
Math.round(1 / benchmark.stats.mean * 100) / 100, ' op/s ',
169
React.DOM.strong(null, Math.round(benchmark.stats.mean * 1000 * 100) / 100, ' ms/op '),
170
React.DOM.small(null, '(±' + (Math.round(benchmark.stats.rme * 10) / 10) + '%)')
@@ -198,7 +198,7 @@ var GridViewTable = React.createClass({
198
},
199
200
_renderCell: function(col) {
201
- return this.props.renderCell({ value:this.props.value }, this._row, col);
201
+ return this.props.renderCell({value:this.props.value}, this._row, col);
202
},
203
204
_renderRow: function(row) {
perf/lib/BrowserPerfRunnerContext.react.js
+1
-1
@@ -62,7 +62,7 @@ var BenchmarkQueue = React.createClass({
62
if (self.props.onCompleteEach) {
63
self.props.onCompleteEach(queueItem);
64
}
65
- self.setState({ queue:queue });
65
+ self.setState({queue:queue});
66
});
67
benchmark.run({async:true});
68
},
perf/lib/todolist.browser.js
+3
-3
@@ -50,7 +50,7 @@ todolist.App = React.createClass({
50
if (callback) {
51
callback = callback.bind(this, todo);
52
}
53
- this.setState({ timerEvent:'addItem', timerStart:todolist.now(), timerEnd:null, todos:todos }, callback);
53
+ this.setState({timerEvent:'addItem', timerStart:todolist.now(), timerEnd:null, todos:todos}, callback);
54
return todo;
55
},
56
deleteItemById: function(id, callback) {
@@ -59,7 +59,7 @@ todolist.App = React.createClass({
59
return callback && callback(Error('todo with id ' + id + ' not found'));
60
}
61
todo.deleted = true;
62
- this.setState({ timerEvent:'deleteItemById', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos }, callback);
62
+ this.setState({timerEvent:'deleteItemById', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos}, callback);
63
},
64
setItemCompleted: function(id, completed, callback) {
65
var todo = this._getById(id);
@@ -67,7 +67,7 @@ todolist.App = React.createClass({
67
return callback && callback(Error('todo with id ' + id + ' not found'));
68
}
69
todo.completed = completed;
70
- this.setState({ timerEvent:'setItemCompleted', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos }, callback);
70
+ this.setState({timerEvent:'setItemCompleted', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos}, callback);
71
},
72
_getById: function(id) {
73
id = +id;
perf/tests/setState-callback-5.js
+1
-1
@@ -15,7 +15,7 @@ exports.setup = function() {
15
16
var AwesomeComponent = React.createClass({
17
getInitialState: function() {
18
- return { random:null };
18
+ return {random:null};
19
},
20
render: function() {
21
if (!setState) {
perf/tests/setState-callback.js
+1
-1
@@ -15,7 +15,7 @@ exports.setup = function() {
15
16
var AwesomeComponent = React.createClass({
17
getInitialState: function() {
18
- return { random:null };
18
+ return {random:null};
19
},
20
render: function() {
21
if (!setState) {
perf/tests/todolist-add.js
+1
-1
@@ -11,7 +11,7 @@ exports.defer = true;
11
exports.setup = function() {
12
_rootNode = document.createElement('div');
13
document.body.appendChild(_rootNode);
14
- var appDescriptor = todolist.App({ fakeDataCount: 333 });
14
+ var appDescriptor = todolist.App({fakeDataCount: 333});
15
_app = React.render(appDescriptor, _rootNode);
16
};
17
exports.fn = function(deferred) {
perf/tests/todolist-do-stuff.js
+1
-1
@@ -13,7 +13,7 @@ exports.defer = true;
13
exports.setup = function() {
14
_rootNode = document.createElement('div');
15
document.body.appendChild(_rootNode);
16
- var appDescriptor = todolist.App({ fakeDataCount: 333 });
16
+ var appDescriptor = todolist.App({fakeDataCount: 333});
17
_app = React.render(appDescriptor, _rootNode);
18
};
19
perf/tests/todolist-edit.js
+1
-1
@@ -11,7 +11,7 @@ exports.defer = true;
11
exports.setup = function() {
12
_rootNode = document.createElement('div');
13
document.body.appendChild(_rootNode);
14
- var appDescriptor = todolist.App({ fakeDataCount: 333 });
14
+ var appDescriptor = todolist.App({fakeDataCount: 333});
15
_app = React.render(appDescriptor, _rootNode);
16
_todo1 = _app.addItem('Howdy 1!');
17
_todo2 = _app.addItem('Howdy 2!');
perf/tests/todolist-mount.js
+1
-1
@@ -18,7 +18,7 @@ exports.setup = function() {
18
};
19
20
exports.fn = function(deferred) {
21
- React.render(todolist.App({ fakeDataCount: 333 }), _rootNode, function() {
21
+ React.render(todolist.App({fakeDataCount: 333}), _rootNode, function() {
22
deferred.resolve();
23
});
24
};
src/addons/ReactFragment.js
+2
-2
@@ -39,13 +39,13 @@ if (__DEV__) {
39
Object.defineProperty(
40
{},
41
fragmentKey,
42
- { enumerable: false, value: true }
42
+ {enumerable: false, value: true}
43
);
44
45
Object.defineProperty(
46
{},
47
'key',
48
- { enumerable: true, get: dummy }
48
+ {enumerable: true, get: dummy}
49
);
50
51
canWarnForReactFragment = true;
src/browser/__tests__/ReactDOM-test.js
+1
-1
@@ -48,7 +48,7 @@ describe('ReactDOM', function() {
48
*/
49
50
it("allows a DOM element to be used with a string", function() {
51
- var element = React.createElement('div', { className: 'foo' });
51
+ var element = React.createElement('div', {className: 'foo'});
52
var instance = ReactTestUtils.renderIntoDocument(element);
53
expect(instance.getDOMNode().tagName).toBe('DIV');
54
});
src/browser/ui/__tests__/ReactDOMComponent-test.js
+15
-15
@@ -45,14 +45,14 @@ describe('ReactDOMComponent', function() {
45
var stubStyle = container.firstChild.style;
46
47
// set initial style
48
- var setup = { display: 'block', left: '1', top: 2, fontFamily: 'Arial' };
48
+ var setup = {display: 'block', left: '1', top: 2, fontFamily: 'Arial'};
49
React.render(<div style={setup} />, container);
50
expect(stubStyle.display).toEqual('block');
51
expect(stubStyle.left).toEqual('1px');
52
expect(stubStyle.fontFamily).toEqual('Arial');
53
54
// reset the style to their default state
55
- var reset = { display: '', left: null, top: false, fontFamily: true };
55
+ var reset = {display: '', left: null, top: false, fontFamily: true};
56
React.render(<div style={reset} />, container);
57
expect(stubStyle.display).toEqual('');
58
expect(stubStyle.left).toEqual('');
@@ -61,7 +61,7 @@ describe('ReactDOMComponent', function() {
61
});
62
63
it("should update styles when mutating style object", function() {
64
- var styles = { display: 'none', fontFamily: 'Arial', lineHeight: 1.2 };
64
+ var styles = {display: 'none', fontFamily: 'Arial', lineHeight: 1.2};
65
var container = document.createElement('div');
66
React.render(<div style={styles} />, container);
67
@@ -226,7 +226,7 @@ describe('ReactDOMComponent', function() {
226
var ReactReconcileTransaction = require('ReactReconcileTransaction');
227
228
var NodeStub = function(initialProps) {
229
- this._currentElement = { props: initialProps };
229
+ this._currentElement = {props: initialProps};
230
this._rootNodeID = 'test';
231
};
232
assign(NodeStub.prototype, ReactDOMComponent.Mixin);
@@ -250,9 +250,9 @@ describe('ReactDOMComponent', function() {
250
});
251
252
it("should generate the correct markup with className", function() {
253
- expect(genMarkup({ className: 'a' })).toHaveAttribute('class', 'a');
254
- expect(genMarkup({ className: 'a b' })).toHaveAttribute('class', 'a b');
255
- expect(genMarkup({ className: '' })).toHaveAttribute('class', '');
253
+ expect(genMarkup({className: 'a'})).toHaveAttribute('class', 'a');
254
+ expect(genMarkup({className: 'a b'})).toHaveAttribute('class', 'a b');
255
+ expect(genMarkup({className: ''})).toHaveAttribute('class', '');
256
});
257
258
it("should escape style names and values", function() {
@@ -276,7 +276,7 @@ describe('ReactDOMComponent', function() {
276
var ReactReconcileTransaction = require('ReactReconcileTransaction');
277
278
var NodeStub = function(initialProps) {
279
- this._currentElement = { props: initialProps };
279
+ this._currentElement = {props: initialProps};
280
this._rootNodeID = 'test';
281
};
282
assign(NodeStub.prototype, ReactDOMComponent.Mixin);
@@ -297,7 +297,7 @@ describe('ReactDOMComponent', function() {
297
it("should handle dangerouslySetInnerHTML", function() {
298
var innerHTML = {__html: 'testContent'};
299
expect(
300
- genMarkup({ dangerouslySetInnerHTML: innerHTML })
300
+ genMarkup({dangerouslySetInnerHTML: innerHTML})
301
).toHaveInnerhtml('testContent');
302
});
303
});
@@ -332,7 +332,7 @@ describe('ReactDOMComponent', function() {
332
333
it("should validate against multiple children props", function() {
334
expect(function() {
335
- mountComponent({ children: '', dangerouslySetInnerHTML: '' });
335
+ mountComponent({children: '', dangerouslySetInnerHTML: ''});
336
}).toThrow(
337
'Invariant Violation: Can only set one of `children` or ' +
338
'`props.dangerouslySetInnerHTML`.'
@@ -342,7 +342,7 @@ describe('ReactDOMComponent', function() {
342
it('should validate against use of innerHTML', function() {
343
344
spyOn(console, 'warn');
345
- mountComponent({ innerHTML: '<span>Hi Jim!</span>' });
345
+ mountComponent({innerHTML: '<span>Hi Jim!</span>'});
346
expect(console.warn.argsForCall.length).toBe(1);
347
expect(console.warn.argsForCall[0][0]).toContain(
348
'Directly setting property `innerHTML` is not permitted. '
@@ -351,7 +351,7 @@ describe('ReactDOMComponent', function() {
351
352
it('should validate use of dangerouslySetInnerHTML', function() {
353
expect(function() {
354
- mountComponent({ dangerouslySetInnerHTML: '<span>Hi Jim!</span>' });
354
+ mountComponent({dangerouslySetInnerHTML: '<span>Hi Jim!</span>'});
355
}).toThrow(
356
'Invariant Violation: ' +
357
'`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' +
@@ -361,7 +361,7 @@ describe('ReactDOMComponent', function() {
361
362
it('should validate use of dangerouslySetInnerHTML', function() {
363
expect(function() {
364
- mountComponent({ dangerouslySetInnerHTML: {foo: 'bar'} });
364
+ mountComponent({dangerouslySetInnerHTML: {foo: 'bar'} });
365
}).toThrow(
366
'Invariant Violation: ' +
367
'`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' +
@@ -371,14 +371,14 @@ describe('ReactDOMComponent', function() {
371
372
it("should warn about contentEditable and children", function() {
373
spyOn(console, 'warn');
374
- mountComponent({ contentEditable: true, children: '' });
374
+ mountComponent({contentEditable: true, children: ''});
375
expect(console.warn.argsForCall.length).toBe(1);
376
expect(console.warn.argsForCall[0][0]).toContain('contentEditable');
377
});
378
379
it("should validate against invalid styles", function() {
380
expect(function() {
381
- mountComponent({ style: 'display: none' });
381
+ mountComponent({style: 'display: none'});
382
}).toThrow(
383
'Invariant Violation: The `style` prop expects a mapping from style ' +
384
'properties to values, not a string. For example, ' +
src/classic/class/__tests__/ReactBind-test.js
+2
-2
@@ -149,10 +149,10 @@ describe('autobinding', function() {
149
150
var TestBindComponent = React.createClass({
151
getInitialState: function() {
152
- return { foo: 1 };
152
+ return {foo: 1};
153
},
154
componentDidMount: function() {
155
- this.setState({ foo: 2 }, this.handleUpdate);
155
+ this.setState({foo: 2}, this.handleUpdate);
156
},
157
handleUpdate: function() {
158
src/classic/class/__tests__/ReactClass-test.js
+2
-2
@@ -305,7 +305,7 @@ describe('ReactClass-spec', function() {
305
className: React.PropTypes.string
306
},
307
getInitialState() {
308
- return { className: this.context.className };
308
+ return {className: this.context.className};
309
},
310
render() {
311
return <span className={this.state.className} />;
@@ -317,7 +317,7 @@ describe('ReactClass-spec', function() {
317
className: React.PropTypes.string
318
},
319
getChildContext() {
320
- return { className: 'foo' };
320
+ return {className: 'foo'};
321
},
322
render() {
323
return <Foo />;
src/classic/element/ReactElement.js
+1
-1
@@ -108,7 +108,7 @@ var ReactElement = function(type, key, ref, owner, context, props) {
108
// an external backing store so that we can freeze the whole object.
109
// This can be replaced with a WeakMap once they are implemented in
110
// commonly used development environments.
111
- this._store = { props: props, originalProps: assign({}, props) };
111
+ this._store = {props: props, originalProps: assign({}, props)};
112
113
// To make comparing ReactElements easier for testing purposes, we make
114
// the validation flag non-enumerable (where possible, which should
src/classic/element/__tests__/ReactElement-test.js
+6
-6
@@ -56,7 +56,7 @@ describe('ReactElement', function() {
56
});
57
58
it('does not reuse the original config object', function() {
59
- var config = { foo: 1 };
59
+ var config = {foo: 1};
60
var element = React.createFactory(ComponentClass)(config);
61
expect(element.props.foo).toBe(1);
62
config.foo = 2;
@@ -95,7 +95,7 @@ describe('ReactElement', function() {
95
foo: React.PropTypes.string
96
},
97
getChildContext: function() {
98
- return { foo: 'bar' };
98
+ return {foo: 'bar'};
99
},
100
render: function() {
101
element = Component();
@@ -107,7 +107,7 @@ describe('ReactElement', function() {
107
React.createElement(Wrapper)
108
);
109
110
- expect(element._context).toEqual({ foo: 'bar' });
110
+ expect(element._context).toEqual({foo: 'bar'});
111
});
112
113
it('preserves the owner on the element', function() {
@@ -222,7 +222,7 @@ describe('ReactElement', function() {
222
});
223
224
it('is indistinguishable from a plain object', function() {
225
- var element = React.createElement('div', { className: 'foo' });
225
+ var element = React.createElement('div', {className: 'foo'});
226
var object = {};
227
expect(element.constructor).toBe(object.constructor);
228
});
@@ -239,7 +239,7 @@ describe('ReactElement', function() {
239
240
var container = document.createElement('div');
241
var instance = React.render(
242
- React.createElement(Component, { fruit: 'mango' }),
242
+ React.createElement(Component, {fruit: 'mango'}),
243
container
244
);
245
expect(instance.props.fruit).toBe('mango');
@@ -264,7 +264,7 @@ describe('ReactElement', function() {
264
expect(instance.props.prop).toBe('testKey');
265
266
var inst2 = ReactTestUtils.renderIntoDocument(
267
- React.createElement(Component, { prop: null })
267
+ React.createElement(Component, {prop: null})
268
);
269
expect(inst2.props.prop).toBe(null);
270
});
src/classic/element/__tests__/ReactElementValidator-test.js
+6
-6
@@ -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
@@ -90,7 +90,7 @@ describe('ReactElementValidator', function() {
90
return {
91
next: function() {
92
var done = ++i > 2;
93
- return { value: done ? undefined : Component(), done: done };
93
+ return {value: done ? undefined : Component(), done: done};
94
}
95
};
96
}
@@ -141,7 +141,7 @@ describe('ReactElementValidator', function() {
141
spyOn(console, 'warn');
142
var Component = React.createFactory(ComponentClass);
143
144
- Component(null, frag({ 1: Component(), 2: Component() }));
144
+ Component(null, frag({1: Component(), 2: Component()}));
145
146
expect(console.warn.argsForCall.length).toBe(1);
147
expect(console.warn.argsForCall[0][0]).toContain(
@@ -159,7 +159,7 @@ describe('ReactElementValidator', function() {
159
return {
160
next: function() {
161
var done = ++i > 2;
162
- return { value: done ? undefined : [i, Component()], done: done };
162
+ return {value: done ? undefined : [i, Component()], done: done};
163
}
164
};
165
}
@@ -207,7 +207,7 @@ describe('ReactElementValidator', function() {
207
});
208
var ParentComp = React.createClass({
209
render: function() {
210
- return React.createElement(MyComp, { color: 123 });
210
+ return React.createElement(MyComp, {color: 123});
211
}
212
});
213
ReactTestUtils.renderIntoDocument(React.createElement(ParentComp));
@@ -325,7 +325,7 @@ describe('ReactElementValidator', function() {
325
it('should warn if a fragment is used without the wrapper', function() {
326
spyOn(console, 'warn');
327
var child = React.createElement('span');
328
- React.createElement('div', null, { a: child, b: child });
328
+ React.createElement('div', null, {a: child, b: child});
329
expect(console.warn.calls.length).toBe(1);
330
expect(console.warn.calls[0].args[0]).toContain('use of a keyed object');
331
});
src/core/__tests__/ReactComponentLifeCycle-test.js
+1
-1
@@ -138,7 +138,7 @@ describe('ReactComponentLifeCycle', function() {
138
var container = document.createElement('div');
139
var StatefulComponent = React.createClass({
140
getInitialState: function() {
141
- return { };
141
+ return {};
142
},
143
render: function() {
144
return (
src/core/__tests__/ReactCompositeComponent-test.js
+11
-11
@@ -303,7 +303,7 @@ describe('ReactCompositeComponent', function() {
303
304
var Component = React.createClass({
305
getInitialState: function() {
306
- return { value: 0 };
306
+ return {value: 0};
307
},
308
render: function() {
309
return <div />;
@@ -314,12 +314,12 @@ describe('ReactCompositeComponent', function() {
314
expect(instance.setState).not.toBeDefined();
315
316
instance = React.render(instance, container);
317
- instance.setState({ value: 1 });
317
+ instance.setState({value: 1});
318
319
expect(console.warn.calls.length).toBe(0);
320
321
React.unmountComponentAtNode(container);
322
- instance.setState({ value: 2 });
322
+ instance.setState({value: 2});
323
expect(console.warn.calls.length).toBe(1);
324
expect(console.warn.argsForCall[0][0]).toBe(
325
'Warning: setState(...): Can only update a mounted or ' +
@@ -336,11 +336,11 @@ describe('ReactCompositeComponent', function() {
336
337
var Component = React.createClass({
338
getInitialState: function() {
339
- return { value: 0 };
339
+ return {value: 0};
340
},
341
componentWillUnmount: function() {
342
expect(() => {
343
- this.setState({ value: 2 }, function() {
343
+ this.setState({value: 2}, function() {
344
cbCalled = true;
345
})
346
}).not.toThrow();
@@ -352,7 +352,7 @@ describe('ReactCompositeComponent', function() {
352
353
var instance = React.render(<Component />, container);
354
355
- instance.setState({ value: 1 });
355
+ instance.setState({value: 1});
356
expect(console.warn.calls.length).toBe(0);
357
358
React.unmountComponentAtNode(container);
@@ -375,13 +375,13 @@ describe('ReactCompositeComponent', function() {
375
376
instance = React.render(instance, container);
377
expect(function() {
378
- instance.setProps({ value: 1 });
378
+ instance.setProps({value: 1});
379
}).not.toThrow();
380
expect(console.warn.calls.length).toBe(0);
381
382
React.unmountComponentAtNode(container);
383
expect(function() {
384
- instance.setProps({ value: 2 });
384
+ instance.setProps({value: 2});
385
}).not.toThrow();
386
387
expect(console.warn.calls.length).toBe(1);
@@ -757,7 +757,7 @@ describe('ReactCompositeComponent', function() {
757
},
758
759
getChildContext: function() {
760
- return { foo: this.props.foo };
760
+ return {foo: this.props.foo};
761
},
762
763
render: function() { return <Parent><Component /></Parent>; }
@@ -878,11 +878,11 @@ describe('ReactCompositeComponent', function() {
878
var renders = 0;
879
var Component = React.createClass({
880
getInitialState: function() {
881
- return { updated: false };
881
+ return {updated: false};
882
},
883
componentWillReceiveProps: function(props) {
884
expect(props.update).toBe(1);
885
- this.setState({ updated: true });
885
+ this.setState({updated: true});
886
},
887
render: function() {
888
renders++;
src/core/__tests__/ReactCompositeComponentNestedState-test.js
+4
-4
@@ -26,12 +26,12 @@ describe('ReactCompositeComponentNestedState-state', function() {
26
it('should provide up to date values for props', function() {
27
var ParentComponent = React.createClass({
28
getInitialState: function() {
29
- return { color: 'blue' };
29
+ return {color: 'blue'};
30
},
31
32
handleColor: function(color) {
33
this.props.logger('parent-handleColor', this.state.color);
34
- this.setState({ color: color }, function() {
34
+ this.setState({color: color}, function() {
35
this.props.logger('parent-after-setState', this.state.color);
36
});
37
},
@@ -49,7 +49,7 @@ describe('ReactCompositeComponentNestedState-state', function() {
49
var ChildComponent = React.createClass({
50
getInitialState: function() {
51
this.props.logger('getInitialState', this.props.color);
52
- return { hue: 'dark ' + this.props.color };
52
+ return {hue: 'dark ' + this.props.color};
53
},
54
55
handleHue: function(shade, color) {
@@ -58,7 +58,7 @@ describe('ReactCompositeComponentNestedState-state', function() {
58
this.setState(function(state, props) {
59
this.props.logger('setState-this', this.state.hue, this.props.color);
60
this.props.logger('setState-args', state.hue, props.color);
61
- return { hue: shade + ' ' + props.color }
61
+ return {hue: shade + ' ' + props.color}
62
}, function() {
63
this.props.logger('after-setState', this.state.hue, this.props.color);
64
});
src/core/__tests__/ReactCompositeComponentState-test.js
+1
-1
@@ -94,7 +94,7 @@ describe('ReactCompositeComponent-state', function() {
94
this.peekAtState('before-setState-receiveProps', state);
95
return {color: newProps.nextColor};
96
});
97
- this.replaceState({ color: undefined });
97
+ this.replaceState({color: undefined});
98
this.setState(
99
function(state) {
100
this.peekAtState('before-setState-again-receiveProps', state);
src/core/__tests__/ReactIdentity-test.js
+2
-2
@@ -267,11 +267,11 @@ describe('ReactIdentity', function() {
267
var TestContainer = React.createClass({
268
269
getInitialState: function() {
270
- return { swapped: false };
270
+ return {swapped: false};
271
},
272
273
swap: function() {
274
- this.setState({ swapped: true });
274
+ this.setState({swapped: true});
275
},
276
277
render: function() {
src/core/__tests__/ReactInstanceHandles-test.js
+5
-5
@@ -353,27 +353,27 @@ describe('ReactInstanceHandles', function() {
353
var parent = renderParentIntoDocument();
354
var ancestors = [
355
// Common ancestor from window to deep element is ''.
356
- { one: null,
356
+ {one: null,
357
two: parent.refs.P_P1_C1.refs.DIV_1,
358
com: null
359
},
360
// Same as previous - reversed direction.
361
- { one: parent.refs.P_P1_C1.refs.DIV_1,
361
+ {one: parent.refs.P_P1_C1.refs.DIV_1,
362
two: null,
363
com: null
364
},
365
// Common ancestor from window to shallow id is ''.
366
- { one: parent.refs.P,
366
+ {one: parent.refs.P,
367
two: null,
368
com: null
369
},
370
// Common ancestor with self is self.
371
- { one: parent.refs.P_P1_C1.refs.DIV_1,
371
+ {one: parent.refs.P_P1_C1.refs.DIV_1,
372
two: parent.refs.P_P1_C1.refs.DIV_1,
373
com: parent.refs.P_P1_C1.refs.DIV_1
374
},
375
// Common ancestor with self is self - even if topmost DOM.
376
- { one: parent.refs.P, two: parent.refs.P, com: parent.refs.P },
376
+ {one: parent.refs.P, two: parent.refs.P, com: parent.refs.P},
377
// Siblings
378
{
379
one: parent.refs.P_P1_C1.refs.DIV_1,
src/core/__tests__/ReactMockedComponent-test.js
+6
-6
@@ -30,11 +30,11 @@ describe('ReactMockedComponent', function() {
30
31
OriginalComponent = React.createClass({
32
getDefaultProps: function() {
33
- return { bar: 'baz' };
33
+ return {bar: 'baz'};
34
},
35
36
getInitialState: function() {
37
- return { foo: 'bar' };
37
+ return {foo: 'bar'};
38
},
39
40
hasCustomMethod: function() {
@@ -65,11 +65,11 @@ describe('ReactMockedComponent', function() {
65
var Wrapper = React.createClass({
66
67
getInitialState: function() {
68
- return { foo: 1 };
68
+ return {foo: 1};
69
},
70
71
update: function() {
72
- this.setState({ foo: 2 });
72
+ this.setState({foo: 2});
73
},
74
75
render: function() {
@@ -105,11 +105,11 @@ describe('ReactMockedComponent', function() {
105
var Wrapper = React.createClass({
106
107
getInitialState: function() {
108
- return { foo: 1 };
108
+ return {foo: 1};
109
},
110
111
update: function() {
112
- this.setState({ foo: 2 });
112
+ this.setState({foo: 2});
113
},
114
115
render: function() {
src/core/__tests__/ReactMultiChildReconcile-test.js
+11
-11
@@ -51,7 +51,7 @@ var getOriginalKey = function(childName) {
51
*/
52
var StatusDisplay = React.createClass({
53
getInitialState: function() {
54
- return { internalState: Math.random() };
54
+ return {internalState: Math.random()};
55
},
56
57
getStatus: function() {
@@ -251,7 +251,7 @@ describe('ReactMultiChildReconcile', function() {
251
var startingInternalState = statusDisplays.jcw.getInternalState();
252
253
// Now remove the child.
254
- parentInstance.replaceProps({ usernameToStatus: {} });
254
+ parentInstance.replaceProps({usernameToStatus: {} });
255
statusDisplays = parentInstance.getStatusDisplays();
256
expect(statusDisplays.jcw).toBeFalsy();
257
@@ -271,7 +271,7 @@ describe('ReactMultiChildReconcile', function() {
271
bob: 'bobStatus'
272
};
273
274
- testPropsSequence([ { usernameToStatus: usernameToStatus } ]);
274
+ testPropsSequence([ {usernameToStatus: usernameToStatus} ]);
275
});
276
277
it('should preserve order if children order has not changed', function() {
@@ -294,7 +294,7 @@ describe('ReactMultiChildReconcile', function() {
294
295
it('should transition from zero to one children correctly', function() {
296
var PROPS_SEQUENCE = [
297
- { usernameToStatus: {} },
297
+ {usernameToStatus: {} },
298
{
299
usernameToStatus: {
300
first: 'firstStatus'
@@ -311,7 +311,7 @@ describe('ReactMultiChildReconcile', function() {
311
first: 'firstStatus'
312
}
313
},
314
- { usernameToStatus: {} }
314
+ {usernameToStatus: {} }
315
];
316
testPropsSequence(PROPS_SEQUENCE);
317
});
@@ -323,13 +323,13 @@ describe('ReactMultiChildReconcile', function() {
323
first: 'firstStatus'
324
}
325
},
326
- { }
326
+ {}
327
]);
328
});
329
330
it('should transition from null children to one child', function() {
331
testPropsSequence([
332
- { },
332
+ {},
333
{
334
usernameToStatus: {
335
first: 'firstStatus'
@@ -341,17 +341,17 @@ describe('ReactMultiChildReconcile', function() {
341
it('should transition from zero children to null children', function() {
342
testPropsSequence([
343
{
344
- usernameToStatus: { }
344
+ usernameToStatus: {}
345
},
346
- { }
346
+ {}
347
]);
348
});
349
350
it('should transition from null children to zero children', function() {
351
testPropsSequence([
352
- { },
352
+ {},
353
{
354
- usernameToStatus: { }
354
+ usernameToStatus: {}
355
}
356
]);
357
});
src/core/__tests__/ReactUpdates-test.js
+4
-4
@@ -858,7 +858,7 @@ describe('ReactUpdates', function() {
858
859
var B = React.createClass({
860
getInitialState: function() {
861
- return { updates: 0 };
861
+ return {updates: 0};
862
},
863
componentDidMount: function() {
864
componentB = this;
@@ -871,7 +871,7 @@ describe('ReactUpdates', function() {
871
872
var A = React.createClass({
873
getInitialState: function() {
874
- return { showB: true };
874
+ return {showB: true};
875
},
876
render: function() {
877
return this.state.showB ? <B /> : <div />;
@@ -883,8 +883,8 @@ describe('ReactUpdates', function() {
883
ReactUpdates.batchedUpdates(function() {
884
// B will have scheduled an update but the batching should ensure that its
885
// update never fires.
886
- componentB.setState({ updates: 1 });
887
- component.setState({ showB: false });
886
+ componentB.setState({updates: 1});
887
+ component.setState({showB: false});
888
});
889
890
expect(renderCount).toBe(1);
src/core/__tests__/refs-test.js
+1
-1
@@ -166,7 +166,7 @@ describe('ref swapping', function() {
166
return {count: 0};
167
},
168
moveRef: function() {
169
- this.setState({ count: this.state.count + 1 });
169
+ this.setState({count: this.state.count + 1});
170
},
171
render: function() {
172
var count = this.state.count;
src/modern/class/__tests__/ReactES6Class-test.js
+19
-19
@@ -69,7 +69,7 @@ describe('ReactES6Class', function() {
69
class Foo extends React.Component {
70
constructor(props) {
71
super(props);
72
- this.state = { bar: this.props.initialValue };
72
+ this.state = {bar: this.props.initialValue};
73
}
74
render() {
75
return <span className={this.state.bar} />;
@@ -81,10 +81,10 @@ describe('ReactES6Class', function() {
81
it('renders based on state using props in the constructor', function() {
82
class Foo extends React.Component {
83
constructor(props) {
84
- this.state = { bar: props.initialValue };
84
+ this.state = {bar: props.initialValue};
85
}
86
changeState() {
87
- this.setState({ bar: 'bar' });
87
+ this.setState({bar: 'bar'});
88
}
89
render() {
90
if (this.state.bar === 'foo') {
@@ -102,7 +102,7 @@ describe('ReactES6Class', function() {
102
class Foo extends React.Component {
103
constructor(props, context) {
104
super(props, context);
105
- this.state = { tag: context.tag, className: this.context.className };
105
+ this.state = {tag: context.tag, className: this.context.className};
106
}
107
render() {
108
var Tag = this.state.tag;
@@ -116,7 +116,7 @@ describe('ReactES6Class', function() {
116
117
class Outer extends React.Component {
118
getChildContext() {
119
- return { tag: 'span', className: 'foo' };
119
+ return {tag: 'span', className: 'foo'};
120
}
121
render() {
122
return <Foo />;
@@ -133,10 +133,10 @@ describe('ReactES6Class', function() {
133
var renderCount = 0;
134
class Foo extends React.Component {
135
constructor(props) {
136
- this.state = { bar: props.initialValue };
136
+ this.state = {bar: props.initialValue};
137
}
138
componentWillMount() {
139
- this.setState({ bar: 'bar' });
139
+ this.setState({bar: 'bar'});
140
}
141
render() {
142
renderCount++;
@@ -179,10 +179,10 @@ describe('ReactES6Class', function() {
179
it('setState through an event handler', function() {
180
class Foo extends React.Component {
181
constructor(props) {
182
- this.state = { bar: props.initialValue };
182
+ this.state = {bar: props.initialValue};
183
}
184
handleClick() {
185
- this.setState({ bar: 'bar' });
185
+ this.setState({bar: 'bar'});
186
}
187
render() {
188
return (
@@ -201,10 +201,10 @@ describe('ReactES6Class', function() {
201
it('should not implicitly bind event handlers', function() {
202
class Foo extends React.Component {
203
constructor(props) {
204
- this.state = { bar: props.initialValue };
204
+ this.state = {bar: props.initialValue};
205
}
206
handleClick() {
207
- this.setState({ bar: 'bar' });
207
+ this.setState({bar: 'bar'});
208
}
209
render() {
210
return (
@@ -282,10 +282,10 @@ describe('ReactES6Class', function() {
282
lifeCycles = []; // reset
283
test(<Foo value="bar" />, 'SPAN', 'bar');
284
expect(lifeCycles).toEqual([
285
- 'receive-props', { value: 'bar' },
286
- 'should-update', { value: 'bar' }, {},
287
- 'will-update', { value: 'bar' }, {},
288
- 'did-update', { value: 'foo' }, {}
285
+ 'receive-props', {value: 'bar'},
286
+ 'should-update', {value: 'bar'}, {},
287
+ 'will-update', {value: 'bar'}, {},
288
+ 'did-update', {value: 'foo'}, {}
289
]);
290
lifeCycles = []; // reset
291
React.unmountComponentAtNode(container);
@@ -353,7 +353,7 @@ describe('ReactES6Class', function() {
353
expect(() => instance.getDOMNode()).toThrow();
354
expect(() => instance.replaceState({})).toThrow();
355
expect(() => instance.isMounted()).toThrow();
356
- expect(() => instance.setProps({ name: 'bar' })).toThrow();
356
+ expect(() => instance.setProps({name: 'bar'})).toThrow();
357
expect(console.warn.calls.length).toBe(4);
358
expect(console.warn.calls[0].args[0]).toContain(
359
'getDOMNode(...) is deprecated in plain JavaScript React classes'
@@ -375,16 +375,16 @@ describe('ReactES6Class', function() {
375
return <div className={this.context.bar} />;
376
}
377
}
378
- Bar.contextTypes = { bar: React.PropTypes.string };
378
+ Bar.contextTypes = {bar: React.PropTypes.string};
379
class Foo {
380
getChildContext() {
381
- return { bar: 'bar-through-context' };
381
+ return {bar: 'bar-through-context'};
382
}
383
render() {
384
return <Bar />;
385
}
386
}
387
- Foo.childContextTypes = { bar: React.PropTypes.string };
387
+ Foo.childContextTypes = {bar: React.PropTypes.string};
388
test(<Foo />, 'DIV', 'bar-through-context');
389
});
390
src/modern/element/__tests__/ReactJSXElement-test.js
+3
-3
@@ -62,7 +62,7 @@ describe('ReactJSXElement', function() {
62
});
63
64
it('does not reuse the object that is spread into props', function() {
65
- var config = { foo: 1 };
65
+ var config = {foo: 1};
66
var element = <Component {...config} />;
67
expect(element.props.foo).toBe(1);
68
config.foo = 2;
@@ -161,7 +161,7 @@ describe('ReactJSXElement', function() {
161
return <span />;
162
}
163
}
164
- Component.defaultProps = { fruit: 'persimmon' };
164
+ Component.defaultProps = {fruit: 'persimmon'};
165
166
var container = document.createElement('div');
167
var instance = React.render(
@@ -180,7 +180,7 @@ describe('ReactJSXElement', function() {
180
return <span>{this.props.prop}</span>;
181
}
182
}
183
- Component.defaultProps = { prop: 'testKey' };
183
+ Component.defaultProps = {prop: 'testKey'};
184
185
var instance = ReactTestUtils.renderIntoDocument(<Component />);
186
expect(instance.props.prop).toBe('testKey');
src/modern/element/__tests__/ReactJSXElementValidator-test.js
+7
-7
@@ -86,7 +86,7 @@ describe('ReactJSXElementValidator', function() {
86
return {
87
next: function() {
88
var done = ++i > 2;
89
- return { value: done ? undefined : <Component />, done: done };
89
+ return {value: done ? undefined : <Component />, done: done};
90
}
91
};
92
}
@@ -134,7 +134,7 @@ describe('ReactJSXElementValidator', function() {
134
it('warns for numeric keys on objects as children', function() {
135
spyOn(console, 'warn');
136
137
- <Component>{frag({ 1: <Component />, 2: <Component /> })}</Component>;
137
+ <Component>{frag({1: <Component />, 2: <Component />})}</Component>;
138
139
expect(console.warn.argsForCall.length).toBe(1);
140
expect(console.warn.argsForCall[0][0]).toContain(
@@ -151,7 +151,7 @@ describe('ReactJSXElementValidator', function() {
151
return {
152
next: function() {
153
var done = ++i > 2;
154
- return { value: done ? undefined : [i, <Component />], done: done };
154
+ return {value: done ? undefined : [i, <Component />], done: done};
155
}
156
};
157
}
@@ -236,8 +236,8 @@ describe('ReactJSXElementValidator', function() {
236
return <span>{this.props.prop}</span>;
237
}
238
}
239
- Component.defaultProps = { prop: null };
240
- Component.propTypes = { prop: React.PropTypes.string.isRequired };
239
+ Component.defaultProps = {prop: null};
240
+ Component.propTypes = {prop: React.PropTypes.string.isRequired};
241
242
ReactTestUtils.renderIntoDocument(<Component />);
243
@@ -256,8 +256,8 @@ describe('ReactJSXElementValidator', function() {
256
return <span>{this.props.prop}</span>;
257
}
258
}
259
- Component.defaultProps = { prop: 'text' };
260
- Component.propTypes = { prop: React.PropTypes.string.isRequired };
259
+ Component.defaultProps = {prop: 'text'};
260
+ Component.propTypes = {prop: React.PropTypes.string.isRequired};
261
262
ReactTestUtils.renderIntoDocument(<Component prop={null} />);
263
src/utils/__tests__/ReactChildren-test.js
+1
-1
@@ -424,7 +424,7 @@ describe('ReactChildren', function() {
424
it('should warn if a fragment is used without the wrapper', function() {
425
spyOn(console, 'warn');
426
var child = React.createElement('span');
427
- ReactChildren.forEach({ a: child, b: child}, function(c) {
427
+ ReactChildren.forEach({a: child, b: child}, function(c) {
428
expect(c).toBe(child);
429
});
430
expect(console.warn.calls.length).toBe(1);
src/utils/__tests__/traverseAllChildren-test.js
+6
-6
@@ -300,9 +300,9 @@ describe('traverseAllChildren', function() {
300
return {
301
next: function() {
302
if (i++ < 3) {
303
- return { value: <div />, done: false };
303
+ return {value: <div />, done: false};
304
} else {
305
- return { value: undefined, done: true };
305
+ return {value: undefined, done: true};
306
}
307
}
308
};
@@ -351,9 +351,9 @@ describe('traverseAllChildren', function() {
351
return {
352
next: function() {
353
if (i++ < 3) {
354
- return { value: <div key={'#' + i} />, done: false };
354
+ return {value: <div key={'#' + i} />, done: false};
355
} else {
356
- return { value: undefined, done: true };
356
+ return {value: undefined, done: true};
357
}
358
}
359
};
@@ -404,9 +404,9 @@ describe('traverseAllChildren', function() {
404
return {
405
next: function() {
406
if (i++ < 3) {
407
- return { value: ['#' + i, <div />], done: false };
407
+ return {value: ['#' + i, <div />], done: false};
408
} else {
409
- return { value: undefined, done: true };
409
+ return {value: undefined, done: true};
410
}
411
}
412
};
src/vendor/key-mirror/__tests__/keyMirror-test.js
+2
-2
@@ -20,7 +20,7 @@ describe('keyMirror', function() {
20
var mirror = keyMirror({
21
foo: null,
22
bar: true,
23
- "baz": { some: "object" },
23
+ "baz": {some: "object"},
24
qux: undefined
25
});
26
expect('foo' in mirror).toBe(true);
@@ -55,7 +55,7 @@ describe('keyMirror', function() {
55
});
56
57
it('should work when "constructor" is a key', function() {
58
- var obj = { constructor: true };
58
+ var obj = {constructor: true};
59
expect(keyMirror.bind(null, obj)).not.toThrow();
60
var mirror = keyMirror(obj);
61
expect('constructor' in mirror).toBe(true);
vendor/fbtransform/transforms/__tests__/react-test.js
+3
-3
@@ -350,13 +350,13 @@ describe('react jsx', function() {
350
it('calls assign with an empty object when the spread is first', function() {
351
expectObjectAssign(
352
'<Component { ...x } y={2} />'
353
- ).toBeCalledWith({}, x, { y: 2 });
353
+ ).toBeCalledWith({}, x, {y: 2});
354
});
355
356
it('coalesces consecutive properties into a single object', function() {
357
expectObjectAssign(
358
'<Component { ... x } y={2} z />'
359
- ).toBeCalledWith({}, x, { y: 2, z: true });
359
+ ).toBeCalledWith({}, x, {y: 2, z: true});
360
});
361
362
it('avoids an unnecessary empty object when spread is not first', function() {
@@ -374,7 +374,7 @@ describe('react jsx', function() {
374
it('evaluates sequences before passing them to React.__spread', function() {
375
expectObjectAssign(
376
'<Component x="1" {...(z = { y: 2 }, z)} z={3}>Text</Component>'
377
- ).toBeCalledWith({x: "1"}, { y: 2 }, {z: 3});
377
+ ).toBeCalledWith({x: "1"}, {y: 2}, {z: 3});
378
});
379
380
});