Skip to content

Commit

Permalink
fix: wrong formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
FezVrasta committed Oct 29, 2019
1 parent fb7c4ff commit 3288cf9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ overrides:
- files: "docs/*.md"
options:
printWidth: 60
- files: "*.js"
options:
parser: flow
7 changes: 2 additions & 5 deletions packages/styled-base/flow-tests/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const valid: (
// $FlowExpectError: we can't cast a StyledComponent to string
export const invalid: string = createStyled('div')

const Div = createStyled.div < Props > { color: props => props.color }
const Div = createStyled.div<Props>({ color: props => props.color })

const validProp = <Div color="red" />

Expand All @@ -33,9 +33,6 @@ const invalidPropAccess = createStyled().__emotion_base
const untyped: StyledComponent<empty> = createStyled.div({})

// Style a functional component
const styledFn =
createStyled <
Props >
(props => <div {...props} />)`
const styledFn = createStyled<Props>(props => <div {...props} />)`
color: red;
`
14 changes: 4 additions & 10 deletions packages/styled/flow-tests/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import * as React from 'react'
import styled from '../src'

type Props = { color: string }
const Foo =
styled.div <
Props >
{
color: 'red'
}
const Foo = styled.div<Props>({
color: 'red'
})

const valid = <Foo color="red" />

Expand All @@ -18,9 +15,6 @@ const invalid = <Foo color={2} />

// components defined using the root method should be identical
// to the ones generated using the shortcuts
const root: typeof Foo =
styled <
Props >
'div'`
const root: typeof Foo = styled<Props>('div')`
colors: red;
`

0 comments on commit 3288cf9

Please sign in to comment.