Run prettier across codebase

Close #1444
This commit is contained in:
Nicolas Gallagher
2019-10-07 14:26:16 -07:00
parent d4b9f35d33
commit 1b3c31ff6a
10 changed files with 31 additions and 13 deletions

View File

@@ -45,7 +45,7 @@ class SierpinskiTriangle extends React.Component {
}
// introduce randomness to ensure that repeated runs don't produce the same colors
const color = fn(renderCount * Math.random() / 20);
const color = fn((renderCount * Math.random()) / 20);
return (
<Dot color={color} size={targetSize} x={x - targetSize / 2} y={y - targetSize / 2} />
);

View File

@@ -21,7 +21,7 @@ class Tree extends Component {
let result = (
<Box color={id % 3} layout={depth % 2 === 0 ? 'column' : 'row'} outer>
{depth === 0 && <Box color={id % 3 + 3} fixed />}
{depth === 0 && <Box color={(id % 3) + 3} fixed />}
{depth !== 0 &&
Array.from({ length: breadth }).map((el, i) => (
<Tree

View File

@@ -12,7 +12,15 @@ const compose = (s1, s2) => {
class View extends React.Component {
render() {
const { style, ...other } = this.props;
return <div {...other} style={compose(viewStyle, style)} />;
return (
<div
{...other}
style={compose(
viewStyle,
style
)}
/>
);
}
}

View File

@@ -9,7 +9,9 @@ const sizes = [20, 'small', 36, 'large', 60];
const ActivityIndicatorSizeExample = () => (
<View style={styles.horizontal}>
{sizes.map((size, i) => <ActivityIndicator key={i} size={size} style={styles.rightPadding} />)}
{sizes.map((size, i) => (
<ActivityIndicator key={i} size={size} style={styles.rightPadding} />
))}
<ActivityIndicator size="large" style={styles.large} />
</View>
);

View File

@@ -105,21 +105,21 @@ const SwitchScreen = () => (
/>
<DocItem
description="(For compatibility with React Native. Equivalent to &quot;activeTrackColor&quot;)"
description='(For compatibility with React Native. Equivalent to "activeTrackColor")'
label="compat"
name="onTintColor"
typeInfo="?color"
/>
<DocItem
description="(For compatibility with React Native. Equivalent to &quot;trackColor&quot;)"
description='(For compatibility with React Native. Equivalent to "trackColor")'
label="compat"
name="tintColor"
typeInfo="?color"
/>
<DocItem
description="(For compatibility with React Native. Equivalent to &quot;thumbColor&quot;)"
description='(For compatibility with React Native. Equivalent to "thumbColor")'
label="compat"
name="thumbTintColor"
typeInfo="?color"

View File

@@ -28,8 +28,7 @@ const TextChildrenExample = () => (
(Normal text,
<Text style={{ fontWeight: 'bold' }}>
(and bold
<Text style={{ fontSize: 11, color: '#527fe4' }}>(and tiny inherited bold blue)</Text>
)
<Text style={{ fontSize: 11, color: '#527fe4' }}>(and tiny inherited bold blue)</Text>)
</Text>
)
</Text>

View File

@@ -51,7 +51,9 @@ export default class TouchableDelayEvents extends PureComponent {
</Touchable>
</View>
<View style={styles.eventLogBox}>
{this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}
{this.state.eventLog.map((e, ii) => (
<Text key={ii}>{e}</Text>
))}
</View>
</View>
);

View File

@@ -47,7 +47,9 @@ export default class TouchableFeedbackEvents extends PureComponent {
</Touchable>
</View>
<View style={styles.eventLogBox}>
{this.state.eventLog.map((e, ii) => <Text key={ii}>{e}</Text>)}
{this.state.eventLog.map((e, ii) => (
<Text key={ii}>{e}</Text>
))}
</View>
</View>
);

View File

@@ -34,7 +34,7 @@ const AppStateScreen = () => (
<DocItem
name="static currentState"
description="Returns the current state of the app: &quot;active&quot; or &quot;background&quot;."
description='Returns the current state of the app: "active" or "background".'
/>
</Section>

View File

@@ -18,7 +18,12 @@ const Title = ({ children }) => (
export const Description = ({ children }) => (
<AppText style={styles.description}>
{insertBetween(() => <Divider key={Math.random()} />, React.Children.toArray(children))}
{insertBetween(
() => (
<Divider key={Math.random()} />
),
React.Children.toArray(children)
)}
</AppText>
);