diff --git a/.prettierrc.yaml b/.prettierrc.yaml index 614f548d8..afa0c8ad2 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -4,4 +4,6 @@ overrides: - files: "docs/*.md" options: printWidth: 60 +- files: "*.js" + options: parser: flow diff --git a/packages/styled-base/flow-tests/flow.js b/packages/styled-base/flow-tests/flow.js index fcde9401e..12b670f4d 100644 --- a/packages/styled-base/flow-tests/flow.js +++ b/packages/styled-base/flow-tests/flow.js @@ -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({ color: props => props.color }) const validProp =
@@ -33,9 +33,6 @@ const invalidPropAccess = createStyled().__emotion_base const untyped: StyledComponent = createStyled.div({}) // Style a functional component -const styledFn = - createStyled < - Props > - (props =>
)` +const styledFn = createStyled(props =>
)` color: red; ` diff --git a/packages/styled/flow-tests/flow.js b/packages/styled/flow-tests/flow.js index 37d01b91f..c0fdee630 100644 --- a/packages/styled/flow-tests/flow.js +++ b/packages/styled/flow-tests/flow.js @@ -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({ + color: 'red' +}) const valid = @@ -18,9 +15,6 @@ const invalid = // 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('div')` colors: red; `