Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v2 (#5058)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency prettier to v2

* format

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jimmy Jia <tesrin@gmail.com>
  • Loading branch information
3 people committed Mar 22, 2020
1 parent a4b8813 commit d983ec8
Show file tree
Hide file tree
Showing 100 changed files with 254 additions and 380 deletions.
2 changes: 1 addition & 1 deletion karma.conf.js
@@ -1,6 +1,6 @@
const { DefinePlugin } = require('webpack');

module.exports = config => {
module.exports = (config) => {
const { env } = process;

config.set({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -121,7 +121,7 @@
"lint-staged": "^10.0.8",
"lodash": "^4.17.15",
"mocha": "^7.1.0",
"prettier": "^1.19.1",
"prettier": "^2.0.1",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-test-renderer": "^16.13.0",
Expand Down
4 changes: 2 additions & 2 deletions src/AbstractNav.js
Expand Up @@ -60,7 +60,7 @@ const AbstractNav = React.forwardRef(

const listNode = useRef(null);

const getNextActiveChild = offset => {
const getNextActiveChild = (offset) => {
if (!listNode.current) return null;

let items = qsa(listNode.current, '[data-rb-event-key]:not(.disabled)');
Expand All @@ -81,7 +81,7 @@ const AbstractNav = React.forwardRef(
if (parentOnSelect) parentOnSelect(key, event);
};

const handleKeyDown = event => {
const handleKeyDown = (event) => {
if (onKeyDown) onKeyDown(event);

let nextActiveChild;
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractNavItem.js
Expand Up @@ -61,7 +61,7 @@ const AbstractNavItem = React.forwardRef(
props['aria-selected'] = isActive;
}

const handleOnclick = useEventCallback(e => {
const handleOnclick = useEventCallback((e) => {
if (onClick) onClick(e);
if (navKey == null) return;
if (onSelect) onSelect(navKey, e);
Expand Down
2 changes: 1 addition & 1 deletion src/AccordionToggle.js
Expand Up @@ -24,7 +24,7 @@ export function useAccordionToggle(eventKey, onClick) {
const contextEventKey = useContext(AccordionContext);
const onSelect = useContext(SelectableContext);

return e => {
return (e) => {
/*
Compare the event key in context with the given event key.
If they are the same, then collapse the component.
Expand Down
2 changes: 1 addition & 1 deletion src/Alert.js
Expand Up @@ -79,7 +79,7 @@ const Alert = React.forwardRef((uncontrolledProps, ref) => {
} = useUncontrolled(uncontrolledProps, controllables);

const prefix = useBootstrapPrefix(bsPrefix, 'alert');
const handleClose = useEventCallback(e => {
const handleClose = useEventCallback((e) => {
onClose(false, e);
});

Expand Down
12 changes: 6 additions & 6 deletions src/BootstrapModalManager.js
Expand Up @@ -32,27 +32,27 @@ export default class BootstrapModalManager extends ModalManager {
if (!containerState.overflowing) return;
const size = getScrollbarSize();

qsa(container, Selector.FIXED_CONTENT).forEach(el =>
qsa(container, Selector.FIXED_CONTENT).forEach((el) =>
this.adjustAndStore('paddingRight', el, size),
);
qsa(container, Selector.STICKY_CONTENT).forEach(el =>
qsa(container, Selector.STICKY_CONTENT).forEach((el) =>
this.adjustAndStore('margingRight', el, -size),
);
qsa(container, Selector.NAVBAR_TOGGLER).forEach(el =>
qsa(container, Selector.NAVBAR_TOGGLER).forEach((el) =>
this.adjustAndStore('margingRight', el, size),
);
}

removeContainerStyle(containerState, container) {
super.removeContainerStyle(containerState, container);

qsa(container, Selector.FIXED_CONTENT).forEach(el =>
qsa(container, Selector.FIXED_CONTENT).forEach((el) =>
this.restore('paddingRight', el),
);
qsa(container, Selector.STICKY_CONTENT).forEach(el =>
qsa(container, Selector.STICKY_CONTENT).forEach((el) =>
this.restore('margingRight', el),
);
qsa(container, Selector.NAVBAR_TOGGLER).forEach(el =>
qsa(container, Selector.NAVBAR_TOGGLER).forEach((el) =>
this.restore('margingRight', el),
);
}
Expand Down
22 changes: 11 additions & 11 deletions src/Carousel.js
Expand Up @@ -228,7 +228,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
).length;

const prev = useCallback(
event => {
(event) => {
if (isSliding) {
return;
}
Expand All @@ -250,7 +250,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
);

// This is used in the setInterval, so it should not invalidate.
const next = useEventCallback(event => {
const next = useEventCallback((event) => {
if (isSliding) {
return;
}
Expand Down Expand Up @@ -300,7 +300,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
const directionalClassName = `${prefix}-item-${slideDirection}`;

const handleEnter = useCallback(
node => {
(node) => {
triggerBrowserReflow(node);

if (onSlide) {
Expand All @@ -319,7 +319,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
}, [onSlid, renderedActiveIndex, slideDirection]);

const handleKeyDown = useCallback(
event => {
(event) => {
if (keyboard && !/input|textarea/i.test(event.target.tagName)) {
switch (event.key) {
case 'ArrowLeft':
Expand All @@ -344,7 +344,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
const [pausedOnHover, setPausedOnHover] = useState(false);

const handleMouseOver = useCallback(
event => {
(event) => {
if (pause === 'hover') {
setPausedOnHover(true);
}
Expand All @@ -357,7 +357,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
);

const handleMouseOut = useCallback(
event => {
(event) => {
setPausedOnHover(false);

if (onMouseOut) {
Expand All @@ -373,7 +373,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
const touchUnpauseTimeout = useTimeout();

const handleTouchStart = useCallback(
event => {
(event) => {
touchStartXRef.current = event.touches[0].clientX;
touchDeltaXRef.current = 0;

Expand All @@ -389,7 +389,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
);

const handleTouchMove = useCallback(
event => {
(event) => {
if (event.touches && event.touches.length > 1) {
touchDeltaXRef.current = 0;
} else {
Expand All @@ -405,7 +405,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
);

const handleTouchEnd = useCallback(
event => {
(event) => {
if (touch) {
const touchDeltaX = touchDeltaXRef.current;

Expand Down Expand Up @@ -454,7 +454,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
const indicatorOnClicks = useMemo(
() =>
indicators &&
Array.from({ length: numChildren }, (_, index) => event => {
Array.from({ length: numChildren }, (_, index) => (event) => {
onSelect(index, event);
}),
[indicators, numChildren, onSelect],
Expand Down Expand Up @@ -500,7 +500,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
onEntered={isActive ? handleEntered : null}
addEndListener={transitionEnd}
>
{status =>
{(status) =>
React.cloneElement(child, {
className: classNames(
child.props.className,
Expand Down
2 changes: 1 addition & 1 deletion src/Col.js
Expand Up @@ -77,7 +77,7 @@ const Col = React.forwardRef(
const spans = [];
const classes = [];

DEVICE_SIZES.forEach(brkPoint => {
DEVICE_SIZES.forEach((brkPoint) => {
let propValue = props[brkPoint];
delete props[brkPoint];

Expand Down
10 changes: 5 additions & 5 deletions src/Collapse.js
Expand Up @@ -138,21 +138,21 @@ class Collapse extends React.Component {
}

/* -- Expanding -- */
handleEnter = elem => {
handleEnter = (elem) => {
elem.style[this.getDimension()] = '0';
};

handleEntering = elem => {
handleEntering = (elem) => {
const dimension = this.getDimension();
elem.style[dimension] = this._getScrollDimensionValue(elem, dimension);
};

handleEntered = elem => {
handleEntered = (elem) => {
elem.style[this.getDimension()] = null;
};

/* -- Collapsing -- */
handleExit = elem => {
handleExit = (elem) => {
const dimension = this.getDimension();
elem.style[dimension] = `${this.props.getDimensionValue(
dimension,
Expand All @@ -161,7 +161,7 @@ class Collapse extends React.Component {
triggerBrowserReflow(elem);
};

handleExiting = elem => {
handleExiting = (elem) => {
elem.style[this.getDimension()] = null;
};

Expand Down
2 changes: 1 addition & 1 deletion src/DropdownItem.js
Expand Up @@ -83,7 +83,7 @@ const DropdownItem = React.forwardRef(
? makeEventKey(activeKey) === key
: propActive;

const handleClick = useEventCallback(event => {
const handleClick = useEventCallback((event) => {
// SafeAnchor handles the disabled case, but we handle it here
// for other components
if (disabled) return;
Expand Down
4 changes: 2 additions & 2 deletions src/ElementChildren.js
Expand Up @@ -11,7 +11,7 @@ import React from 'react';
function map(children, func) {
let index = 0;

return React.Children.map(children, child =>
return React.Children.map(children, (child) =>
React.isValidElement(child) ? func(child, index++) : child,
);
}
Expand All @@ -24,7 +24,7 @@ function map(children, func) {
*/
function forEach(children, func) {
let index = 0;
React.Children.forEach(children, child => {
React.Children.forEach(children, (child) => {
if (React.isValidElement(child)) func(child, index++);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Fade.js
Expand Up @@ -78,7 +78,7 @@ const fadeStyles = {

const Fade = React.forwardRef(({ className, children, ...props }, ref) => {
const handleEnter = useCallback(
node => {
(node) => {
triggerBrowserReflow(node);
if (props.onEnter) props.onEnter(node);
},
Expand Down
4 changes: 2 additions & 2 deletions src/InputGroup.js
Expand Up @@ -64,13 +64,13 @@ const InputGroupText = createWithBsPrefix('input-group-text', {
Component: 'span',
});

const InputGroupCheckbox = props => (
const InputGroupCheckbox = (props) => (
<InputGroupText>
<input type="checkbox" {...props} />
</InputGroupText>
);

const InputGroupRadio = props => (
const InputGroupRadio = (props) => (
<InputGroupText>
<input type="radio" {...props} />
</InputGroupText>
Expand Down
2 changes: 1 addition & 1 deletion src/ListGroupItem.js
Expand Up @@ -72,7 +72,7 @@ const ListGroupItem = React.forwardRef(
bsPrefix = useBootstrapPrefix(bsPrefix, 'list-group-item');

const handleClick = useCallback(
event => {
(event) => {
if (disabled) {
event.preventDefault();
event.stopPropagation();
Expand Down
8 changes: 4 additions & 4 deletions src/Modal.js
Expand Up @@ -203,7 +203,7 @@ class Modal extends React.Component {
removeEventListener(window, 'resize', this.handleWindowResize);
}

setModalRef = ref => {
setModalRef = (ref) => {
this._modal = ref;
};

Expand All @@ -214,14 +214,14 @@ class Modal extends React.Component {
this._waitingForMouseUp = true;
};

handleMouseUp = e => {
handleMouseUp = (e) => {
if (this._waitingForMouseUp && e.target === this._modal.dialog) {
this._ignoreBackdropClick = true;
}
this._waitingForMouseUp = false;
};

handleClick = e => {
handleClick = (e) => {
if (this._ignoreBackdropClick || e.target !== e.currentTarget) {
this._ignoreBackdropClick = false;
return;
Expand Down Expand Up @@ -294,7 +294,7 @@ class Modal extends React.Component {
});
}

renderBackdrop = props => {
renderBackdrop = (props) => {
const { bsPrefix, backdropClassName, animation } = this.props;

return (
Expand Down
2 changes: 1 addition & 1 deletion src/NavbarCollapse.js
Expand Up @@ -15,7 +15,7 @@ const NavbarCollapse = React.forwardRef(
bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-collapse');
return (
<NavbarContext.Consumer>
{context => (
{(context) => (
<Collapse in={!!(context && context.expanded)} {...props}>
<div ref={ref} className={bsPrefix}>
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/NavbarToggle.js
Expand Up @@ -46,7 +46,7 @@ const NavbarToggle = React.forwardRef(

const { onToggle, expanded } = useContext(NavbarContext) || {};

const handleClick = useEventCallback(e => {
const handleClick = useEventCallback((e) => {
if (onClick) onClick(e);
if (onToggle) onToggle();
});
Expand Down
4 changes: 2 additions & 2 deletions src/Overlay.js
Expand Up @@ -115,9 +115,9 @@ function wrapRefs(props, arrowProps) {
const { ref } = props;
const { ref: aRef } = arrowProps;

props.ref = ref.__wrapped || (ref.__wrapped = r => ref(findDOMNode(r)));
props.ref = ref.__wrapped || (ref.__wrapped = (r) => ref(findDOMNode(r)));
arrowProps.ref =
aRef.__wrapped || (aRef.__wrapped = r => aRef(findDOMNode(r)));
aRef.__wrapped || (aRef.__wrapped = (r) => aRef(findDOMNode(r)));
}

function Overlay({ children: overlay, transition, ...outerProps }) {
Expand Down

0 comments on commit d983ec8

Please sign in to comment.