From 5b89c1bb2dc944930c37beabf77a3de3c8a7fffe Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 15 Jun 2017 00:30:50 +0100 Subject: [PATCH] Try to re-enable Prettier --- addons/create-react-class/test.js | 7 ++--- addons/react-addons-create-fragment/test.js | 7 ++--- .../react-addons-linked-state-mixin/test.js | 7 ++--- addons/react-addons-pure-render-mixin/test.js | 7 ++--- addons/react-addons-shallow-compare/test.js | 7 ++--- addons/react-addons-update/test.js | 7 ++--- addons/react-linked-input/test.js | 7 ++--- scripts/circleci/test_entry_point.sh | 3 +-- .../types/__tests__/ReactPropTypes-test.js | 2 +- src/renderers/dom/ReactDOM.js | 3 ++- .../dom/client/ReactBrowserEventEmitter.js | 18 +++++++------ src/renderers/dom/client/ReactMount.js | 26 +++++++++++-------- .../syntheticEvents/SyntheticWheelEvent.js | 6 ++--- src/renderers/dom/shared/DOMProperty.js | 4 +-- .../ReactComponentBrowserEnvironment.js | 3 ++- .../hooks/ReactDOMUnknownPropertyHook.js | 4 +-- src/renderers/native/ReactNative.js | 3 ++- .../native/ReactNativeComponentEnvironment.js | 6 +++-- src/renderers/shared/ReactDebugTool.js | 14 +++++----- .../fiber/__tests__/ReactCoroutine-test.js | 6 ++--- .../ReactHostOperationHistoryHook-test.js | 20 ++++++++------ .../eventPlugins/ResponderEventPlugin.js | 12 ++++----- .../event/eventPlugins/TouchHistoryMath.js | 8 +++--- .../__tests__/ResponderEventPlugin-test.js | 12 ++++----- .../shared/stack/reconciler/ReactOwner.js | 6 +++-- .../__tests__/ReactIdentity-test.js | 5 ++-- src/renderers/shared/utils/Transaction.js | 2 +- src/renderers/testing/ReactShallowRenderer.js | 3 ++- src/test/ReactTestUtils.js | 5 ++-- 29 files changed, 123 insertions(+), 97 deletions(-) diff --git a/addons/create-react-class/test.js b/addons/create-react-class/test.js index 4b3561757e..fabcdcb6f5 100644 --- a/addons/create-react-class/test.js +++ b/addons/create-react-class/test.js @@ -46,9 +46,10 @@ env.beforeEach(() => { compare(actual) { return { pass: callCount === 0, - message: 'Expected test not to warn. If the warning is expected, mock ' + - "it out using spyOn(console, 'error'); and test that the " + - 'warning occurs.' + message: + 'Expected test not to warn. If the warning is expected, mock ' + + "it out using spyOn(console, 'error'); and test that the " + + 'warning occurs.' }; } }; diff --git a/addons/react-addons-create-fragment/test.js b/addons/react-addons-create-fragment/test.js index ea23af8c32..97e928fe22 100644 --- a/addons/react-addons-create-fragment/test.js +++ b/addons/react-addons-create-fragment/test.js @@ -44,9 +44,10 @@ env.beforeEach(() => { compare(actual) { return { pass: callCount === 0, - message: 'Expected test not to warn. If the warning is expected, mock ' + - "it out using spyOn(console, 'error'); and test that the " + - 'warning occurs.' + message: + 'Expected test not to warn. If the warning is expected, mock ' + + "it out using spyOn(console, 'error'); and test that the " + + 'warning occurs.' }; } }; diff --git a/addons/react-addons-linked-state-mixin/test.js b/addons/react-addons-linked-state-mixin/test.js index 7580586847..e8527fd87d 100644 --- a/addons/react-addons-linked-state-mixin/test.js +++ b/addons/react-addons-linked-state-mixin/test.js @@ -47,9 +47,10 @@ env.beforeEach(() => { compare(actual) { return { pass: callCount === 0, - message: 'Expected test not to warn. If the warning is expected, mock ' + - "it out using spyOn(console, 'error'); and test that the " + - 'warning occurs.' + message: + 'Expected test not to warn. If the warning is expected, mock ' + + "it out using spyOn(console, 'error'); and test that the " + + 'warning occurs.' }; } }; diff --git a/addons/react-addons-pure-render-mixin/test.js b/addons/react-addons-pure-render-mixin/test.js index ae7f14b266..0cf696048b 100644 --- a/addons/react-addons-pure-render-mixin/test.js +++ b/addons/react-addons-pure-render-mixin/test.js @@ -45,9 +45,10 @@ env.beforeEach(() => { compare(actual) { return { pass: callCount === 0, - message: 'Expected test not to warn. If the warning is expected, mock ' + - "it out using spyOn(console, 'error'); and test that the " + - 'warning occurs.' + message: + 'Expected test not to warn. If the warning is expected, mock ' + + "it out using spyOn(console, 'error'); and test that the " + + 'warning occurs.' }; } }; diff --git a/addons/react-addons-shallow-compare/test.js b/addons/react-addons-shallow-compare/test.js index 28979d376a..2609f58fd6 100644 --- a/addons/react-addons-shallow-compare/test.js +++ b/addons/react-addons-shallow-compare/test.js @@ -45,9 +45,10 @@ env.beforeEach(() => { compare(actual) { return { pass: callCount === 0, - message: 'Expected test not to warn. If the warning is expected, mock ' + - "it out using spyOn(console, 'error'); and test that the " + - 'warning occurs.' + message: + 'Expected test not to warn. If the warning is expected, mock ' + + "it out using spyOn(console, 'error'); and test that the " + + 'warning occurs.' }; } }; diff --git a/addons/react-addons-update/test.js b/addons/react-addons-update/test.js index 76e5213cae..02151df4c7 100644 --- a/addons/react-addons-update/test.js +++ b/addons/react-addons-update/test.js @@ -41,9 +41,10 @@ env.beforeEach(() => { compare(actual) { return { pass: callCount === 0, - message: 'Expected test not to warn. If the warning is expected, mock ' + - "it out using spyOn(console, 'error'); and test that the " + - 'warning occurs.' + message: + 'Expected test not to warn. If the warning is expected, mock ' + + "it out using spyOn(console, 'error'); and test that the " + + 'warning occurs.' }; } }; diff --git a/addons/react-linked-input/test.js b/addons/react-linked-input/test.js index 99af6f91bd..f0304d2d38 100644 --- a/addons/react-linked-input/test.js +++ b/addons/react-linked-input/test.js @@ -41,9 +41,10 @@ env.beforeEach(() => { compare(actual) { return { pass: callCount === 0, - message: 'Expected test not to warn. If the warning is expected, mock ' + - "it out using spyOn(console, 'error'); and test that the " + - 'warning occurs.' + message: + 'Expected test not to warn. If the warning is expected, mock ' + + "it out using spyOn(console, 'error'); and test that the " + + 'warning occurs.' }; } }; diff --git a/scripts/circleci/test_entry_point.sh b/scripts/circleci/test_entry_point.sh index 3321bebf05..1c0e03add1 100755 --- a/scripts/circleci/test_entry_point.sh +++ b/scripts/circleci/test_entry_point.sh @@ -23,8 +23,7 @@ fi # These seem out of order but extract-errors must be run after jest. if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then COMMANDS_TO_RUN+=('./node_modules/.bin/gulp lint') - # Temporary: I can't figure out why it fails on CI but works locally - # COMMANDS_TO_RUN+=('node ./scripts/prettier/index') + COMMANDS_TO_RUN+=('node ./scripts/prettier/index') COMMANDS_TO_RUN+=('./node_modules/.bin/gulp flow') COMMANDS_TO_RUN+=('./node_modules/.bin/grunt build') COMMANDS_TO_RUN+=('./scripts/circleci/test_extract_errors.sh') diff --git a/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js b/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js index ab9f56bbc8..092d2b6f85 100644 --- a/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js +++ b/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js @@ -40,7 +40,7 @@ function typeCheckFailRequiredValues(declaration) { '`testComponent`, but its value is `null`.'; var unspecifiedMsg = 'The prop `testProp` is marked as required in ' + - '`testComponent`, but its value is \`undefined\`.'; + '`testComponent`, but its value is `undefined`.'; var props1 = {testProp: null}; var error1 = declaration( props1, diff --git a/src/renderers/dom/ReactDOM.js b/src/renderers/dom/ReactDOM.js index d313e001cd..a30ee9af45 100644 --- a/src/renderers/dom/ReactDOM.js +++ b/src/renderers/dom/ReactDOM.js @@ -47,7 +47,8 @@ if ( ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ ComponentTree: { - getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode, + getClosestInstanceFromNode: + ReactDOMComponentTree.getClosestInstanceFromNode, getNodeFromInstance: function(inst) { // inst is an internal instance (but could be a composite) if (inst._renderedComponent) { diff --git a/src/renderers/dom/client/ReactBrowserEventEmitter.js b/src/renderers/dom/client/ReactBrowserEventEmitter.js index abdd55a894..e51837c112 100644 --- a/src/renderers/dom/client/ReactBrowserEventEmitter.js +++ b/src/renderers/dom/client/ReactBrowserEventEmitter.js @@ -84,10 +84,10 @@ var reactTopListenersCounter = 0; var topEventMapping = { topAbort: 'abort', topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend', - topAnimationIteration: getVendorPrefixedEventName('animationiteration') || - 'animationiteration', - topAnimationStart: getVendorPrefixedEventName('animationstart') || - 'animationstart', + topAnimationIteration: + getVendorPrefixedEventName('animationiteration') || 'animationiteration', + topAnimationStart: + getVendorPrefixedEventName('animationstart') || 'animationstart', topBlur: 'blur', topCanPlay: 'canplay', topCanPlayThrough: 'canplaythrough', @@ -144,8 +144,8 @@ var topEventMapping = { topTouchEnd: 'touchend', topTouchMove: 'touchmove', topTouchStart: 'touchstart', - topTransitionEnd: getVendorPrefixedEventName('transitionend') || - 'transitionend', + topTransitionEnd: + getVendorPrefixedEventName('transitionend') || 'transitionend', topVolumeChange: 'volumechange', topWaiting: 'waiting', topWheel: 'wheel', @@ -209,8 +209,10 @@ var ReactBrowserEventEmitter = Object.assign({}, ReactEventEmitterMixin, { * @return {boolean} True if callbacks are enabled. */ isEnabled: function() { - return !!(ReactBrowserEventEmitter.ReactEventListener && - ReactBrowserEventEmitter.ReactEventListener.isEnabled()); + return !!( + ReactBrowserEventEmitter.ReactEventListener && + ReactBrowserEventEmitter.ReactEventListener.isEnabled() + ); }, /** diff --git a/src/renderers/dom/client/ReactMount.js b/src/renderers/dom/client/ReactMount.js index d68760d573..382aff8901 100644 --- a/src/renderers/dom/client/ReactMount.js +++ b/src/renderers/dom/client/ReactMount.js @@ -216,9 +216,11 @@ function hasNonRootReactChild(container) { */ function nodeIsRenderedByOtherInstance(container) { var rootEl = getReactRootElementInContainer(container); - return !!(rootEl && + return !!( + rootEl && isReactNode(rootEl) && - !ReactDOMComponentTree.getInstanceFromNode(rootEl)); + !ReactDOMComponentTree.getInstanceFromNode(rootEl) + ); } /** @@ -229,10 +231,12 @@ function nodeIsRenderedByOtherInstance(container) { * @internal */ function isValidContainer(node) { - return !!(node && + return !!( + node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || - node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)); + node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) + ); } /** @@ -445,13 +449,13 @@ var ReactMount = { ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or
." : typeof nextElement === 'function' - ? ' Instead of passing a class like Foo, pass ' + - 'React.createElement(Foo) or .' - : // Check if it quacks like an element - nextElement != null && nextElement.props !== undefined - ? ' This may be caused by unintentionally loading two independent ' + - 'copies of React.' - : '', + ? ' Instead of passing a class like Foo, pass ' + + 'React.createElement(Foo) or .' + : // Check if it quacks like an element + nextElement != null && nextElement.props !== undefined + ? ' This may be caused by unintentionally loading two independent ' + + 'copies of React.' + : '', ); warning( diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js index 76a0d67ac9..e1359a2506 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js @@ -29,9 +29,9 @@ var WheelEventInterface = { ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). 'wheelDeltaY' in event - ? -event.wheelDeltaY - : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). - 'wheelDelta' in event ? -event.wheelDelta : 0; + ? -event.wheelDeltaY + : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). + 'wheelDelta' in event ? -event.wheelDelta : 0; }, deltaZ: null, diff --git a/src/renderers/dom/shared/DOMProperty.js b/src/renderers/dom/shared/DOMProperty.js index ac0ab4d0c1..3d2e36cfa6 100644 --- a/src/renderers/dom/shared/DOMProperty.js +++ b/src/renderers/dom/shared/DOMProperty.js @@ -163,8 +163,8 @@ var DOMProperty = { ROOT_ATTRIBUTE_NAME: 'data-reactroot', ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR, - ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + - '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040', + ATTRIBUTE_NAME_CHAR: + ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040', /** * Map from property "standard name" to an object with info about how to set diff --git a/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js b/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js index fe874cdc6c..13226723bc 100644 --- a/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js +++ b/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js @@ -20,7 +20,8 @@ var ReactDOMIDOperations = require('ReactDOMIDOperations'); * need for this injection. */ var ReactComponentBrowserEnvironment = { - processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, + processChildrenUpdates: + ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup, }; diff --git a/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js b/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js index 8d22ee8649..6720bc7f03 100644 --- a/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js +++ b/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js @@ -59,8 +59,8 @@ if (__DEV__) { var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) - ? DOMProperty.getPossibleStandardName[lowerCasedName] - : null; + ? DOMProperty.getPossibleStandardName[lowerCasedName] + : null; var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty( lowerCasedName, diff --git a/src/renderers/native/ReactNative.js b/src/renderers/native/ReactNative.js index 1b530a669a..218defb7fc 100644 --- a/src/renderers/native/ReactNative.js +++ b/src/renderers/native/ReactNative.js @@ -41,7 +41,8 @@ var ReactNative = { unstable_batchedUpdates: ReactUpdates.batchedUpdates, /* eslint-enable camelcase */ - unmountComponentAtNodeAndRemoveContainer: ReactNativeMount.unmountComponentAtNodeAndRemoveContainer, + unmountComponentAtNodeAndRemoveContainer: + ReactNativeMount.unmountComponentAtNodeAndRemoveContainer, }; // Inject the runtime into a devtools global hook regardless of browser. diff --git a/src/renderers/native/ReactNativeComponentEnvironment.js b/src/renderers/native/ReactNativeComponentEnvironment.js index 0e1a3f5826..041b7bac5c 100644 --- a/src/renderers/native/ReactNativeComponentEnvironment.js +++ b/src/renderers/native/ReactNativeComponentEnvironment.js @@ -15,9 +15,11 @@ var ReactNativeDOMIDOperations = require('ReactNativeDOMIDOperations'); var ReactNativeReconcileTransaction = require('ReactNativeReconcileTransaction'); var ReactNativeComponentEnvironment = { - processChildrenUpdates: ReactNativeDOMIDOperations.dangerouslyProcessChildrenUpdates, + processChildrenUpdates: + ReactNativeDOMIDOperations.dangerouslyProcessChildrenUpdates, - replaceNodeWithMarkup: ReactNativeDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, + replaceNodeWithMarkup: + ReactNativeDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, /** * @param {DOMElement} Element to clear. diff --git a/src/renderers/shared/ReactDebugTool.js b/src/renderers/shared/ReactDebugTool.js index be24d7d200..a83432a1ac 100644 --- a/src/renderers/shared/ReactDebugTool.js +++ b/src/renderers/shared/ReactDebugTool.js @@ -118,9 +118,10 @@ function getTreeSnapshot(registeredIDs) { updateCount: ReactComponentTreeHook.getUpdateCount(id), childIDs: ReactComponentTreeHook.getChildIDs(id), // Text nodes don't have owners but this is close enough. - ownerID: ownerID || - (parentID && ReactComponentTreeHook.getOwnerID(parentID)) || - 0, + ownerID: + ownerID || + (parentID && ReactComponentTreeHook.getOwnerID(parentID)) || + 0, parentID, }; return tree; @@ -205,9 +206,10 @@ function endLifeCycleTimer(debugID, timerType) { currentFlushMeasurements.push({ timerType, instanceID: debugID, - duration: performanceNow() - - currentTimerStartTime - - currentTimerNestedFlushDuration, + duration: + performanceNow() - + currentTimerStartTime - + currentTimerNestedFlushDuration, }); } currentTimerStartTime = 0; diff --git a/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js b/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js index cf6c4cd01e..af56323055 100644 --- a/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js +++ b/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js @@ -50,9 +50,9 @@ describe('ReactCoroutine', () => { function HandleYields(props, yields) { ops.push('HandleYields'); - return yields.map(y => ( - - )); + return yields.map(y => + , + ); } // An alternative API could mark Parent as something that needs diff --git a/src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js b/src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js index fcb02ae5f3..87877916ac 100644 --- a/src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js +++ b/src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js @@ -159,8 +159,9 @@ describe('ReactHostOperationHistoryHook', () => { { instanceID: inst._debugID, type: 'mount', - payload: '
', + payload: + '
', }, ]); } @@ -279,8 +280,9 @@ describe('ReactHostOperationHistoryHook', () => { { instanceID: inst._debugID, type: 'mount', - payload: '
', + payload: + '
', }, ]); } @@ -382,8 +384,9 @@ describe('ReactHostOperationHistoryHook', () => { { instanceID: inst._debugID, type: 'mount', - payload: '
', + payload: + '
', }, ]); } @@ -460,8 +463,9 @@ describe('ReactHostOperationHistoryHook', () => { { instanceID: inst._debugID, type: 'mount', - payload: '', + payload: + '', }, ]); } diff --git a/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js b/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js index fd18d40190..15601903bd 100644 --- a/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js +++ b/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js @@ -322,10 +322,10 @@ function setResponderAndExtractTransfer( var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) - ? eventTypes.moveShouldSetResponder - : topLevelType === 'topSelectionChange' - ? eventTypes.selectionChangeShouldSetResponder - : eventTypes.scrollShouldSetResponder; + ? eventTypes.moveShouldSetResponder + : topLevelType === 'topSelectionChange' + ? eventTypes.selectionChangeShouldSetResponder + : eventTypes.scrollShouldSetResponder; // TODO: stop one short of the current responder. var bubbleShouldSetFrom = !responderInst @@ -519,8 +519,8 @@ var ResponderEventPlugin = { var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove - ? eventTypes.responderMove - : isResponderTouchEnd ? eventTypes.responderEnd : null; + ? eventTypes.responderMove + : isResponderTouchEnd ? eventTypes.responderEnd : null; if (incrementalTouch) { var gesture = ResponderSyntheticEvent.getPooled( diff --git a/src/renderers/shared/stack/event/eventPlugins/TouchHistoryMath.js b/src/renderers/shared/stack/event/eventPlugins/TouchHistoryMath.js index 50006f7e72..a841e00af2 100644 --- a/src/renderers/shared/stack/event/eventPlugins/TouchHistoryMath.js +++ b/src/renderers/shared/stack/event/eventPlugins/TouchHistoryMath.js @@ -43,10 +43,10 @@ var TouchHistoryMath = { total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis - ? oneTouchData.currentPageY - : !ofCurrent && isXAxis - ? oneTouchData.previousPageX - : oneTouchData.previousPageY; + ? oneTouchData.currentPageY + : !ofCurrent && isXAxis + ? oneTouchData.previousPageX + : oneTouchData.previousPageY; count = 1; } } else { diff --git a/src/renderers/shared/stack/event/eventPlugins/__tests__/ResponderEventPlugin-test.js b/src/renderers/shared/stack/event/eventPlugins/__tests__/ResponderEventPlugin-test.js index cc04def081..e6689decdc 100644 --- a/src/renderers/shared/stack/event/eventPlugins/__tests__/ResponderEventPlugin-test.js +++ b/src/renderers/shared/stack/event/eventPlugins/__tests__/ResponderEventPlugin-test.js @@ -69,12 +69,12 @@ var _touchConfig = function( var activeTouchObjects = topType === 'topTouchStart' ? allTouchObjects : topType === 'topTouchMove' - ? allTouchObjects - : topType === 'topTouchEnd' - ? antiSubsequence(allTouchObjects, changedIndices) - : topType === 'topTouchCancel' - ? antiSubsequence(allTouchObjects, changedIndices) - : null; + ? allTouchObjects + : topType === 'topTouchEnd' + ? antiSubsequence(allTouchObjects, changedIndices) + : topType === 'topTouchCancel' + ? antiSubsequence(allTouchObjects, changedIndices) + : null; return { nativeEvent: touchEvent( diff --git a/src/renderers/shared/stack/reconciler/ReactOwner.js b/src/renderers/shared/stack/reconciler/ReactOwner.js index 126606aef7..a25e987d89 100644 --- a/src/renderers/shared/stack/reconciler/ReactOwner.js +++ b/src/renderers/shared/stack/reconciler/ReactOwner.js @@ -22,9 +22,11 @@ import type {ReactInstance} from 'ReactInstanceType'; * @final */ function isValidOwner(object: any): boolean { - return !!(object && + return !!( + object && typeof object.attachRef === 'function' && - typeof object.detachRef === 'function'); + typeof object.detachRef === 'function' + ); } /** diff --git a/src/renderers/shared/stack/reconciler/__tests__/ReactIdentity-test.js b/src/renderers/shared/stack/reconciler/__tests__/ReactIdentity-test.js index e6bf215c67..254fc50e6d 100644 --- a/src/renderers/shared/stack/reconciler/__tests__/ReactIdentity-test.js +++ b/src/renderers/shared/stack/reconciler/__tests__/ReactIdentity-test.js @@ -31,12 +31,11 @@ describe('ReactIdentity', () => { it('should allow key property to express identity', () => { var node; - var Component = props => ( + var Component = props =>
(node = c)}>
-
- ); +
; var container = document.createElement('div'); ReactDOM.render(, container); diff --git a/src/renderers/shared/utils/Transaction.js b/src/renderers/shared/utils/Transaction.js index 777f79d94d..4fbe9d88e1 100644 --- a/src/renderers/shared/utils/Transaction.js +++ b/src/renderers/shared/utils/Transaction.js @@ -134,7 +134,7 @@ var TransactionImpl = { E, F, G, - T: (a: A, b: B, c: C, d: D, e: E, f: F) => G + T: (a: A, b: B, c: C, d: D, e: E, f: F) => G, >(method: T, scope: any, a: A, b: B, c: C, d: D, e: E, f: F): G { /* eslint-enable space-before-function-paren */ invariant( diff --git a/src/renderers/testing/ReactShallowRenderer.js b/src/renderers/testing/ReactShallowRenderer.js index 1ab4aa8823..17fe612f79 100644 --- a/src/renderers/testing/ReactShallowRenderer.js +++ b/src/renderers/testing/ReactShallowRenderer.js @@ -64,7 +64,8 @@ Object.assign(ShallowComponentWrapper.prototype, ReactCompositeComponent, { return new NoopInternalComponent(element); }, _replaceNodeWithMarkup: function() {}, - _renderValidatedComponent: ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext, + _renderValidatedComponent: + ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext, }); function _batchedRender(renderer, element, context) { diff --git a/src/test/ReactTestUtils.js b/src/test/ReactTestUtils.js index 9d068581fc..13e1b27709 100644 --- a/src/test/ReactTestUtils.js +++ b/src/test/ReactTestUtils.js @@ -156,8 +156,9 @@ var ReactTestUtils = { var internalInstance = ReactInstanceMap.get(inst); var constructor = internalInstance._currentElement.type; - return !!(ReactTestUtils.isCompositeComponentElement(inst) && - constructor === type); + return !!( + ReactTestUtils.isCompositeComponentElement(inst) && constructor === type + ); }, getRenderedChildOfCompositeComponent: function(inst) {