Skip to content

Commit

Permalink
Disable auto semicolon (#484)
Browse files Browse the repository at this point in the history
* Disable auto semicolon

* Actually disable it
  • Loading branch information
emmatown authored and Kye Hohenberger committed Dec 7, 2017
1 parent 6d24323 commit 47ec911
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/emotion/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const sheet = new StyleSheet()

// 🚀
sheet.inject()
const stylisOptions = { keyframe: false }
const stylisOptions = { keyframe: false, semicolon: true }

if (process.env.NODE_ENV !== 'production') {
stylisOptions.compress = false
Expand Down
10 changes: 10 additions & 0 deletions packages/emotion/test/__snapshots__/css.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@ exports[`css multiline declaration 1`] = `
/>
`;

exports[`css multiline selector 1`] = `
.glamor-0 .my-class:hover .its-child {
background: pink;
}
<div
className="glamor-0"
/>
`;

exports[`css nested 1`] = `
.glamor-0 {
color: yellow;
Expand Down
13 changes: 13 additions & 0 deletions packages/emotion/test/css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,19 @@ describe('css', () => {
`
/* eslint-enable prettier/prettier */

const tree = renderer.create(<div className={cls1} />).toJSON()
expect(tree).toMatchSnapshot()
})
test('multiline selector', () => {
/* eslint-disable prettier/prettier */
const cls1 = css`
.my-class:hover
.its-child {
background: pink;
}
`
/* eslint-enable prettier/prettier */

const tree = renderer.create(<div className={cls1} />).toJSON()
expect(tree).toMatchSnapshot()
})
Expand Down

0 comments on commit 47ec911

Please sign in to comment.