Skip to content

Commit

Permalink
chore(package): bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter committed Mar 18, 2019
1 parent 3ab3bac commit 06b932c
Show file tree
Hide file tree
Showing 62 changed files with 2,138 additions and 1,673 deletions.
61 changes: 33 additions & 28 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
{
"parser": "babel-eslint",
"extends": "airbnb",
"extends": ["airbnb", "prettier"],
"env": {
"browser": true
},
"rules": {
"newline-per-chained-call": 0,
"class-methods-use-this": 0,
"consistent-return": 0,
"complexity": [1, 10],
"global-require": 0,
"jsx-quotes": [2, "prefer-single"],
"max-len": [2, 120, 4],
"no-console": 2,
"no-mixed-operators": 0,
"no-multi-spaces": [2, { "ignoreEOLComments": true }],
"no-return-assign": [2, "except-parens"],
"no-underscore-dangle": 0,
"padded-blocks": [2, {
"newline-per-chained-call": "off",
"class-methods-use-this": "off",
"consistent-return": "off",
"complexity": ["warn", 10],
"global-require": "off",
"lines-between-class-members": "off",
"no-console": "error",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"no-return-assign": ["error", "except-parens"],
"no-underscore-dangle": "off",
"padded-blocks": ["error", {
"blocks": "never",
"switches": "never",
"classes": "never"
}],
"semi": [2, "never"],
"jsx-a11y/alt-text": 1,
"jsx-a11y/label-has-for": 1,
"jsx-a11y/no-static-element-interactions": 1,
"jsx-a11y/role-has-required-aria-props": 1,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/no-unresolved": 0,
"import/no-webpack-loader-syntax": 0,
"import/extensions": 0,
"react/forbid-prop-types": 0,
"prefer-destructuring": "off",
"jsx-a11y/alt-text": "warn",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/label-has-for": "warn",
"jsx-a11y/label-has-associated-control": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/role-has-required-aria-props": "warn",
"import/no-dynamic-require": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/no-webpack-loader-syntax": "off",
"import/extensions": "off",
"react/button-has-type": "off",
"react/destructuring-assignment": "off",
"react/forbid-prop-types": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-filename-extension": [2, { "extensions": [".js"] }],
"react/no-unused-prop-types": 0,
"react/sort-comp": 0,
"react/require-default-props": 0
"react/jsx-wrap-multilines": "off",
"react/no-unused-prop-types": "off",
"react/sort-comp": "off",
"react/require-default-props":"off"
}
}
3 changes: 2 additions & 1 deletion docs/src/components/CarbonAd/CarbonAdNative.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ class CarbonAdNative extends PureComponent {
#${id}:hover > img {
opacity: 1;
}
`}</style>
`}
</style>
</a>
)
}
Expand Down
9 changes: 4 additions & 5 deletions docs/src/components/CodeEditor/CodeEditorUniveral.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import { withSiteData } from 'react-static'
import universal from 'react-universal-component'
import { Loader } from 'semantic-ui-react'

Expand All @@ -14,8 +13,8 @@ export const EDITOR_GUTTER_COLOR = '#25282d'
// component also allows us to load Editor lazy.
const CodeEditor = isBrowser()
? universal(import('./CodeEditor'), {
loading: () => <Loader active inline='centered' />,
})
loading: () => <Loader active inline='centered' />,
})
: () => null

function CodeEditorUniveral(props) {
Expand Down Expand Up @@ -46,7 +45,7 @@ function CodeEditorUniveral(props) {

CodeEditorUniveral.propTypes = {
id: PropTypes.string.isRequired,
mode: PropTypes.oneOf(['html', 'jsx']),
mode: PropTypes.oneOf(['html', 'jsx', 'sh']),
value: PropTypes.string.isRequired,
readOnly: PropTypes.bool,
}
Expand All @@ -55,4 +54,4 @@ CodeEditorUniveral.defaultProps = {
mode: 'jsx',
}

export default withSiteData(CodeEditorUniveral)
export default CodeEditorUniveral
4 changes: 2 additions & 2 deletions docs/src/components/CodeSnippet/CodeSnippet.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const CodeSnippet = ({ fitted, label, mode, value, ...rest }) => (
showCursor={false}
value={(mode === 'sh'
? value.replace(/^/g, '$ ')
: formatCode(value, mode === 'html' ? 'html' : 'babylon')
: formatCode(value, mode === 'html' ? 'html' : 'babel')
).trim()}
{...rest}
/>
Expand All @@ -46,7 +46,7 @@ const CodeSnippet = ({ fitted, label, mode, value, ...rest }) => (
CodeSnippet.propTypes = {
fitted: PropTypes.bool,
label: PropTypes.string,
mode: PropTypes.oneOf(['html', 'jsx', 'sh']).isRequired,
mode: PropTypes.oneOf(['html', 'jsx', 'sh']),
value: PropTypes.string.isRequired,
}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/ComponentDoc/ComponentDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ComponentDoc extends Component {
const { history } = this.props
const activePath = examplePathToHash(examplePath)

history.replace(`${location.pathname}#${activePath}`)
history.replace(`${window.location.pathname}#${activePath}`)
// set active hash path
this.setState({ activePath }, scrollToAnchor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { PureComponent } from 'react'
import { Divider } from 'semantic-ui-react'

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

const rootStyle = {
padding: '1rem',
Expand All @@ -22,7 +23,7 @@ export default class ComponentExampleRenderHtml extends PureComponent {
const { value } = this.props

// remove new line at eof after formatting for a tighter fit
const formattedCode = value.trim()
const formattedCode = formatCode(value, 'html').replace(/\s+$/, '')

return (
<div style={rootStyle}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class ComponentTableRow extends Component {

state = {}

toggleEnums = () => this.setState({ showEnums: !this.state.showEnums })
toggleEnums = () => this.setState(prevState => ({ showEnums: !prevState.showEnums }))

render() {
const { defaultValue, description, name, required, tags, type, value } = this.props
Expand Down
5 changes: 3 additions & 2 deletions docs/src/components/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Head, withRouter, withSiteData } from 'react-static'
import Sidebar from 'docs/src/components/Sidebar/Sidebar'
import style from 'docs/src/Style'
import { docTypes, scrollToAnchor } from 'docs/src/utils'
import { isBrowser } from 'src/lib'

const anchors = new AnchorJS({
icon: '#',
Expand Down Expand Up @@ -41,10 +42,10 @@ class DocsLayout extends Component {

clearTimeout(this.scrollStartTimeout)

scrollTo(0, 0)
if (isBrowser()) window.scrollTo(0, 0)

anchors.add('h2, h3, h4, h5, h6')
anchors.remove([1, 2, 3, 4, 5, 6].map(n => `.rendered-example h${n}`).join(', '))
anchors.remove([1, 2, 3, 4, 5, 6].map((n) => `.rendered-example h${n}`).join(', '))
anchors.remove('.no-anchor')

this.scrollStartTimeout = setTimeout(scrollToAnchor, 500)
Expand Down
8 changes: 5 additions & 3 deletions docs/src/components/LayoutsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link, withRouteData } from 'react-static'
import { Button } from 'semantic-ui-react'

import { repoURL } from 'docs/src/utils'
import { isBrowser } from 'src/lib'

const docsButtonStyle = {
position: 'fixed',
Expand All @@ -21,7 +22,8 @@ const style = (
50% { transform: translateY(0.35em); }
100% { transform: translateY(0); }
}
`}</style>
`}
</style>
)

class LayoutsLayout extends PureComponent {
Expand All @@ -36,11 +38,11 @@ class LayoutsLayout extends PureComponent {
}

componentDidMount() {
scrollTo(0, 0)
if (isBrowser()) window.scrollTo(0, 0)
}

componentDidUpdate() {
scrollTo(0, 0)
if (isBrowser()) window.scrollTo(0, 0)
}

render() {
Expand Down
8 changes: 4 additions & 4 deletions docs/src/examples/addons/Portal/Types/PortalExamplePortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export default class PortalExamplePortal extends Component {
clearLog = () => this.setState({ log: [], logCount: 0 })

writeLog = eventName =>
this.setState({
log: [`${new Date().toLocaleTimeString()}: ${eventName}`, ...this.state.log].slice(0, 20),
logCount: this.state.logCount + 1,
})
this.setState(prevState => ({
log: [`${new Date().toLocaleTimeString()}: ${eventName}`, ...prevState.log].slice(0, 20),
logCount: prevState.logCount + 1,
}))

render() {
const { log, logCount, open } = this.state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, Radio } from 'semantic-ui-react'

export default class RadioExampleRemoteControl extends Component {
state = { checked: false }
toggle = () => this.setState({ checked: !this.state.checked })
toggle = () => this.setState(prevState => ({ checked: !prevState.checked }))

render() {
return (
Expand Down
1 change: 1 addition & 0 deletions docs/src/examples/addons/Ref/Types/RefForwardingExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ExampleButton = React.forwardRef((props, ref) => (
</div>
))

// eslint-disable-next-line react/no-multi-comp
export default class RefForwardingExample extends Component {
forwardedRef = React.createRef()
state = { isMounted: false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default class ResponsiveExampleOnUpdate extends Component {
}

handleOnUpdate = () =>
this.setState({
log: [`${new Date().toLocaleTimeString()}: onUpdate()`, ...this.state.log].slice(0, 20),
logCount: this.state.logCount + 1,
})
this.setState(prevState => ({
log: [`${new Date().toLocaleTimeString()}: onUpdate()`, ...prevState.log].slice(0, 20),
logCount: prevState.logCount + 1,
}))

clearLog = () => this.setState({ log: [], logCount: 0 })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Button, Header, Segment, TransitionablePortal } from 'semantic-ui-react
export default class TransitionablePortalExampleControlled extends Component {
state = { open: false }

handleClick = () => this.setState({ open: !this.state.open })

handleClick = () => this.setState(prevState => ({ open: !prevState.open }))
handleClose = () => this.setState({ open: false })

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export default class TransitionablePortalExampleTransition extends Component {
state = { animation: transitions[0], duration: 500, open: false }

handleChange = (e, { name, value }) => this.setState({ [name]: value })

handleClick = () => this.setState({ open: !this.state.open })
handleClick = () => this.setState(prevState => ({ open: !prevState.open }))

render() {
const { animation, duration, open } = this.state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ export default class VisibilityExampleCallbackFrequency extends Component {
contextRef = createRef()

updateLog = eventName => () =>
this.setState({
this.setState(prevState => ({
log: [
`${new Date().toLocaleTimeString()}: ${eventName}`,
...this.state.log,
...prevState.log,
].slice(0, 20),
logCount: this.state.logCount + 1,
})
logCount: prevState.logCount + 1,
}))

clearLog = () => this.setState({ log: [], logCount: 0 })

toggleOnce = () => this.setState({ once: !this.state.once })
toggleOnce = () => this.setState(prevState => ({ once: !prevState.once }))

toggleContinuous = () => this.setState({ continuous: !this.state.continuous })
toggleContinuous = () => this.setState(prevState => ({ continuous: !prevState.continuous }))

render() {
const { continuous, log, logCount, once } = this.state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ export default class VisibilityExampleGroupedCallbacks extends Component {
contextRef = createRef()

updateLog = eventName => () =>
this.setState({
this.setState(prevState => ({
log: [
`${new Date().toLocaleTimeString()}: ${eventName}`,
...this.state.log,
...prevState.log,
].slice(0, 20),
logCount: this.state.logCount + 1,
})
logCount: prevState.logCount + 1,
}))

clearLog = () => this.setState({ log: [], logCount: 0 })

toggleOnce = () => this.setState({ once: !this.state.once })
toggleOnce = () => this.setState(prevState => ({ once: !prevState.once }))

toggleContinuous = () => this.setState({ continuous: !this.state.continuous })
toggleContinuous = () => this.setState(prevState => ({ continuous: !prevState.continuous }))

render() {
const { continuous, log, logCount, once } = this.state
Expand Down
4 changes: 1 addition & 3 deletions docs/src/examples/collections/Grid/Variations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ const GridVariationsExamples = () => (

<ComponentExample
title='Vertical Alignment'
description={
'A grid, row, or column can specify its vertical alignment to have all its columns vertically centered.'
}
description='A grid, row, or column can specify its vertical alignment to have all its columns vertically centered.'
examplePath='collections/Grid/Variations/GridExampleVerticalAlignment'
/>
<ComponentExample examplePath='collections/Grid/Variations/GridExampleVerticalAlignmentRow' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React, { Component } from 'react'
import { Menu } from 'semantic-ui-react'

export default class MenuExampleHeaderVertical extends Component {
state = {}
handleItemClick = name => this.setState({ activeItem: name })

render() {
const { activeItem } = this.state || {}
const { activeItem } = this.state

return (
<Menu vertical>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React, { Component } from 'react'
import { Menu, Message } from 'semantic-ui-react'

export default class MenuExampleLinkItem extends Component {
state = {}
handleClick = () => this.setState({ message: 'onClick handled' })

render() {
const { message } = this.state || {}
const { message } = this.state

return (
<div>
Expand Down
4 changes: 1 addition & 3 deletions docs/src/examples/collections/Table/Variations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ const Variations = () => (

<ComponentExample
title='Full-Width Header / Footer'
description={
'A definition table can have a full width header or footer, filling in the gap left by the first column.'
}
description='A definition table can have a full width header or footer, filling in the gap left by the first column.'
examplePath='collections/Table/Variations/TableExampleFullWidth'
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class ButtonExampleAttachedEvents extends Component {
}
}

updateLog = message => this.setState({ log: [message, ...this.state.log] })
updateLog = message => this.setState(prevState => ({ log: [message, ...prevState.log] }))

render() {
const { log } = this.state
Expand Down
Loading

0 comments on commit 06b932c

Please sign in to comment.