Skip to content

Commit

Permalink
chore(build): fix prettier imports (#3142)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored Sep 10, 2018
1 parent 9d36af3 commit bfb6799
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const config = {
'classnames',
'copy-to-clipboard',
'faker',
'prettier/standalone',
'react',
'react-ace',
'react-dom',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button, Popup, Segment, Menu } from 'semantic-ui-react'

import Editor, { EDITOR_BACKGROUND_COLOR } from 'docs/src/components/Editor/Editor'
import { updateForKeys } from 'docs/src/hoc'
import { formatCode } from 'docs/src/utils'
import formatCode from 'docs/src/utils/formatCode'

const rootStyle = {
position: 'relative',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react'
import { Divider } from 'semantic-ui-react'

import Editor, { EDITOR_BACKGROUND_COLOR } from 'docs/src/components/Editor/Editor'
import { formatCode } from 'docs/src/utils'
import formatCode from 'docs/src/utils/formatCode'

const rootStyle = {
padding: '1rem',
Expand Down
4 changes: 4 additions & 0 deletions docs/src/utils/formatCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import prettierConfig from '../../../.prettierrc.json'
delete prettierConfig.$schema
delete prettierConfig.overrides

// Heads up!
// Please use this function directly and don't reexport it in utils.
// https://github.com/prettier/prettier/issues/4959

const formatCode = (code) => {
if (!code) return ''

Expand Down
1 change: 0 additions & 1 deletion docs/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export btoa from './btoa'
export * from './constants'
export componentInfoContext from './componentInfoContext'
export examplePathToHash from './examplePathToHash'
export formatCode from './formatCode'
export getComponentPathname from './getComponentPathname'
export getFormattedHash from './getFormattedHash'
export parseExamplePath from './parseExamplePath'
Expand Down
1 change: 0 additions & 1 deletion webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ if (!__TEST__) {
'@babel/standalone': 'Babel',
faker: 'faker',
'prop-types': 'PropTypes',
'prettier/standalone': 'prettier',
react: 'React',
'react-dom': 'ReactDOM',
'react-dom/server': 'ReactDOMServer',
Expand Down

0 comments on commit bfb6799

Please sign in to comment.