Skip to content

Commit

Permalink
Upgrade prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Sep 27, 2018
1 parent 20345c7 commit 0fdafbe
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion next-packages/styled/__tests__/styled.js
Expand Up @@ -178,7 +178,7 @@ describe('styled', () => {
`

const H2 = styled(H1)`
font-size: ${fontSize * 2 / 3 + 'px'};
font-size: ${(fontSize * 2) / 3 + 'px'};
`

const tree = renderer
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -90,7 +90,7 @@
"polished": "^1.2.1",
"preact": "^8.2.9",
"preact-render-to-json": "^3.6.6",
"prettier": "1.10.2",
"prettier": "1.14.3",
"raf": "^3.4.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-plugin-emotion/src/macro-styled.js
Expand Up @@ -10,7 +10,11 @@ import { createMacro } from 'babel-plugin-macros'
export default createMacro(macro)

function macro(options) {
const { references, state, babel: { types: t } } = options
const {
references,
state,
babel: { types: t }
} = options
let referencesWithoutDefault = references
if (references.default) {
referencesWithoutDefault = omit(references, key => key !== 'default')
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-emotion/test/macro/react.test.js
Expand Up @@ -225,7 +225,7 @@ describe('styled', () => {
`

const H2 = styled(H1)`
font-size: ${fontSize * 2 / 3 + 'px'};
font-size: ${(fontSize * 2) / 3 + 'px'};
`

const tree = renderer
Expand Down
5 changes: 4 additions & 1 deletion packages/create-emotion-server/src/stream.js
Expand Up @@ -56,7 +56,10 @@ const createRenderStylesToNodeStream = (
}
)

return pipe(tokenStream, inlineStream)
return pipe(
tokenStream,
inlineStream
)
}

export default createRenderStylesToNodeStream
2 changes: 1 addition & 1 deletion packages/create-emotion/test/styled.test.js
Expand Up @@ -229,7 +229,7 @@ describe('styled', () => {
`

const H2 = styled(H1)`
font-size: ${fontSize * 2 / 3 + 'px'};
font-size: ${(fontSize * 2) / 3 + 'px'};
`

const tree = renderer
Expand Down
2 changes: 1 addition & 1 deletion packages/emotion-server/test/util.js
Expand Up @@ -123,7 +123,7 @@ export const createBigComponent = ({ injectGlobal, css }: Emotion) => {
className={css({
color:
'#' +
Math.round(1 / count * maxColors)
Math.round((1 / count) * maxColors)
.toString(16)
.padStart(6, '0')
})}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-emotion/test/index.test.js
Expand Up @@ -223,7 +223,7 @@ describe('styled', () => {
`

const H2 = styled(H1)`
font-size: ${fontSize * 2 / 3 + 'px'};
font-size: ${(fontSize * 2) / 3 + 'px'};
`

const tree = renderer
Expand Down
4 changes: 3 additions & 1 deletion scripts/benchmarks/src/app/App.js
Expand Up @@ -118,7 +118,9 @@ export default class App extends Component<{}> {
</View>
</View>
<ScrollView ref={this._setScrollRef} style={styles.grow}>
{results.map((result, i) => <ReportCard key={i} {...result} />)}
{results.map((result, i) => (
<ReportCard key={i} {...result} />
))}
{status === 'running' ? (
<ReportCard
benchmarkName={currentBenchmarkName}
Expand Down
5 changes: 4 additions & 1 deletion scripts/benchmarks/src/app/Icons.js
Expand Up @@ -18,7 +18,10 @@ const createIcon = children => {
createElement(
'svg',
{
style: StyleSheet.compose(styles.root, props.style),
style: StyleSheet.compose(
styles.root,
props.style
),
width: 24,
height: 24,
viewBox: '0 0 24 24'
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmarks/src/cases/SierpinskiTriangle.js
Expand Up @@ -49,7 +49,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}
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmarks/src/cases/Tree.js
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion scripts/emotion-react-mock-for-preact/__tests__/context.js
Expand Up @@ -33,7 +33,8 @@ test('provider without children', () => {
let { Provider } = React.createContext(defaultContext)
render(
<div>
some content<Provider value={<div>this is the actual value!!</div>} />
some content
<Provider value={<div>this is the actual value!!</div>} />
</div>
)
expect(document.documentElement).toMatchSnapshot()
Expand Down
3 changes: 2 additions & 1 deletion site/src/pages/community.js
Expand Up @@ -30,7 +30,8 @@ const Community = (props: *) => (
This list comes from{' '}
<a href="https://github.com/emotion-js/awesome-emotion">
awesome-emotion
</a>. Anything added to that that list will appear here automatically.
</a>
. Anything added to that that list will appear here automatically.
</markdownComponents.p>
<markdownComponents.h2>Thanks!</markdownComponents.h2>
<markdownComponents.p>
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -14173,9 +14173,9 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@1.10.2:
version "1.10.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93"
prettier@1.14.3:
version "1.14.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895"

pretty-bytes@^4.0.2:
version "4.0.2"
Expand Down

0 comments on commit 0fdafbe

Please sign in to comment.