Upgrade Prettier from 1.17 to 2.0.2.

Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
This commit is contained in:
Michael Bolin
2020-03-24 20:24:47 -07:00
committed by Facebook GitHub Bot
parent 79c69bea02
commit cf44650b3f
383 changed files with 2051 additions and 2072 deletions
@@ -40,17 +40,17 @@ class SampleTurboModuleExample extends React.Component<{||}, State> {
// Add calls to methods in TurboModule here
_tests = {
callback: () =>
NativeSampleTurboModule.getValueWithCallback(callbackValue =>
NativeSampleTurboModule.getValueWithCallback((callbackValue) =>
this._setResult('callback', callbackValue),
),
promise: () =>
NativeSampleTurboModule.getValueWithPromise(false).then(valuePromise =>
NativeSampleTurboModule.getValueWithPromise(false).then((valuePromise) =>
this._setResult('promise', valuePromise),
),
rejectPromise: () =>
NativeSampleTurboModule.getValueWithPromise(true)
.then(() => {})
.catch(e => this._setResult('rejectPromise', e.message)),
.catch((e) => this._setResult('rejectPromise', e.message)),
getConstants: () => NativeSampleTurboModule.getConstants(),
voidFunc: () => NativeSampleTurboModule.voidFunc(),
getBool: () => NativeSampleTurboModule.getBool(true),
@@ -101,7 +101,7 @@ class SampleTurboModuleExample extends React.Component<{||}, State> {
}
if (Platform.OS === 'ios') {
// iOS is fully implemented, so show all results immediately.
Object.keys(this._tests).forEach(item =>
Object.keys(this._tests).forEach((item) =>
this._setResult(item, this._tests[item]()),
);
}
@@ -114,7 +114,7 @@ class SampleTurboModuleExample extends React.Component<{||}, State> {
<TouchableOpacity
style={[styles.column, styles.button]}
onPress={() =>
Object.keys(this._tests).forEach(item =>
Object.keys(this._tests).forEach((item) =>
this._setResult(item, this._tests[item]()),
)
}>
@@ -128,12 +128,12 @@ class SampleTurboModuleExample extends React.Component<{||}, State> {
</View>
<FlatList
data={Object.keys(this._tests)}
keyExtractor={item => item}
keyExtractor={(item) => item}
renderItem={({item}) => (
<View style={styles.item}>
<TouchableOpacity
style={[styles.column, styles.button]}
onPress={e => this._setResult(item, this._tests[item]())}>
onPress={(e) => this._setResult(item, this._tests[item]())}>
<Text style={styles.buttonText}>{item}</Text>
</TouchableOpacity>
<View style={[styles.column]}>{this._renderResult(item)}</View>