Fix lint warnings, style fixups

Followup work for recent PRs
This commit is contained in:
Paul O’Shannessy
2014-11-19 15:24:14 +00:00
parent e18d87b53b
commit b7b74b7efe
12 changed files with 16 additions and 34 deletions
@@ -23,7 +23,6 @@ var invariant = require('invariant');
/**
* @param {ReactElement} element
* @param {?object} context
* @return {string} the HTML markup
*/
function renderToString(element) {
@@ -49,7 +48,6 @@ function renderToString(element) {
/**
* @param {ReactElement} element
* @param {?object} context
* @return {string} the HTML markup, without the extra React ID and checksum
* (for generating static pages)
*/
+1 -1
View File
@@ -43,7 +43,7 @@ var ReactDOMTextComponent = function(props) {
assign(ReactDOMTextComponent.prototype, {
/**
* @param {ReactText} node
* @param {ReactText} text
* @internal
*/
construct: function(text) {
@@ -36,7 +36,7 @@ describe('ReactDOMTextComponent', function() {
expect(foo.tagName).toBe('SPAN');
expect(bar.tagName).toBe('SPAN');
var inst = React.render(<div>{'baz'}{'qux'}</div>, el);
inst = React.render(<div>{'baz'}{'qux'}</div>, el);
// After the update, the spans should have stayed in place (as opposed to
// getting unmounted and remounted)
expect(inst.getDOMNode().children[0]).toBe(foo);
@@ -138,9 +138,7 @@ describe('ReactDOMSelect', function() {
});
it('should reset child options selected when they are changed and `value` is set', function() {
var stub =
<select multiple={true} value={["a", "b"]}>
</select>
var stub = <select multiple={true} value={["a", "b"]} />;
stub = ReactTestUtils.renderIntoDocument(stub);
stub.setProps({
@@ -149,9 +147,9 @@ describe('ReactDOMSelect', function() {
<option value="b">b</option>,
<option value="c">c</option>
]
})
});
var node = stub.getDOMNode()
var node = stub.getDOMNode();
expect(node.options[0].selected).toBe(true); // a
expect(node.options[1].selected).toBe(true); // b
+1 -1
View File
@@ -180,7 +180,7 @@ var ReactComponent = {
invariant(
false,
'getPublicInstance should never be called on the base class. It must ' +
'be overriden.'
'be overridden.'
);
}
}
+3 -3
View File
@@ -21,12 +21,10 @@ var ReactPerf = require('ReactPerf');
var ReactPropTypeLocations = require('ReactPropTypeLocations');
var ReactUpdates = require('ReactUpdates');
var emptyObject = require('emptyObject');
var assign = require('Object.assign');
var emptyObject = require('emptyObject');
var invariant = require('invariant');
var keyMirror = require('keyMirror');
var monitorCodeUse = require('monitorCodeUse');
var shouldUpdateReactComponent = require('shouldUpdateReactComponent');
var warning = require('warning');
@@ -428,7 +426,9 @@ var ReactCompositeComponentMixin = assign({},
_processContext: function(context) {
var maskedContext = null;
var contextTypes = this._instance.constructor.contextTypes;
if (!contextTypes) return emptyObject;
if (!contextTypes) {
return emptyObject;
}
maskedContext = {};
for (var contextName in contextTypes) {
maskedContext[contextName] = context[contextName];
-4
View File
@@ -13,11 +13,7 @@
var assign = require('Object.assign');
var emptyFunction = require('emptyFunction');
var invariant = require('invariant');
var joinClasses = require('joinClasses');
var warning = require('warning');
var didWarn = false;
/**
* Creates a transfer strategy that will merge prop values using the supplied
+5 -12
View File
@@ -1,17 +1,10 @@
/**
* Copyright 2013-2014 Facebook, Inc.
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactRef
*/
@@ -232,4 +232,3 @@ describe('ReactEmptyComponent', function() {
);
});
});
+2 -1
View File
@@ -101,7 +101,8 @@ function instantiateReactComponent(node, parentCompositeType) {
} else {
invariant(
false,
'Encountered invalid React node of type ' + typeof node
'Encountered invalid React node of type %s',
typeof node
);
}
-2
View File
@@ -12,8 +12,6 @@
"use strict";
var ReactNativeComponent = require('ReactNativeComponent');
/**
* Given a `prevElement` and `nextElement`, determines if the existing
* instance should be updated as opposed to being destroyed or replaced by a new
-1
View File
@@ -25,7 +25,6 @@ var ReactUpdates = require('ReactUpdates');
var SyntheticEvent = require('SyntheticEvent');
var assign = require('Object.assign');
var instantiateReactComponent = require('instantiateReactComponent');
var topLevelTypes = EventConstants.topLevelTypes;