Skip to content

Commit 1b3c31f

Browse files
committed
Run prettier across codebase
Close #1444
1 parent d4b9f35 commit 1b3c31f

File tree

10 files changed

+31
-13
lines changed

10 files changed

+31
-13
lines changed

packages/benchmarks/src/cases/SierpinskiTriangle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SierpinskiTriangle extends React.Component {
4545
}
4646

4747
// introduce randomness to ensure that repeated runs don't produce the same colors
48-
const color = fn(renderCount * Math.random() / 20);
48+
const color = fn((renderCount * Math.random()) / 20);
4949
return (
5050
<Dot color={color} size={targetSize} x={x - targetSize / 2} y={y - targetSize / 2} />
5151
);

packages/benchmarks/src/cases/Tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Tree extends Component {
2121

2222
let result = (
2323
<Box color={id % 3} layout={depth % 2 === 0 ? 'column' : 'row'} outer>
24-
{depth === 0 && <Box color={id % 3 + 3} fixed />}
24+
{depth === 0 && <Box color={(id % 3) + 3} fixed />}
2525
{depth !== 0 &&
2626
Array.from({ length: breadth }).map((el, i) => (
2727
<Tree

packages/benchmarks/src/implementations/inline-styles/View.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ const compose = (s1, s2) => {
1212
class View extends React.Component {
1313
render() {
1414
const { style, ...other } = this.props;
15-
return <div {...other} style={compose(viewStyle, style)} />;
15+
return (
16+
<div
17+
{...other}
18+
style={compose(
19+
viewStyle,
20+
style
21+
)}
22+
/>
23+
);
1624
}
1725
}
1826

packages/website/storybook/1-components/ActivityIndicator/examples/PropSize.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const sizes = [20, 'small', 36, 'large', 60];
99

1010
const ActivityIndicatorSizeExample = () => (
1111
<View style={styles.horizontal}>
12-
{sizes.map((size, i) => <ActivityIndicator key={i} size={size} style={styles.rightPadding} />)}
12+
{sizes.map((size, i) => (
13+
<ActivityIndicator key={i} size={size} style={styles.rightPadding} />
14+
))}
1315
<ActivityIndicator size="large" style={styles.large} />
1416
</View>
1517
);

packages/website/storybook/1-components/Switch/SwitchScreen.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,21 @@ const SwitchScreen = () => (
105105
/>
106106

107107
<DocItem
108-
description="(For compatibility with React Native. Equivalent to &quot;activeTrackColor&quot;)"
108+
description='(For compatibility with React Native. Equivalent to "activeTrackColor")'
109109
label="compat"
110110
name="onTintColor"
111111
typeInfo="?color"
112112
/>
113113

114114
<DocItem
115-
description="(For compatibility with React Native. Equivalent to &quot;trackColor&quot;)"
115+
description='(For compatibility with React Native. Equivalent to "trackColor")'
116116
label="compat"
117117
name="tintColor"
118118
typeInfo="?color"
119119
/>
120120

121121
<DocItem
122-
description="(For compatibility with React Native. Equivalent to &quot;thumbColor&quot;)"
122+
description='(For compatibility with React Native. Equivalent to "thumbColor")'
123123
label="compat"
124124
name="thumbTintColor"
125125
typeInfo="?color"

packages/website/storybook/1-components/Text/examples/PropChildren.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ const TextChildrenExample = () => (
2828
(Normal text,
2929
<Text style={{ fontWeight: 'bold' }}>
3030
(and bold
31-
<Text style={{ fontSize: 11, color: '#527fe4' }}>(and tiny inherited bold blue)</Text>
32-
)
31+
<Text style={{ fontSize: 11, color: '#527fe4' }}>(and tiny inherited bold blue)</Text>)
3332
</Text>
3433
)
3534
</Text>

packages/website/storybook/1-components/Touchable/examples/DelayEvents.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export default class TouchableDelayEvents extends PureComponent {
5151
</Touchable>
5252
</View>
5353
<View style={styles.eventLogBox}>
54-
{this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}
54+
{this.state.eventLog.map((e, ii) => (
55+
<Text key={ii}>{e}</Text>
56+
))}
5557
</View>
5658
</View>
5759
);

packages/website/storybook/1-components/Touchable/examples/FeedbackEvents.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export default class TouchableFeedbackEvents extends PureComponent {
4747
</Touchable>
4848
</View>
4949
<View style={styles.eventLogBox}>
50-
{this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}
50+
{this.state.eventLog.map((e, ii) => (
51+
<Text key={ii}>{e}</Text>
52+
))}
5153
</View>
5254
</View>
5355
);

packages/website/storybook/2-apis/AppState/AppStateScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const AppStateScreen = () => (
3434

3535
<DocItem
3636
name="static currentState"
37-
description="Returns the current state of the app: &quot;active&quot; or &quot;background&quot;."
37+
description='Returns the current state of the app: "active" or "background".'
3838
/>
3939
</Section>
4040

packages/website/storybook/ui-explorer/UIExplorer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ const Title = ({ children }) => (
1818

1919
export const Description = ({ children }) => (
2020
<AppText style={styles.description}>
21-
{insertBetween(() => <Divider key={Math.random()} />, React.Children.toArray(children))}
21+
{insertBetween(
22+
() => (
23+
<Divider key={Math.random()} />
24+
),
25+
React.Children.toArray(children)
26+
)}
2227
</AppText>
2328
);
2429

0 commit comments

Comments
 (0)