Fix lint warnings, style fixups
Followup work for recent PRs
Paul O’Shannessy committed
Nov 19, 2014 at 15:24 UTC
b7b74b7efe36ef6de3be8a6101ea74cf8e967439
12 files changed
+16
-34
src/browser/server/ReactServerRendering.js
-2
@@ -23,7 +23,6 @@ var invariant = require('invariant');
23
24
/**
25
* @param {ReactElement} element
26
- * @param {?object} context
26
* @return {string} the HTML markup
27
*/
28
function renderToString(element) {
@@ -49,7 +48,6 @@ function renderToString(element) {
48
49
/**
50
* @param {ReactElement} element
52
- * @param {?object} context
51
* @return {string} the HTML markup, without the extra React ID and checksum
52
* (for generating static pages)
53
*/
src/browser/ui/ReactDOMTextComponent.js
+1
-1
@@ -43,7 +43,7 @@ var ReactDOMTextComponent = function(props) {
43
assign(ReactDOMTextComponent.prototype, {
44
45
/**
46
- * @param {ReactText} node
46
+ * @param {ReactText} text
47
* @internal
48
*/
49
construct: function(text) {
src/browser/ui/__tests__/ReactDOMTextComponent-test.js
+1
-1
@@ -36,7 +36,7 @@ describe('ReactDOMTextComponent', function() {
36
expect(foo.tagName).toBe('SPAN');
37
expect(bar.tagName).toBe('SPAN');
38
39
- var inst = React.render(<div>{'baz'}{'qux'}</div>, el);
39
+ inst = React.render(<div>{'baz'}{'qux'}</div>, el);
40
// After the update, the spans should have stayed in place (as opposed to
41
// getting unmounted and remounted)
42
expect(inst.getDOMNode().children[0]).toBe(foo);
src/browser/ui/dom/components/__tests__/ReactDOMSelect-test.js
+3
-5
@@ -138,9 +138,7 @@ describe('ReactDOMSelect', function() {
138
});
139
140
it('should reset child options selected when they are changed and `value` is set', function() {
141
- var stub =
142
- <select multiple={true} value={["a", "b"]}>
143
- </select>
141
+ var stub = <select multiple={true} value={["a", "b"]} />;
142
stub = ReactTestUtils.renderIntoDocument(stub);
143
144
stub.setProps({
@@ -149,9 +147,9 @@ describe('ReactDOMSelect', function() {
147
<option value="b">b</option>,
148
<option value="c">c</option>
149
]
152
- })
150
+ });
151
154
- var node = stub.getDOMNode()
152
+ var node = stub.getDOMNode();
153
154
expect(node.options[0].selected).toBe(true); // a
155
expect(node.options[1].selected).toBe(true); // b
src/core/ReactComponent.js
+1
-1
@@ -180,7 +180,7 @@ var ReactComponent = {
180
invariant(
181
false,
182
'getPublicInstance should never be called on the base class. It must ' +
183
- 'be overriden.'
183
+ 'be overridden.'
184
);
185
}
186
}
src/core/ReactCompositeComponent.js
+3
-3
@@ -21,12 +21,10 @@ var ReactPerf = require('ReactPerf');
21
var ReactPropTypeLocations = require('ReactPropTypeLocations');
22
var ReactUpdates = require('ReactUpdates');
23
24
-var emptyObject = require('emptyObject');
24
var assign = require('Object.assign');
25
var emptyObject = require('emptyObject');
26
var invariant = require('invariant');
27
var keyMirror = require('keyMirror');
29
-var monitorCodeUse = require('monitorCodeUse');
28
var shouldUpdateReactComponent = require('shouldUpdateReactComponent');
29
var warning = require('warning');
30
@@ -428,7 +426,9 @@ var ReactCompositeComponentMixin = assign({},
426
_processContext: function(context) {
427
var maskedContext = null;
428
var contextTypes = this._instance.constructor.contextTypes;
431
- if (!contextTypes) return emptyObject;
429
+ if (!contextTypes) {
430
+ return emptyObject;
431
+ }
432
maskedContext = {};
433
for (var contextName in contextTypes) {
434
maskedContext[contextName] = context[contextName];
src/core/ReactPropTransferer.js
-4
@@ -13,11 +13,7 @@
13
14
var assign = require('Object.assign');
15
var emptyFunction = require('emptyFunction');
16
-var invariant = require('invariant');
16
var joinClasses = require('joinClasses');
18
-var warning = require('warning');
19
-
20
-var didWarn = false;
17
18
/**
19
* Creates a transfer strategy that will merge prop values using the supplied
src/core/ReactRef.js
+5
-12
@@ -1,17 +1,10 @@
1
/**
2
- * Copyright 2013-2014 Facebook, Inc.
2
+ * Copyright 2013-2014, Facebook, Inc.
3
+ * All rights reserved.
4
*
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
*
9
* @providesModule ReactRef
10
*/
src/core/__tests__/ReactEmptyComponent-test.js
-1
@@ -232,4 +232,3 @@ describe('ReactEmptyComponent', function() {
232
);
233
});
234
});
235
-
src/core/instantiateReactComponent.js
+2
-1
@@ -101,7 +101,8 @@ function instantiateReactComponent(node, parentCompositeType) {
101
} else {
102
invariant(
103
false,
104
- 'Encountered invalid React node of type ' + typeof node
104
+ 'Encountered invalid React node of type %s',
105
+ typeof node
106
);
107
}
108
src/core/shouldUpdateReactComponent.js
-2
@@ -12,8 +12,6 @@
12
13
"use strict";
14
15
-var ReactNativeComponent = require('ReactNativeComponent');
16
-
15
/**
16
* Given a `prevElement` and `nextElement`, determines if the existing
17
* instance should be updated as opposed to being destroyed or replaced by a new
src/test/ReactTestUtils.js
-1
@@ -25,7 +25,6 @@ var ReactUpdates = require('ReactUpdates');
25
var SyntheticEvent = require('SyntheticEvent');
26
27
var assign = require('Object.assign');
28
-var instantiateReactComponent = require('instantiateReactComponent');
28
29
var topLevelTypes = EventConstants.topLevelTypes;
30