Prettify remaining unprettified files (#21327)

Summary:
This PR is the result of running `yarn prettify` on the codebase - which caught a few files that were not prettified. This will make instructing people to run prettify a bit less complicated, since unrelated files will not show up in diffs.
Pull Request resolved: https://github.com/facebook/react-native/pull/21327

Differential Revision: D10046057

Pulled By: TheSavior

fbshipit-source-id: 2c771a3c758c72816c707e32ee2f4587e466f277
This commit is contained in:
empyrical 2018-09-25 19:37:32 -07:00 committed by Facebook Github Bot
parent ae1817fdb9
commit 2da60a8f45
9 changed files with 418 additions and 383 deletions

View File

@ -218,9 +218,9 @@ type IOSProps = $ReadOnly<{|
*/
scrollsToTop?: ?boolean,
/**
* Fires when the scroll view scrolls to top after the status bar has been tapped
* @platform ios
*/
* Fires when the scroll view scrolls to top after the status bar has been tapped
* @platform ios
*/
onScrollToTop?: ?Function,
/**
* When true, shows a horizontal scroll indicator.

View File

@ -949,8 +949,7 @@ const TextInput = createReactClass({
<Text
style={props.style}
allowFontScaling={props.allowFontScaling}
maxFontSizeMultiplier={props.maxFontSizeMultiplier}
>
maxFontSizeMultiplier={props.maxFontSizeMultiplier}>
{children}
</Text>
);

View File

@ -45,7 +45,9 @@ function prefetch(url: string) {
return ImageViewManager.prefetchImage(url);
}
async function queryCache(urls: Array<string>): Promise<Map<string, 'memory' | 'disk'>> {
async function queryCache(
urls: Array<string>,
): Promise<Map<string, 'memory' | 'disk'>> {
return await ImageViewManager.queryCache(urls);
}

View File

@ -77,11 +77,12 @@ var NetworkImageCallbackExample = createReactClass({
this._loadEventFired(
`✔ Prefetch OK (+${new Date() - mountTime}ms)`,
);
Image.queryCache([IMAGE_PREFETCH_URL]).then((map) => {
Image.queryCache([IMAGE_PREFETCH_URL]).then(map => {
var result = map.get(IMAGE_PREFETCH_URL);
if (result) {
this._loadEventFired(
`✔ queryCache "${result}" (+${new Date() - mountTime}ms)`,
`✔ queryCache "${result}" (+${new Date() -
mountTime}ms)`,
);
} else {
this._loadEventFired(
@ -460,23 +461,31 @@ exports.examples = [
source={fullImage}
/>
<Image
style={[styles.base, styles.leftMargin, {
borderWidth: 10,
borderTopLeftRadius: 10,
borderBottomRightRadius: 20,
borderColor: 'green',
}]}
style={[
styles.base,
styles.leftMargin,
{
borderWidth: 10,
borderTopLeftRadius: 10,
borderBottomRightRadius: 20,
borderColor: 'green',
},
]}
source={fullImage}
/>
<Image
style={[styles.base, styles.leftMargin, {
borderWidth: 5,
borderTopLeftRadius: 10,
borderTopRightRadius: 20,
borderBottomRightRadius: 30,
borderBottomLeftRadius: 40,
borderColor: 'red',
}]}
style={[
styles.base,
styles.leftMargin,
{
borderWidth: 5,
borderTopLeftRadius: 10,
borderTopRightRadius: 20,
borderBottomRightRadius: 30,
borderBottomLeftRadius: 40,
borderColor: 'red',
},
]}
source={fullImage}
/>
</View>

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,8 @@ describe('getAssetDestPathAndroid', () => {
httpServerLocation: '/assets/app/test',
};
expect(getAssetDestPathAndroid(asset, 1)).toBe(path.normalize('raw/app_test_video.mp4'));
expect(getAssetDestPathAndroid(asset, 1)).toBe(
path.normalize('raw/app_test_video.mp4'),
);
});
});

View File

@ -23,7 +23,9 @@ describe('getAssetDestPathIOS', () => {
httpServerLocation: '/assets/test',
};
expect(getAssetDestPathIOS(asset, 1)).toBe(path.normalize('assets/test/icon.png'));
expect(getAssetDestPathIOS(asset, 1)).toBe(
path.normalize('assets/test/icon.png'),
);
});
it('should consider scale', () => {
@ -33,7 +35,11 @@ describe('getAssetDestPathIOS', () => {
httpServerLocation: '/assets/test',
};
expect(getAssetDestPathIOS(asset, 2)).toBe(path.normalize('assets/test/icon@2x.png'));
expect(getAssetDestPathIOS(asset, 3)).toBe(path.normalize('assets/test/icon@3x.png'));
expect(getAssetDestPathIOS(asset, 2)).toBe(
path.normalize('assets/test/icon@2x.png'),
);
expect(getAssetDestPathIOS(asset, 3)).toBe(
path.normalize('assets/test/icon@3x.png'),
);
});
});

View File

@ -98,7 +98,11 @@ function createFromRemoteTemplate(
// only for publishing the template to npm.
// We want to ignore this dummy file, otherwise it would overwrite
// our project's package.json file.
ignorePaths: ['package.json', 'dependencies.json','devDependencies.json'],
ignorePaths: [
'package.json',
'dependencies.json',
'devDependencies.json',
],
});
installTemplateDependencies(templatePath, yarnVersion);
installTemplateDevDependencies(templatePath, yarnVersion);

View File

@ -9,9 +9,7 @@
'use strict';
const {
createProjectFromTemplate,
} = require('../generator/templates');
const {createProjectFromTemplate} = require('../generator/templates');
const execSync = require('child_process').execSync;
const fs = require('fs');
const minimist = require('minimist');