diff --git a/scripts/jest/test-framework-setup.js b/scripts/jest/test-framework-setup.js
index 3eb26a2dc2c..6f81721e118 100644
--- a/scripts/jest/test-framework-setup.js
+++ b/scripts/jest/test-framework-setup.js
@@ -36,9 +36,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/release-manager/commands/init.js b/scripts/release-manager/commands/init.js
index 5b392b7c1cf..59ac95682ae 100644
--- a/scripts/release-manager/commands/init.js
+++ b/scripts/release-manager/commands/init.js
@@ -27,7 +27,9 @@ module.exports = function(vorpal, app) {
{
name: 'githubToken',
type: 'input',
- message: `${chalk.bold('GitHub token?')} ${chalk.grey('(needs "repo" privs)')} `,
+ message: `${chalk.bold('GitHub token?')} ${chalk.grey(
+ '(needs "repo" privs)'
+ )} `,
},
{
name: 'reactPath',
diff --git a/scripts/release-manager/commands/npm-check-access.js b/scripts/release-manager/commands/npm-check-access.js
index cfc8c3a4f2d..dd9c9827af3 100644
--- a/scripts/release-manager/commands/npm-check-access.js
+++ b/scripts/release-manager/commands/npm-check-access.js
@@ -27,7 +27,9 @@ module.exports = function(vorpal, app) {
if (packagesNeedingAccess.length) {
this.log(
- `${chalk.red('FAILED')} You don't have access to all of the packages ` +
+ `${chalk.red(
+ 'FAILED'
+ )} You don't have access to all of the packages ` +
`you need. We just opened a URL to file a new issue requesting access.`
);
opn(
diff --git a/scripts/release-manager/commands/npm-grant-access.js b/scripts/release-manager/commands/npm-grant-access.js
index 0a1ffd3d26b..5aaa7d40424 100644
--- a/scripts/release-manager/commands/npm-grant-access.js
+++ b/scripts/release-manager/commands/npm-grant-access.js
@@ -27,11 +27,15 @@ module.exports = function(vorpal, app) {
if (packagesNeedingAccess.length) {
this.log(
- `${chalk.yellow('PENDING')} Granting access to ${packagesNeedingAccess}`
+ `${chalk.yellow(
+ 'PENDING'
+ )} Granting access to ${packagesNeedingAccess}`
);
npmUtils.grantAccess(app, answers.username, packagesNeedingAccess);
this.log(
- `${chalk.green('OK')} Access has been granted to ${answers.username}.`
+ `${chalk.green(
+ 'OK'
+ )} Access has been granted to ${answers.username}.`
);
resolve();
} else {
diff --git a/scripts/release-manager/commands/npm-publish.js b/scripts/release-manager/commands/npm-publish.js
index 5267a869374..3d2a0ebdc94 100644
--- a/scripts/release-manager/commands/npm-publish.js
+++ b/scripts/release-manager/commands/npm-publish.js
@@ -28,7 +28,8 @@ module.exports = function(vorpal, app) {
this.prompt([
{
type: 'confirm',
- message: 'Did you run `grunt build` or `grunt release` and bump the version number?',
+ message:
+ 'Did you run `grunt build` or `grunt release` and bump the version number?',
default: false,
name: 'checklist',
},
diff --git a/scripts/release-manager/commands/stable-prs.js b/scripts/release-manager/commands/stable-prs.js
index 586232adabf..50ea08c73b3 100644
--- a/scripts/release-manager/commands/stable-prs.js
+++ b/scripts/release-manager/commands/stable-prs.js
@@ -66,13 +66,15 @@ module.exports = function(vorpal, app) {
{
name: 'destMilestone',
type: 'list',
- message: 'Which milestone should we assign PRs to upon completion?',
+ message:
+ 'Which milestone should we assign PRs to upon completion?',
choices: milestoneChoices,
},
{
name: 'labels',
type: 'checkbox',
- message: 'Which PRs should we select (use spacebar to check all that apply)',
+ message:
+ 'Which PRs should we select (use spacebar to check all that apply)',
choices: labelChoices,
},
]).then(answers => {
@@ -136,7 +138,9 @@ module.exports = function(vorpal, app) {
.filter(pr => {
if (!pr.merged_at) {
this.log(
- `${chalk.yellow.bold('WARNING')} ${pr.html_url} was not merged,` +
+ `${chalk.yellow.bold(
+ 'WARNING'
+ )} ${pr.html_url} was not merged,` +
` should have the milestone unset.`
);
return false;
@@ -180,7 +184,9 @@ module.exports = function(vorpal, app) {
})
.catch(err => {
this.log(
- `${chalk.red.bold('ERROR')} Something went wrong and your repo is` +
+ `${chalk.red.bold(
+ 'ERROR'
+ )} Something went wrong and your repo is` +
` probably in a bad state. Sorry.`
);
resolve({
@@ -243,13 +249,16 @@ function cherryPickPRs(app, prs) {
return this.prompt({
name: 'handle',
type: 'list',
- message: `${chalk.red`Failed!`} ${chalk.yellow('This must be resolved manually!')}`,
+ message: `${chalk.red`Failed!`} ${chalk.yellow(
+ 'This must be resolved manually!'
+ )}`,
choices: [
{value: 'ok', name: 'Continue, mark successful'},
{value: 'skip', name: 'Continue, mark skipped'},
{
value: 'abort',
- name: 'Abort process. Will require manual resetting of git state.',
+ name:
+ 'Abort process. Will require manual resetting of git state.',
},
],
}).then(answers => {
diff --git a/scripts/release-manager/commands/utils/npm.js b/scripts/release-manager/commands/utils/npm.js
index 8126a9caa2e..50fa39db9cd 100644
--- a/scripts/release-manager/commands/utils/npm.js
+++ b/scripts/release-manager/commands/utils/npm.js
@@ -26,7 +26,9 @@ function generateAccessNeededIssue(username, packages) {
body: `In order to publish React to npm I need access to the following repositories:
${packages.map(pkg => `- [${pkg}](https://npm.im/${pkg})`).join('\n')}`,
};
- return `https://github.com/facebook/react/issues/new?${querystring.stringify(data)}`;
+ return `https://github.com/facebook/react/issues/new?${querystring.stringify(
+ data
+ )}`;
}
function grantAccess(app, username, packages) {
diff --git a/scripts/release-manager/commands/version.js b/scripts/release-manager/commands/version.js
index 8e1f5532afa..a8e2e0d8131 100644
--- a/scripts/release-manager/commands/version.js
+++ b/scripts/release-manager/commands/version.js
@@ -158,7 +158,8 @@ module.exports = function(vorpal, app) {
{
name: 'tag',
type: 'confirm',
- message: 'Tag the version commit (not necessary for non-stable releases)?',
+ message:
+ 'Tag the version commit (not necessary for non-stable releases)?',
default: true,
when: res => res.commit,
},
diff --git a/scripts/rollup/modules.js b/scripts/rollup/modules.js
index cdc0e32b4d7..076f07c75fe 100644
--- a/scripts/rollup/modules.js
+++ b/scripts/rollup/modules.js
@@ -225,7 +225,9 @@ function replaceFbjsModuleAliases(bundleType) {
}
}
-const devOnlyModuleStub = `'${resolve('./scripts/rollup/shims/rollup/DevOnlyStubShim.js')}'`;
+const devOnlyModuleStub = `'${resolve(
+ './scripts/rollup/shims/rollup/DevOnlyStubShim.js'
+)}'`;
function replaceDevOnlyStubbedModules(bundleType) {
switch (bundleType) {
diff --git a/src/isomorphic/classic/element/ReactElementValidator.js b/src/isomorphic/classic/element/ReactElementValidator.js
index 6fe05d889e5..0590c57ae6e 100644
--- a/src/isomorphic/classic/element/ReactElementValidator.js
+++ b/src/isomorphic/classic/element/ReactElementValidator.js
@@ -112,7 +112,9 @@ function validateExplicitKey(element, parentType) {
element._owner !== ReactCurrentOwner.current
) {
// Give the component that originally created this child.
- childOwner = ` It was passed a child from ${getComponentName(element._owner)}.`;
+ childOwner = ` It was passed a child from ${getComponentName(
+ element._owner,
+ )}.`;
}
warning(
diff --git a/src/renderers/__tests__/ReactCompositeComponentState-test.js b/src/renderers/__tests__/ReactCompositeComponentState-test.js
index ddfdabe106b..16bd2b6d50f 100644
--- a/src/renderers/__tests__/ReactCompositeComponentState-test.js
+++ b/src/renderers/__tests__/ReactCompositeComponentState-test.js
@@ -414,7 +414,8 @@ describe('ReactCompositeComponent-state', () => {
this.setState({step: 2}, () => {
// Tests that earlier setState callbacks are not dropped
ops.push(
- `callback -- step: ${this.state.step}, extra: ${!!this.state.extra}`,
+ `callback -- step: ${this.state.step}, extra: ${!!this.state
+ .extra}`,
);
});
// Treat like replaceState
@@ -458,7 +459,8 @@ describe('ReactCompositeComponent-state', () => {
this.setState({step: 2}, () => {
// Tests that earlier setState callbacks are not dropped
ops.push(
- `callback -- step: ${this.state.step}, extra: ${!!this.state.extra}`,
+ `callback -- step: ${this.state.step}, extra: ${!!this.state
+ .extra}`,
);
});
// Treat like replaceState
diff --git a/src/renderers/__tests__/ReactErrorBoundaries-test.js b/src/renderers/__tests__/ReactErrorBoundaries-test.js
index 5b4ef6ecf36..9f3281f88ec 100644
--- a/src/renderers/__tests__/ReactErrorBoundaries-test.js
+++ b/src/renderers/__tests__/ReactErrorBoundaries-test.js
@@ -2001,11 +2001,10 @@ describe('ReactErrorBoundaries', () => {
ReactDOM.render(
(
+ renderError={error =>
We should never catch our own error: {error.message}.
-
- )}
+ }
/>
,
container,
diff --git a/src/renderers/__tests__/ReactIdentity-test.js b/src/renderers/__tests__/ReactIdentity-test.js
index 9bcc07a9fd9..5c96d1e9d2a 100644
--- a/src/renderers/__tests__/ReactIdentity-test.js
+++ b/src/renderers/__tests__/ReactIdentity-test.js
@@ -25,12 +25,11 @@ describe('ReactIdentity', () => {
it('should allow key property to express identity', () => {
var node;
- var Component = props => (
+ var Component = props =>
- );
+ ;
var container = document.createElement('div');
ReactDOM.render(, container);
diff --git a/src/renderers/dom/ReactDOMStackEntry.js b/src/renderers/dom/ReactDOMStackEntry.js
index a7f76d8ae62..fda5c82e735 100644
--- a/src/renderers/dom/ReactDOMStackEntry.js
+++ b/src/renderers/dom/ReactDOMStackEntry.js
@@ -61,7 +61,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/fiber/ReactDOMFiberEntry.js b/src/renderers/dom/fiber/ReactDOMFiberEntry.js
index 72d366feadf..138632cc840 100644
--- a/src/renderers/dom/fiber/ReactDOMFiberEntry.js
+++ b/src/renderers/dom/fiber/ReactDOMFiberEntry.js
@@ -96,10 +96,12 @@ let selectionInformation: ?mixed = null;
* @internal
*/
function isValidContainer(node) {
- return !!(node &&
+ return !!(
+ node &&
(node.nodeType === ELEMENT_NODE ||
node.nodeType === DOCUMENT_NODE ||
- node.nodeType === DOCUMENT_FRAGMENT_NODE));
+ node.nodeType === DOCUMENT_FRAGMENT_NODE)
+ );
}
function getReactRootElementInContainer(container: any) {
@@ -116,9 +118,11 @@ function getReactRootElementInContainer(container: any) {
function shouldReuseContent(container) {
const rootElement = getReactRootElementInContainer(container);
- return !!(rootElement &&
+ return !!(
+ rootElement &&
rootElement.nodeType === ELEMENT_NODE &&
- rootElement.getAttribute(ID_ATTRIBUTE_NAME));
+ rootElement.getAttribute(ID_ATTRIBUTE_NAME)
+ );
}
function shouldAutoFocusHostComponent(type: string, props: Props): boolean {
@@ -468,8 +472,9 @@ function renderSubtreeIntoContainer(
if (__DEV__) {
const isRootRenderedBySomeReact = !!container._reactRootContainer;
const rootEl = getReactRootElementInContainer(container);
- const hasNonRootReactChild = !!(rootEl &&
- ReactDOMComponentTree.getInstanceFromNode(rootEl));
+ const hasNonRootReactChild = !!(
+ rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl)
+ );
warning(
!hasNonRootReactChild || isRootRenderedBySomeReact,
diff --git a/src/renderers/dom/shared/DOMProperty.js b/src/renderers/dom/shared/DOMProperty.js
index 793df14dd77..f72c0e48f63 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/__tests__/ReactDOMComponent-test.js b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
index 394cb5a74c9..8c72c3d3057 100644
--- a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
+++ b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
@@ -1667,8 +1667,8 @@ describe('ReactDOMComponent', () => {
var previousLine = (matches || [])[1];
expectDev(console.error.calls.argsFor(1)[0]).toContain('onClick');
- matches = console.error.calls.argsFor(1)[0].match(/.*\(.*:(\d+)\).*/) || {
- };
+ matches =
+ console.error.calls.argsFor(1)[0].match(/.*\(.*:(\d+)\).*/) || {};
var currentLine = (matches || [])[1];
//verify line number has a proper relative difference,
diff --git a/src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js b/src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js
index 271d2f2d3fc..8ef20663d02 100644
--- a/src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js
+++ b/src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js
@@ -2137,22 +2137,22 @@ describe('ReactDOMServerIntegration', () => {
it('should error reconnecting a div with children separated by whitespace on the client', () =>
expectMarkupMismatch(
,
- // prettier-ignore
- , // eslint-disable-line no-multi-spaces
+ // eslint-disable-next-line no-multi-spaces
+ ,
));
it('should error reconnecting a div with children separated by different whitespace on the server', () =>
expectMarkupMismatch(
- // prettier-ignore
- , // eslint-disable-line no-multi-spaces
+ // eslint-disable-next-line no-multi-spaces
+ ,
,
));
it('should error reconnecting a div with children separated by different whitespace', () =>
expectMarkupMismatch(
,
- // prettier-ignore
- , // eslint-disable-line no-multi-spaces
+ // eslint-disable-next-line no-multi-spaces
+ ,
));
it('can distinguish an empty component from a dom node', () =>
diff --git a/src/renderers/dom/shared/eventPlugins/SelectEventPlugin.js b/src/renderers/dom/shared/eventPlugins/SelectEventPlugin.js
index 6e1f214036d..e077ed26669 100644
--- a/src/renderers/dom/shared/eventPlugins/SelectEventPlugin.js
+++ b/src/renderers/dom/shared/eventPlugins/SelectEventPlugin.js
@@ -154,8 +154,8 @@ var SelectEventPlugin = {
var doc = nativeEventTarget.window === nativeEventTarget
? nativeEventTarget.document
: nativeEventTarget.nodeType === DOCUMENT_NODE
- ? nativeEventTarget
- : nativeEventTarget.ownerDocument;
+ ? nativeEventTarget
+ : nativeEventTarget.ownerDocument;
if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
return null;
}
diff --git a/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js b/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js
index 083ae3019e4..15c70ea01b6 100644
--- a/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js
+++ b/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js
@@ -69,8 +69,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/dom/shared/syntheticEvents/SyntheticWheelEvent.js b/src/renderers/dom/shared/syntheticEvents/SyntheticWheelEvent.js
index 76a0d67ac99..e1359a25063 100644
--- a/src/renderers/dom/shared/syntheticEvents/SyntheticWheelEvent.js
+++ b/src/renderers/dom/shared/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/stack/client/ReactComponentBrowserEnvironment.js b/src/renderers/dom/stack/client/ReactComponentBrowserEnvironment.js
index fe874cdc6c4..13226723bce 100644
--- a/src/renderers/dom/stack/client/ReactComponentBrowserEnvironment.js
+++ b/src/renderers/dom/stack/client/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/stack/client/ReactMount.js b/src/renderers/dom/stack/client/ReactMount.js
index 649efdd2818..0a7b6df03b7 100644
--- a/src/renderers/dom/stack/client/ReactMount.js
+++ b/src/renderers/dom/stack/client/ReactMount.js
@@ -205,9 +205,11 @@ function hasNonRootReactChild(container) {
*/
function nodeIsRenderedByOtherInstance(container) {
var rootEl = getReactRootElementInContainer(container);
- return !!(rootEl &&
+ return !!(
+ rootEl &&
isReactNode(rootEl) &&
- !ReactDOMComponentTree.getInstanceFromNode(rootEl));
+ !ReactDOMComponentTree.getInstanceFromNode(rootEl)
+ );
}
/**
@@ -218,10 +220,12 @@ function nodeIsRenderedByOtherInstance(container) {
* @internal
*/
function isValidContainer(node) {
- return !!(node &&
+ return !!(
+ node &&
(node.nodeType === ELEMENT_NODE ||
node.nodeType === DOCUMENT_NODE ||
- node.nodeType === DOCUMENT_FRAGMENT_NODE));
+ node.nodeType === DOCUMENT_FRAGMENT_NODE)
+ );
}
/**
diff --git a/src/renderers/dom/test/ReactTestUtilsEntry.js b/src/renderers/dom/test/ReactTestUtilsEntry.js
index a08eef557cb..842b6ee557e 100644
--- a/src/renderers/dom/test/ReactTestUtilsEntry.js
+++ b/src/renderers/dom/test/ReactTestUtilsEntry.js
@@ -213,8 +213,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
+ );
},
// TODO: deprecate? It's undocumented and unused.
diff --git a/src/renderers/native/NativeMethodsMixin.js b/src/renderers/native/NativeMethodsMixin.js
index 5f2fd32cb91..23090f4e3ee 100644
--- a/src/renderers/native/NativeMethodsMixin.js
+++ b/src/renderers/native/NativeMethodsMixin.js
@@ -31,9 +31,7 @@ import type {
MeasureOnSuccessCallback,
NativeMethodsMixinType,
} from 'ReactNativeTypes';
-import type {
- ReactNativeBaseComponentViewConfig,
-} from 'ReactNativeViewConfigRegistry';
+import type {ReactNativeBaseComponentViewConfig} from 'ReactNativeViewConfigRegistry';
const findNumericNodeHandle = ReactNativeFeatureFlags.useFiber
? require('findNumericNodeHandleFiber')
diff --git a/src/renderers/native/ReactNativeComponent.js b/src/renderers/native/ReactNativeComponent.js
index 348229ba453..e7c21f26389 100644
--- a/src/renderers/native/ReactNativeComponent.js
+++ b/src/renderers/native/ReactNativeComponent.js
@@ -29,9 +29,7 @@ import type {
MeasureOnSuccessCallback,
NativeMethodsMixinType,
} from 'ReactNativeTypes';
-import type {
- ReactNativeBaseComponentViewConfig,
-} from 'ReactNativeViewConfigRegistry';
+import type {ReactNativeBaseComponentViewConfig} from 'ReactNativeViewConfigRegistry';
const findNumericNodeHandle = ReactNativeFeatureFlags.useFiber
? require('findNumericNodeHandleFiber')
@@ -48,8 +46,11 @@ const findNumericNodeHandle = ReactNativeFeatureFlags.useFiber
*
* @abstract
*/
-class ReactNativeComponent
- extends React.Component {
+class ReactNativeComponent extends React.Component<
+ DefaultProps,
+ Props,
+ State,
+> {
static defaultProps: $Abstract;
props: Props;
state: $Abstract;
diff --git a/src/renderers/native/ReactNativeComponentEnvironment.js b/src/renderers/native/ReactNativeComponentEnvironment.js
index 0e1a3f58267..041b7bac5c6 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/native/ReactNativeFiberEntry.js b/src/renderers/native/ReactNativeFiberEntry.js
index 2c226e5f43e..7539c538a6a 100644
--- a/src/renderers/native/ReactNativeFiberEntry.js
+++ b/src/renderers/native/ReactNativeFiberEntry.js
@@ -117,9 +117,11 @@ if (__DEV__) {
if (typeof injectInternals === 'function') {
injectInternals({
- findFiberByHostInstance: ReactNativeComponentTree.getClosestInstanceFromNode,
+ findFiberByHostInstance:
+ ReactNativeComponentTree.getClosestInstanceFromNode,
findHostInstanceByFiber: ReactNativeFiberRenderer.findHostInstance,
- getInspectorDataForViewTag: ReactNativeFiberInspector.getInspectorDataForViewTag,
+ getInspectorDataForViewTag:
+ ReactNativeFiberInspector.getInspectorDataForViewTag,
// This is an enum because we may add more (e.g. profiler build)
bundleType: __DEV__ ? 1 : 0,
version: ReactVersion,
diff --git a/src/renderers/native/ReactNativeFiberHostComponent.js b/src/renderers/native/ReactNativeFiberHostComponent.js
index f6cfdce8b05..5054979f7ec 100644
--- a/src/renderers/native/ReactNativeFiberHostComponent.js
+++ b/src/renderers/native/ReactNativeFiberHostComponent.js
@@ -26,9 +26,7 @@ import type {
NativeMethodsMixinType,
} from 'ReactNativeTypes';
import type {Instance} from 'ReactNativeFiberRenderer';
-import type {
- ReactNativeBaseComponentViewConfig,
-} from 'ReactNativeViewConfigRegistry';
+import type {ReactNativeBaseComponentViewConfig} from 'ReactNativeViewConfigRegistry';
/**
* This component defines the same methods as NativeMethodsMixin but without the
diff --git a/src/renderers/native/ReactNativeFiberRenderer.js b/src/renderers/native/ReactNativeFiberRenderer.js
index ed9298b8d5a..68b7b115206 100644
--- a/src/renderers/native/ReactNativeFiberRenderer.js
+++ b/src/renderers/native/ReactNativeFiberRenderer.js
@@ -24,9 +24,7 @@ const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationI
const emptyObject = require('fbjs/lib/emptyObject');
const invariant = require('fbjs/lib/invariant');
-import type {
- ReactNativeBaseComponentViewConfig,
-} from 'ReactNativeViewConfigRegistry';
+import type {ReactNativeBaseComponentViewConfig} from 'ReactNativeViewConfigRegistry';
export type Container = number;
export type Instance = {
@@ -225,9 +223,9 @@ const NativeRenderer = ReactFiberReconciler({
// Either way we need to pass a copy of the Array to prevent it from being frozen.
const nativeTags = parentInstance._children.map(
child =>
- (typeof child === 'number'
+ typeof child === 'number'
? child // Leaf node (eg text)
- : child._nativeTag),
+ : child._nativeTag,
);
UIManager.setChildren(
diff --git a/src/renderers/native/ReactNativeStackEntry.js b/src/renderers/native/ReactNativeStackEntry.js
index f9a81d41c53..a3430165f96 100644
--- a/src/renderers/native/ReactNativeStackEntry.js
+++ b/src/renderers/native/ReactNativeStackEntry.js
@@ -48,7 +48,8 @@ var ReactNativeStack: ReactNativeType = {
unstable_batchedUpdates: ReactUpdates.batchedUpdates,
/* eslint-enable camelcase */
- unmountComponentAtNodeAndRemoveContainer: ReactNativeMount.unmountComponentAtNodeAndRemoveContainer,
+ unmountComponentAtNodeAndRemoveContainer:
+ ReactNativeMount.unmountComponentAtNodeAndRemoveContainer,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
// Used as a mixin in many createClass-based components
@@ -101,7 +102,8 @@ if (
},
Mount: ReactNativeMount,
Reconciler: require('ReactReconciler'),
- getInspectorDataForViewTag: ReactNativeStackInspector.getInspectorDataForViewTag,
+ getInspectorDataForViewTag:
+ ReactNativeStackInspector.getInspectorDataForViewTag,
});
}
diff --git a/src/renderers/native/createReactNativeComponentClassFiber.js b/src/renderers/native/createReactNativeComponentClassFiber.js
index c7787ded2fb..da154ec98d5 100644
--- a/src/renderers/native/createReactNativeComponentClassFiber.js
+++ b/src/renderers/native/createReactNativeComponentClassFiber.js
@@ -14,9 +14,7 @@
const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry');
-import type {
- ReactNativeBaseComponentViewConfig,
-} from './createReactNativeComponentClass';
+import type {ReactNativeBaseComponentViewConfig} from './createReactNativeComponentClass';
/**
* @param {string} config iOS View configuration.
diff --git a/src/renderers/native/createReactNativeComponentClassStack.js b/src/renderers/native/createReactNativeComponentClassStack.js
index 390a0227a5e..623e0126243 100644
--- a/src/renderers/native/createReactNativeComponentClassStack.js
+++ b/src/renderers/native/createReactNativeComponentClassStack.js
@@ -14,9 +14,7 @@
const ReactNativeBaseComponent = require('ReactNativeBaseComponent');
-import type {
- ReactNativeBaseComponentViewConfig,
-} from './createReactNativeComponentClass';
+import type {ReactNativeBaseComponentViewConfig} from './createReactNativeComponentClass';
/**
* @param {string} config iOS View configuration.
diff --git a/src/renderers/shared/ReactDebugTool.js b/src/renderers/shared/ReactDebugTool.js
index 9d4693420fb..800b3872bd9 100644
--- a/src/renderers/shared/ReactDebugTool.js
+++ b/src/renderers/shared/ReactDebugTool.js
@@ -122,9 +122,10 @@ if (__DEV__) {
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;
@@ -209,9 +210,10 @@ if (__DEV__) {
currentFlushMeasurements.push({
timerType,
instanceID: debugID,
- duration: performanceNow() -
- currentTimerStartTime -
- currentTimerNestedFlushDuration,
+ duration:
+ performanceNow() -
+ currentTimerStartTime -
+ currentTimerNestedFlushDuration,
});
}
currentTimerStartTime = 0;
diff --git a/src/renderers/shared/fiber/ReactChildFiber.js b/src/renderers/shared/fiber/ReactChildFiber.js
index 122757119a8..da2a6d4e33e 100644
--- a/src/renderers/shared/fiber/ReactChildFiber.js
+++ b/src/renderers/shared/fiber/ReactChildFiber.js
@@ -947,7 +947,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
for (
;
oldFiber !== null && !step.done;
- newIdx++, (step = newChildren.next())
+ newIdx++, step = newChildren.next()
) {
if (oldFiber.index > newIdx) {
nextOldFiber = oldFiber;
@@ -997,7 +997,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
if (oldFiber === null) {
// If we don't have any more existing children we can choose a fast path
// since the rest will all be insertions.
- for (; !step.done; newIdx++, (step = newChildren.next())) {
+ for (; !step.done; newIdx++, step = newChildren.next()) {
const newFiber = createChild(returnFiber, step.value, priority);
if (newFiber === null) {
continue;
@@ -1018,7 +1018,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
const existingChildren = mapRemainingChildren(returnFiber, oldFiber);
// Keep scanning and use the map to restore deleted items as moves.
- for (; !step.done; newIdx++, (step = newChildren.next())) {
+ for (; !step.done; newIdx++, step = newChildren.next()) {
const newFiber = updateFromMap(
existingChildren,
returnFiber,
diff --git a/src/renderers/shared/fiber/ReactFiberHydrationContext.js b/src/renderers/shared/fiber/ReactFiberHydrationContext.js
index 920934fb6b3..1b89570dad5 100644
--- a/src/renderers/shared/fiber/ReactFiberHydrationContext.js
+++ b/src/renderers/shared/fiber/ReactFiberHydrationContext.js
@@ -46,12 +46,14 @@ module.exports = function(
// If this doesn't have hydration mode.
if (
- !(canHydrateInstance &&
+ !(
+ canHydrateInstance &&
canHydrateTextInstance &&
getNextHydratableSibling &&
getFirstHydratableChild &&
hydrateInstance &&
- hydrateTextInstance)
+ hydrateTextInstance
+ )
) {
return {
enterHydrationState() {
diff --git a/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js b/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js
index a331ffcc443..28def3f44c5 100644
--- a/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js
+++ b/src/renderers/shared/fiber/__tests__/ReactCoroutine-test.js
@@ -63,9 +63,9 @@ describe('ReactCoroutine', () => {
function HandleYields(props, yields) {
ops.push('HandleYields');
- return yields.map((y, i) => (
-
- ));
+ return yields.map((y, i) =>
+ ,
+ );
}
// An alternative API could mark Parent as something that needs
@@ -122,9 +122,9 @@ describe('ReactCoroutine', () => {
}
function HandleYields(props, yields) {
- return yields.map((y, i) => (
-
- ));
+ return yields.map((y, i) =>
+ ,
+ );
}
function Parent(props) {
@@ -177,9 +177,9 @@ describe('ReactCoroutine', () => {
function HandleYields(props, yields) {
ops.push('HandleYields');
- return yields.map((ContinuationComponent, i) => (
-
- ));
+ return yields.map((ContinuationComponent, i) =>
+ ,
+ );
}
class Parent extends React.Component {
diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js
index c2b81d19d4f..7179e05999e 100644
--- a/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js
+++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js
@@ -455,9 +455,9 @@ describe('ReactDebugFiberPerf', () => {
}
function HandleYields(props, yields) {
- return yields.map((y, i) => (
-
- ));
+ return yields.map((y, i) =>
+ ,
+ );
}
function CoParent(props) {
diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalReflection-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalReflection-test.js
index 3181061fa89..ad856286c71 100644
--- a/src/renderers/shared/fiber/__tests__/ReactIncrementalReflection-test.js
+++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalReflection-test.js
@@ -153,12 +153,12 @@ describe('ReactIncrementalReflection', () => {
return this.props.step < 2
? (this.span = ref)} />
: this.props.step === 2
- ? (this.div = ref)} />
- : this.props.step === 3
- ? null
- : this.props.step === 4
- ?
(this.span = ref)} />
- : null;
+ ?
(this.div = ref)} />
+ : this.props.step === 3
+ ? null
+ : this.props.step === 4
+ ?
(this.span = ref)} />
+ : null;
}
}
diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
index 7e0605eceae..74d5f711d2d 100644
--- a/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
+++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
@@ -72,8 +72,8 @@ describe('ReactIncrementalSideEffects', () => {
{props.text === 'World'
? [
,
]
: props.text === 'Hi'
- ? [
,
]
- : null}
+ ? [
,
]
+ : null}
);
@@ -169,8 +169,8 @@ describe('ReactIncrementalSideEffects', () => {
{props.useClass
?
: props.useFunction
- ?
- : props.useText ? 'Text' : null}
+ ?
+ : props.useText ? 'Text' : null}
Trail
);
diff --git a/src/renderers/shared/shared/event/BrowserEventConstants.js b/src/renderers/shared/shared/event/BrowserEventConstants.js
index 0f460486be7..e2004e29236 100644
--- a/src/renderers/shared/shared/event/BrowserEventConstants.js
+++ b/src/renderers/shared/shared/event/BrowserEventConstants.js
@@ -23,10 +23,10 @@ var getVendorPrefixedEventName = require('getVendorPrefixedEventName');
var topLevelTypes = {
topAbort: 'abort',
topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
- topAnimationIteration: getVendorPrefixedEventName('animationiteration') ||
- 'animationiteration',
- topAnimationStart: getVendorPrefixedEventName('animationstart') ||
- 'animationstart',
+ topAnimationIteration:
+ getVendorPrefixedEventName('animationiteration') || 'animationiteration',
+ topAnimationStart:
+ getVendorPrefixedEventName('animationstart') || 'animationstart',
topBlur: 'blur',
topCancel: 'cancel',
topCanPlay: 'canplay',
@@ -87,8 +87,8 @@ var topLevelTypes = {
topTouchEnd: 'touchend',
topTouchMove: 'touchmove',
topTouchStart: 'touchstart',
- topTransitionEnd: getVendorPrefixedEventName('transitionend') ||
- 'transitionend',
+ topTransitionEnd:
+ getVendorPrefixedEventName('transitionend') || 'transitionend',
topVolumeChange: 'volumechange',
topWaiting: 'waiting',
topWheel: 'wheel',
diff --git a/src/renderers/shared/shared/event/eventPlugins/ResponderEventPlugin.js b/src/renderers/shared/shared/event/eventPlugins/ResponderEventPlugin.js
index 6fb3e4a6f0c..9ad88dd2e44 100644
--- a/src/renderers/shared/shared/event/eventPlugins/ResponderEventPlugin.js
+++ b/src/renderers/shared/shared/event/eventPlugins/ResponderEventPlugin.js
@@ -323,10 +323,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
@@ -520,8 +520,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/shared/event/eventPlugins/TouchHistoryMath.js b/src/renderers/shared/shared/event/eventPlugins/TouchHistoryMath.js
index 50006f7e728..a841e00af22 100644
--- a/src/renderers/shared/shared/event/eventPlugins/TouchHistoryMath.js
+++ b/src/renderers/shared/shared/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/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js b/src/renderers/shared/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js
index 4a83a8bb35c..e86c7f8b1e5 100644
--- a/src/renderers/shared/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js
+++ b/src/renderers/shared/shared/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 7d3a4c60323..b8010a6f768 100644
--- a/src/renderers/shared/stack/reconciler/ReactOwner.js
+++ b/src/renderers/shared/stack/reconciler/ReactOwner.js
@@ -26,9 +26,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/Transaction.js b/src/renderers/shared/stack/reconciler/Transaction.js
index ee45da1b78a..ffb649d783c 100644
--- a/src/renderers/shared/stack/reconciler/Transaction.js
+++ b/src/renderers/shared/stack/reconciler/Transaction.js
@@ -132,7 +132,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 {
invariant(
!this.isInTransaction(),
diff --git a/src/renderers/testing/__tests__/ReactTestRenderer-test.js b/src/renderers/testing/__tests__/ReactTestRenderer-test.js
index 740e353a361..f6327732c8d 100644
--- a/src/renderers/testing/__tests__/ReactTestRenderer-test.js
+++ b/src/renderers/testing/__tests__/ReactTestRenderer-test.js
@@ -571,12 +571,11 @@ describe('ReactTestRenderer', () => {
var Qoo = () =>
Hello World!;
// SFC returning host. passes through children.
- var Foo = ({className, children}) => (
+ var Foo = ({className, children}) =>
Literal
{children}
-
- );
+
;
// class composite returning composite. passes through children.
class Bar extends React.Component {