Skip to content

Commit cd347a7

Browse files
gkzfacebook-github-bot
authored andcommittedApr 9, 2020
Upgrade Prettier in Xplat to version 1.19.1
Summary: Upgrades Prettier in Xplat to 1.19.1 Ignores upgrading packages on already on versions greater than 1.19.1 Changelog: [Internal] allow-large-files bypass-lint (Note: this ignores all push blocking failures!) Reviewed By: gkz, cpojer Differential Revision: D20879147 fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d
1 parent cd13c99 commit cd347a7

File tree

35 files changed

+150
-171
lines changed

35 files changed

+150
-171
lines changed
 

‎IntegrationTests/AsyncStorageTest.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ function testMerge() {
152152
}
153153

154154
function testOptimizedMultiGet() {
155-
let batch = [[KEY_1, VAL_1], [KEY_2, VAL_2]];
155+
let batch = [
156+
[KEY_1, VAL_1],
157+
[KEY_2, VAL_2],
158+
];
156159
let keys = batch.map(([key, value]) => key);
157160
AsyncStorage.multiSet(batch, err1 => {
158161
// yes, twice on purpose

‎Libraries/Animated/src/NativeAnimatedHelper.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ function validateTransform(
235235
configs.forEach(config => {
236236
if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) {
237237
throw new Error(
238-
`Property '${
239-
config.property
240-
}' is not supported by native animated module`,
238+
`Property '${config.property}' is not supported by native animated module`,
241239
);
242240
}
243241
});

‎Libraries/Animated/src/__tests__/AnimatedNative-test.js

+50-10
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,19 @@ describe('Native Animated', () => {
357357
expect(additionConnectionCalls.length).toBe(2);
358358
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
359359
additionCall[1].input[0],
360-
{type: 'value', value: 1, offset: 0},
360+
{
361+
type: 'value',
362+
value: 1,
363+
offset: 0,
364+
},
361365
);
362366
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
363367
additionCall[1].input[1],
364-
{type: 'value', value: 2, offset: 0},
368+
{
369+
type: 'value',
370+
value: 2,
371+
offset: 0,
372+
},
365373
);
366374
});
367375

@@ -391,11 +399,19 @@ describe('Native Animated', () => {
391399
expect(subtractionConnectionCalls.length).toBe(2);
392400
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
393401
subtractionCall[1].input[0],
394-
{type: 'value', value: 2, offset: 0},
402+
{
403+
type: 'value',
404+
value: 2,
405+
offset: 0,
406+
},
395407
);
396408
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
397409
subtractionCall[1].input[1],
398-
{type: 'value', value: 1, offset: 0},
410+
{
411+
type: 'value',
412+
value: 1,
413+
offset: 0,
414+
},
399415
);
400416
});
401417

@@ -425,11 +441,19 @@ describe('Native Animated', () => {
425441
expect(multiplicationConnectionCalls.length).toBe(2);
426442
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
427443
multiplicationCall[1].input[0],
428-
{type: 'value', value: 2, offset: 0},
444+
{
445+
type: 'value',
446+
value: 2,
447+
offset: 0,
448+
},
429449
);
430450
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
431451
multiplicationCall[1].input[1],
432-
{type: 'value', value: 1, offset: 0},
452+
{
453+
type: 'value',
454+
value: 1,
455+
offset: 0,
456+
},
433457
);
434458
});
435459

@@ -459,11 +483,19 @@ describe('Native Animated', () => {
459483
expect(divisionConnectionCalls.length).toBe(2);
460484
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
461485
divisionCall[1].input[0],
462-
{type: 'value', value: 4, offset: 0},
486+
{
487+
type: 'value',
488+
value: 4,
489+
offset: 0,
490+
},
463491
);
464492
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
465493
divisionCall[1].input[1],
466-
{type: 'value', value: 2, offset: 0},
494+
{
495+
type: 'value',
496+
value: 2,
497+
offset: 0,
498+
},
467499
);
468500
});
469501

@@ -491,7 +523,11 @@ describe('Native Animated', () => {
491523
expect(moduloConnectionCalls.length).toBe(1);
492524
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
493525
moduloCall[1].input,
494-
{type: 'value', value: 4, offset: 0},
526+
{
527+
type: 'value',
528+
value: 4,
529+
offset: 0,
530+
},
495531
);
496532
});
497533

@@ -588,7 +624,11 @@ describe('Native Animated', () => {
588624
expect(diffClampConnectionCalls.length).toBe(1);
589625
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
590626
diffClampCall[1].input,
591-
{type: 'value', value: 2, offset: 0},
627+
{
628+
type: 'value',
629+
value: 2,
630+
offset: 0,
631+
},
592632
);
593633
});
594634

‎Libraries/BatchedBridge/__tests__/MessageQueue-test.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,25 @@ describe('MessageQueue', function() {
8181
});
8282

8383
it('should throw when calling the same callback twice', () => {
84-
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
84+
queue.enqueueNativeCall(
85+
0,
86+
1,
87+
[],
88+
() => {},
89+
() => {},
90+
);
8591
queue.__invokeCallback(1, []);
8692
expect(() => queue.__invokeCallback(1, [])).toThrow();
8793
});
8894

8995
it('should throw when calling both success and failure callback', () => {
90-
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
96+
queue.enqueueNativeCall(
97+
0,
98+
1,
99+
[],
100+
() => {},
101+
() => {},
102+
);
91103
queue.__invokeCallback(1, []);
92104
expect(() => queue.__invokeCallback(0, [])).toThrow();
93105
});

‎Libraries/Blob/URL.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ export class URL {
119119
if (BLOB_URL_PREFIX === null) {
120120
throw new Error('Cannot create URL for blob!');
121121
}
122-
return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${
123-
blob.data.offset
124-
}&size=${blob.size}`;
122+
return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${blob.data.offset}&size=${blob.size}`;
125123
}
126124

127125
static revokeObjectURL(url: string) {

‎Libraries/Components/ActivityIndicator/ActivityIndicator.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ const ActivityIndicator = (props: Props, forwardedRef?: any) => {
101101
return (
102102
<View
103103
onLayout={onLayout}
104-
style={StyleSheet.compose(
105-
styles.container,
106-
style,
107-
)}>
104+
style={StyleSheet.compose(styles.container, style)}>
108105
{Platform.OS === 'android' ? (
109106
// $FlowFixMe Flow doesn't know when this is the android component
110107
<PlatformActivityIndicator {...nativeProps} {...androidProps} />

‎Libraries/Components/Keyboard/KeyboardAvoidingView.js

+5-14
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
170170
return (
171171
<View
172172
ref={this.viewRef}
173-
style={StyleSheet.compose(
174-
style,
175-
heightStyle,
176-
)}
173+
style={StyleSheet.compose(style, heightStyle)}
177174
onLayout={this._onLayout}
178175
{...props}>
179176
{children}
@@ -188,12 +185,9 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
188185
onLayout={this._onLayout}
189186
{...props}>
190187
<View
191-
style={StyleSheet.compose(
192-
contentContainerStyle,
193-
{
194-
bottom: bottomHeight,
195-
},
196-
)}>
188+
style={StyleSheet.compose(contentContainerStyle, {
189+
bottom: bottomHeight,
190+
})}>
197191
{children}
198192
</View>
199193
</View>
@@ -203,10 +197,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
203197
return (
204198
<View
205199
ref={this.viewRef}
206-
style={StyleSheet.compose(
207-
style,
208-
{paddingBottom: bottomHeight},
209-
)}
200+
style={StyleSheet.compose(style, {paddingBottom: bottomHeight})}
210201
onLayout={this._onLayout}
211202
{...props}>
212203
{children}

‎Libraries/Components/Picker/PickerAndroid.android.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@ function PickerAndroid(props: Props): React.Node {
121121
prompt: props.prompt,
122122
ref: pickerRef,
123123
selected,
124-
style: StyleSheet.compose(
125-
styles.pickerAndroid,
126-
props.style,
127-
),
124+
style: StyleSheet.compose(styles.pickerAndroid, props.style),
128125
backgroundColor: props.backgroundColor,
129126
testID: props.testID,
130127
};

‎Libraries/Components/Slider/Slider.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ const Slider = (
198198
props: Props,
199199
forwardedRef?: ?React.Ref<typeof SliderNativeComponent>,
200200
) => {
201-
const style = StyleSheet.compose(
202-
styles.slider,
203-
props.style,
204-
);
201+
const style = StyleSheet.compose(styles.slider, props.style);
205202

206203
const {
207204
disabled = false,

‎Libraries/Components/StatusBar/StatusBar.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,7 @@ class StatusBar extends React.Component<Props> {
467467
const processedColor = processColor(mergedProps.backgroundColor.value);
468468
if (processedColor == null) {
469469
console.warn(
470-
`\`StatusBar._updatePropsStack\`: Color ${
471-
mergedProps.backgroundColor.value
472-
} parsed to null or undefined`,
470+
`\`StatusBar._updatePropsStack\`: Color ${mergedProps.backgroundColor.value} parsed to null or undefined`,
473471
);
474472
} else {
475473
invariant(

‎Libraries/Interaction/TaskQueue.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ class TaskQueue {
172172
this.hasTasksToProcess() && this._onMoreTasks();
173173
})
174174
.catch(ex => {
175-
ex.message = `TaskQueue: Error resolving Promise in task ${
176-
task.name
177-
}: ${ex.message}`;
175+
ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`;
178176
throw ex;
179177
})
180178
.done();

‎Libraries/Lists/FlatList.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
593593
'Expected array of items with numColumns > 1',
594594
);
595595
return (
596-
<View
597-
style={StyleSheet.compose(
598-
styles.row,
599-
columnWrapperStyle,
600-
)}>
596+
<View style={StyleSheet.compose(styles.row, columnWrapperStyle)}>
601597
{item.map((it, kk) => {
602598
const element = renderer({
603599
item: it,

‎Libraries/Lists/VirtualizedList.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1117,10 +1117,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
11171117
element.props.onLayout(event);
11181118
}
11191119
},
1120-
style: StyleSheet.compose(
1121-
inversionStyle,
1122-
element.props.style,
1123-
),
1120+
style: StyleSheet.compose(inversionStyle, element.props.style),
11241121
}),
11251122
);
11261123
}

‎Libraries/Lists/__tests__/ViewabilityHelper-test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,10 @@ describe('onUpdate', function() {
429429

430430
expect(onViewableItemsChanged.mock.calls.length).toBe(2);
431431
expect(onViewableItemsChanged.mock.calls[1][0]).toEqual({
432-
changed: [{isViewable: true, key: 'c'}, {isViewable: false, key: 'a'}],
432+
changed: [
433+
{isViewable: true, key: 'c'},
434+
{isViewable: false, key: 'a'},
435+
],
433436
viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},
434437
viewableItems: [{isViewable: true, key: 'c'}],
435438
});

‎Libraries/LogBox/Data/__tests__/LogBoxLog-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jest.mock('../LogBoxSymbolication', () => {
1919
});
2020

2121
function getLogBoxLog() {
22-
return new (require('../LogBoxLog')).default({
22+
return new (require('../LogBoxLog').default)({
2323
level: 'warn',
2424
isComponentError: false,
2525
message: {content: '...', substitutions: []},

‎Libraries/Modal/Modal.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ class Modal extends React.Component<Props> {
190190
props.transparent
191191
) {
192192
console.warn(
193-
`Modal with '${
194-
props.presentationStyle
195-
}' presentation style and 'transparent' value is not supported.`,
193+
`Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`,
196194
);
197195
}
198196
}

‎Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js

+8-32
Original file line numberDiff line numberDiff line change
@@ -18,53 +18,29 @@ const textStyle = {color: 'rgb(0, 0, 0)'};
1818

1919
module.exports = {
2020
testGoodCompose() {
21-
(StyleSheet.compose(
22-
imageStyle,
23-
imageStyle,
24-
): ImageStyleProp);
21+
(StyleSheet.compose(imageStyle, imageStyle): ImageStyleProp);
2522

26-
(StyleSheet.compose(
27-
textStyle,
28-
textStyle,
29-
): TextStyleProp);
23+
(StyleSheet.compose(textStyle, textStyle): TextStyleProp);
3024

31-
(StyleSheet.compose(
32-
null,
33-
null,
34-
): TextStyleProp);
25+
(StyleSheet.compose(null, null): TextStyleProp);
3526

36-
(StyleSheet.compose(
37-
textStyle,
38-
null,
39-
): TextStyleProp);
27+
(StyleSheet.compose(textStyle, null): TextStyleProp);
4028

4129
(StyleSheet.compose(
4230
textStyle,
4331
Math.random() < 0.5 ? textStyle : null,
4432
): TextStyleProp);
4533

46-
(StyleSheet.compose(
47-
[textStyle],
48-
null,
49-
): TextStyleProp);
34+
(StyleSheet.compose([textStyle], null): TextStyleProp);
5035

51-
(StyleSheet.compose(
52-
[textStyle],
53-
null,
54-
): TextStyleProp);
36+
(StyleSheet.compose([textStyle], null): TextStyleProp);
5537

56-
(StyleSheet.compose(
57-
[textStyle],
58-
[textStyle],
59-
): TextStyleProp);
38+
(StyleSheet.compose([textStyle], [textStyle]): TextStyleProp);
6039
},
6140

6241
testBadCompose() {
6342
// $FlowExpectedError - Incompatible type.
64-
(StyleSheet.compose(
65-
textStyle,
66-
textStyle,
67-
): ImageStyleProp);
43+
(StyleSheet.compose(textStyle, textStyle): ImageStyleProp);
6844

6945
// $FlowExpectedError - Incompatible type.
7046
(StyleSheet.compose(

0 commit comments

Comments
 (0)
Please sign in to comment.