Skip to content

Commit

Permalink
Upgrade Prettier in Xplat to version 1.19.1
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gkz authored and facebook-github-bot committed Apr 9, 2020
1 parent cd13c99 commit cd347a7
Show file tree
Hide file tree
Showing 35 changed files with 150 additions and 171 deletions.
5 changes: 4 additions & 1 deletion IntegrationTests/AsyncStorageTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ function testMerge() {
}

function testOptimizedMultiGet() {
let batch = [[KEY_1, VAL_1], [KEY_2, VAL_2]];
let batch = [
[KEY_1, VAL_1],
[KEY_2, VAL_2],
];
let keys = batch.map(([key, value]) => key);
AsyncStorage.multiSet(batch, err1 => {
// yes, twice on purpose
Expand Down
4 changes: 1 addition & 3 deletions Libraries/Animated/src/NativeAnimatedHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ function validateTransform(
configs.forEach(config => {
if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) {
throw new Error(
`Property '${
config.property
}' is not supported by native animated module`,
`Property '${config.property}' is not supported by native animated module`,
);
}
});
Expand Down
60 changes: 50 additions & 10 deletions Libraries/Animated/src/__tests__/AnimatedNative-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,19 @@ describe('Native Animated', () => {
expect(additionConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
additionCall[1].input[0],
{type: 'value', value: 1, offset: 0},
{
type: 'value',
value: 1,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
additionCall[1].input[1],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
});

Expand Down Expand Up @@ -391,11 +399,19 @@ describe('Native Animated', () => {
expect(subtractionConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
subtractionCall[1].input[0],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
subtractionCall[1].input[1],
{type: 'value', value: 1, offset: 0},
{
type: 'value',
value: 1,
offset: 0,
},
);
});

Expand Down Expand Up @@ -425,11 +441,19 @@ describe('Native Animated', () => {
expect(multiplicationConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
multiplicationCall[1].input[0],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
multiplicationCall[1].input[1],
{type: 'value', value: 1, offset: 0},
{
type: 'value',
value: 1,
offset: 0,
},
);
});

Expand Down Expand Up @@ -459,11 +483,19 @@ describe('Native Animated', () => {
expect(divisionConnectionCalls.length).toBe(2);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
divisionCall[1].input[0],
{type: 'value', value: 4, offset: 0},
{
type: 'value',
value: 4,
offset: 0,
},
);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
divisionCall[1].input[1],
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
});

Expand Down Expand Up @@ -491,7 +523,11 @@ describe('Native Animated', () => {
expect(moduloConnectionCalls.length).toBe(1);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
moduloCall[1].input,
{type: 'value', value: 4, offset: 0},
{
type: 'value',
value: 4,
offset: 0,
},
);
});

Expand Down Expand Up @@ -588,7 +624,11 @@ describe('Native Animated', () => {
expect(diffClampConnectionCalls.length).toBe(1);
expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith(
diffClampCall[1].input,
{type: 'value', value: 2, offset: 0},
{
type: 'value',
value: 2,
offset: 0,
},
);
});

Expand Down
16 changes: 14 additions & 2 deletions Libraries/BatchedBridge/__tests__/MessageQueue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,25 @@ describe('MessageQueue', function() {
});

it('should throw when calling the same callback twice', () => {
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
queue.enqueueNativeCall(
0,
1,
[],
() => {},
() => {},
);
queue.__invokeCallback(1, []);
expect(() => queue.__invokeCallback(1, [])).toThrow();
});

it('should throw when calling both success and failure callback', () => {
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
queue.enqueueNativeCall(
0,
1,
[],
() => {},
() => {},
);
queue.__invokeCallback(1, []);
expect(() => queue.__invokeCallback(0, [])).toThrow();
});
Expand Down
4 changes: 1 addition & 3 deletions Libraries/Blob/URL.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ export class URL {
if (BLOB_URL_PREFIX === null) {
throw new Error('Cannot create URL for blob!');
}
return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${
blob.data.offset
}&size=${blob.size}`;
return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${blob.data.offset}&size=${blob.size}`;
}

static revokeObjectURL(url: string) {
Expand Down
5 changes: 1 addition & 4 deletions Libraries/Components/ActivityIndicator/ActivityIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ const ActivityIndicator = (props: Props, forwardedRef?: any) => {
return (
<View
onLayout={onLayout}
style={StyleSheet.compose(
styles.container,
style,
)}>
style={StyleSheet.compose(styles.container, style)}>
{Platform.OS === 'android' ? (
// $FlowFixMe Flow doesn't know when this is the android component
<PlatformActivityIndicator {...nativeProps} {...androidProps} />
Expand Down
19 changes: 5 additions & 14 deletions Libraries/Components/Keyboard/KeyboardAvoidingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
return (
<View
ref={this.viewRef}
style={StyleSheet.compose(
style,
heightStyle,
)}
style={StyleSheet.compose(style, heightStyle)}
onLayout={this._onLayout}
{...props}>
{children}
Expand All @@ -188,12 +185,9 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
onLayout={this._onLayout}
{...props}>
<View
style={StyleSheet.compose(
contentContainerStyle,
{
bottom: bottomHeight,
},
)}>
style={StyleSheet.compose(contentContainerStyle, {
bottom: bottomHeight,
})}>
{children}
</View>
</View>
Expand All @@ -203,10 +197,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
return (
<View
ref={this.viewRef}
style={StyleSheet.compose(
style,
{paddingBottom: bottomHeight},
)}
style={StyleSheet.compose(style, {paddingBottom: bottomHeight})}
onLayout={this._onLayout}
{...props}>
{children}
Expand Down
5 changes: 1 addition & 4 deletions Libraries/Components/Picker/PickerAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ function PickerAndroid(props: Props): React.Node {
prompt: props.prompt,
ref: pickerRef,
selected,
style: StyleSheet.compose(
styles.pickerAndroid,
props.style,
),
style: StyleSheet.compose(styles.pickerAndroid, props.style),
backgroundColor: props.backgroundColor,
testID: props.testID,
};
Expand Down
5 changes: 1 addition & 4 deletions Libraries/Components/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ const Slider = (
props: Props,
forwardedRef?: ?React.Ref<typeof SliderNativeComponent>,
) => {
const style = StyleSheet.compose(
styles.slider,
props.style,
);
const style = StyleSheet.compose(styles.slider, props.style);

const {
disabled = false,
Expand Down
4 changes: 1 addition & 3 deletions Libraries/Components/StatusBar/StatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,7 @@ class StatusBar extends React.Component<Props> {
const processedColor = processColor(mergedProps.backgroundColor.value);
if (processedColor == null) {
console.warn(
`\`StatusBar._updatePropsStack\`: Color ${
mergedProps.backgroundColor.value
} parsed to null or undefined`,
`\`StatusBar._updatePropsStack\`: Color ${mergedProps.backgroundColor.value} parsed to null or undefined`,
);
} else {
invariant(
Expand Down
4 changes: 1 addition & 3 deletions Libraries/Interaction/TaskQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ class TaskQueue {
this.hasTasksToProcess() && this._onMoreTasks();
})
.catch(ex => {
ex.message = `TaskQueue: Error resolving Promise in task ${
task.name
}: ${ex.message}`;
ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`;
throw ex;
})
.done();
Expand Down
6 changes: 1 addition & 5 deletions Libraries/Lists/FlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
'Expected array of items with numColumns > 1',
);
return (
<View
style={StyleSheet.compose(
styles.row,
columnWrapperStyle,
)}>
<View style={StyleSheet.compose(styles.row, columnWrapperStyle)}>
{item.map((it, kk) => {
const element = renderer({
item: it,
Expand Down
5 changes: 1 addition & 4 deletions Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -1117,10 +1117,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
element.props.onLayout(event);
}
},
style: StyleSheet.compose(
inversionStyle,
element.props.style,
),
style: StyleSheet.compose(inversionStyle, element.props.style),
}),
);
}
Expand Down
5 changes: 4 additions & 1 deletion Libraries/Lists/__tests__/ViewabilityHelper-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,10 @@ describe('onUpdate', function() {

expect(onViewableItemsChanged.mock.calls.length).toBe(2);
expect(onViewableItemsChanged.mock.calls[1][0]).toEqual({
changed: [{isViewable: true, key: 'c'}, {isViewable: false, key: 'a'}],
changed: [
{isViewable: true, key: 'c'},
{isViewable: false, key: 'a'},
],
viewabilityConfig: {viewAreaCoveragePercentThreshold: 0},
viewableItems: [{isViewable: true, key: 'c'}],
});
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LogBox/Data/__tests__/LogBoxLog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jest.mock('../LogBoxSymbolication', () => {
});

function getLogBoxLog() {
return new (require('../LogBoxLog')).default({
return new (require('../LogBoxLog').default)({
level: 'warn',
isComponentError: false,
message: {content: '...', substitutions: []},
Expand Down
4 changes: 1 addition & 3 deletions Libraries/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ class Modal extends React.Component<Props> {
props.transparent
) {
console.warn(
`Modal with '${
props.presentationStyle
}' presentation style and 'transparent' value is not supported.`,
`Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`,
);
}
}
Expand Down
40 changes: 8 additions & 32 deletions Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,29 @@ const textStyle = {color: 'rgb(0, 0, 0)'};

module.exports = {
testGoodCompose() {
(StyleSheet.compose(
imageStyle,
imageStyle,
): ImageStyleProp);
(StyleSheet.compose(imageStyle, imageStyle): ImageStyleProp);

(StyleSheet.compose(
textStyle,
textStyle,
): TextStyleProp);
(StyleSheet.compose(textStyle, textStyle): TextStyleProp);

(StyleSheet.compose(
null,
null,
): TextStyleProp);
(StyleSheet.compose(null, null): TextStyleProp);

(StyleSheet.compose(
textStyle,
null,
): TextStyleProp);
(StyleSheet.compose(textStyle, null): TextStyleProp);

(StyleSheet.compose(
textStyle,
Math.random() < 0.5 ? textStyle : null,
): TextStyleProp);

(StyleSheet.compose(
[textStyle],
null,
): TextStyleProp);
(StyleSheet.compose([textStyle], null): TextStyleProp);

(StyleSheet.compose(
[textStyle],
null,
): TextStyleProp);
(StyleSheet.compose([textStyle], null): TextStyleProp);

(StyleSheet.compose(
[textStyle],
[textStyle],
): TextStyleProp);
(StyleSheet.compose([textStyle], [textStyle]): TextStyleProp);
},

testBadCompose() {
// $FlowExpectedError - Incompatible type.
(StyleSheet.compose(
textStyle,
textStyle,
): ImageStyleProp);
(StyleSheet.compose(textStyle, textStyle): ImageStyleProp);

// $FlowExpectedError - Incompatible type.
(StyleSheet.compose(
Expand Down
Loading

0 comments on commit cd347a7

Please sign in to comment.