Skip to content

Commit d983ec8

Browse files
renovate[bot]renovate-bottaion
authored
chore(deps): update dependency prettier to v2 (react-bootstrap#5058)
* chore(deps): update dependency prettier to v2 * format Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Jimmy Jia <[email protected]>
1 parent a4b8813 commit d983ec8

File tree

100 files changed

+254
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+254
-380
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { DefinePlugin } = require('webpack');
22

3-
module.exports = config => {
3+
module.exports = (config) => {
44
const { env } = process;
55

66
config.set({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"lint-staged": "^10.0.8",
122122
"lodash": "^4.17.15",
123123
"mocha": "^7.1.0",
124-
"prettier": "^1.19.1",
124+
"prettier": "^2.0.1",
125125
"react": "^16.13.0",
126126
"react-dom": "^16.13.0",
127127
"react-test-renderer": "^16.13.0",

src/AbstractNav.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const AbstractNav = React.forwardRef(
6060

6161
const listNode = useRef(null);
6262

63-
const getNextActiveChild = offset => {
63+
const getNextActiveChild = (offset) => {
6464
if (!listNode.current) return null;
6565

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

84-
const handleKeyDown = event => {
84+
const handleKeyDown = (event) => {
8585
if (onKeyDown) onKeyDown(event);
8686

8787
let nextActiveChild;

src/AbstractNavItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const AbstractNavItem = React.forwardRef(
6161
props['aria-selected'] = isActive;
6262
}
6363

64-
const handleOnclick = useEventCallback(e => {
64+
const handleOnclick = useEventCallback((e) => {
6565
if (onClick) onClick(e);
6666
if (navKey == null) return;
6767
if (onSelect) onSelect(navKey, e);

src/AccordionToggle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function useAccordionToggle(eventKey, onClick) {
2424
const contextEventKey = useContext(AccordionContext);
2525
const onSelect = useContext(SelectableContext);
2626

27-
return e => {
27+
return (e) => {
2828
/*
2929
Compare the event key in context with the given event key.
3030
If they are the same, then collapse the component.

src/Alert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const Alert = React.forwardRef((uncontrolledProps, ref) => {
7979
} = useUncontrolled(uncontrolledProps, controllables);
8080

8181
const prefix = useBootstrapPrefix(bsPrefix, 'alert');
82-
const handleClose = useEventCallback(e => {
82+
const handleClose = useEventCallback((e) => {
8383
onClose(false, e);
8484
});
8585

src/BootstrapModalManager.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,27 @@ export default class BootstrapModalManager extends ModalManager {
3232
if (!containerState.overflowing) return;
3333
const size = getScrollbarSize();
3434

35-
qsa(container, Selector.FIXED_CONTENT).forEach(el =>
35+
qsa(container, Selector.FIXED_CONTENT).forEach((el) =>
3636
this.adjustAndStore('paddingRight', el, size),
3737
);
38-
qsa(container, Selector.STICKY_CONTENT).forEach(el =>
38+
qsa(container, Selector.STICKY_CONTENT).forEach((el) =>
3939
this.adjustAndStore('margingRight', el, -size),
4040
);
41-
qsa(container, Selector.NAVBAR_TOGGLER).forEach(el =>
41+
qsa(container, Selector.NAVBAR_TOGGLER).forEach((el) =>
4242
this.adjustAndStore('margingRight', el, size),
4343
);
4444
}
4545

4646
removeContainerStyle(containerState, container) {
4747
super.removeContainerStyle(containerState, container);
4848

49-
qsa(container, Selector.FIXED_CONTENT).forEach(el =>
49+
qsa(container, Selector.FIXED_CONTENT).forEach((el) =>
5050
this.restore('paddingRight', el),
5151
);
52-
qsa(container, Selector.STICKY_CONTENT).forEach(el =>
52+
qsa(container, Selector.STICKY_CONTENT).forEach((el) =>
5353
this.restore('margingRight', el),
5454
);
55-
qsa(container, Selector.NAVBAR_TOGGLER).forEach(el =>
55+
qsa(container, Selector.NAVBAR_TOGGLER).forEach((el) =>
5656
this.restore('margingRight', el),
5757
);
5858
}

src/Carousel.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
228228
).length;
229229

230230
const prev = useCallback(
231-
event => {
231+
(event) => {
232232
if (isSliding) {
233233
return;
234234
}
@@ -250,7 +250,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
250250
);
251251

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

302302
const handleEnter = useCallback(
303-
node => {
303+
(node) => {
304304
triggerBrowserReflow(node);
305305

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

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

346346
const handleMouseOver = useCallback(
347-
event => {
347+
(event) => {
348348
if (pause === 'hover') {
349349
setPausedOnHover(true);
350350
}
@@ -357,7 +357,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
357357
);
358358

359359
const handleMouseOut = useCallback(
360-
event => {
360+
(event) => {
361361
setPausedOnHover(false);
362362

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

375375
const handleTouchStart = useCallback(
376-
event => {
376+
(event) => {
377377
touchStartXRef.current = event.touches[0].clientX;
378378
touchDeltaXRef.current = 0;
379379

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

391391
const handleTouchMove = useCallback(
392-
event => {
392+
(event) => {
393393
if (event.touches && event.touches.length > 1) {
394394
touchDeltaXRef.current = 0;
395395
} else {
@@ -405,7 +405,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
405405
);
406406

407407
const handleTouchEnd = useCallback(
408-
event => {
408+
(event) => {
409409
if (touch) {
410410
const touchDeltaX = touchDeltaXRef.current;
411411

@@ -454,7 +454,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
454454
const indicatorOnClicks = useMemo(
455455
() =>
456456
indicators &&
457-
Array.from({ length: numChildren }, (_, index) => event => {
457+
Array.from({ length: numChildren }, (_, index) => (event) => {
458458
onSelect(index, event);
459459
}),
460460
[indicators, numChildren, onSelect],
@@ -500,7 +500,7 @@ const Carousel = React.forwardRef((uncontrolledProps, ref) => {
500500
onEntered={isActive ? handleEntered : null}
501501
addEndListener={transitionEnd}
502502
>
503-
{status =>
503+
{(status) =>
504504
React.cloneElement(child, {
505505
className: classNames(
506506
child.props.className,

src/Col.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const Col = React.forwardRef(
7777
const spans = [];
7878
const classes = [];
7979

80-
DEVICE_SIZES.forEach(brkPoint => {
80+
DEVICE_SIZES.forEach((brkPoint) => {
8181
let propValue = props[brkPoint];
8282
delete props[brkPoint];
8383

src/Collapse.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,21 @@ class Collapse extends React.Component {
138138
}
139139

140140
/* -- Expanding -- */
141-
handleEnter = elem => {
141+
handleEnter = (elem) => {
142142
elem.style[this.getDimension()] = '0';
143143
};
144144

145-
handleEntering = elem => {
145+
handleEntering = (elem) => {
146146
const dimension = this.getDimension();
147147
elem.style[dimension] = this._getScrollDimensionValue(elem, dimension);
148148
};
149149

150-
handleEntered = elem => {
150+
handleEntered = (elem) => {
151151
elem.style[this.getDimension()] = null;
152152
};
153153

154154
/* -- Collapsing -- */
155-
handleExit = elem => {
155+
handleExit = (elem) => {
156156
const dimension = this.getDimension();
157157
elem.style[dimension] = `${this.props.getDimensionValue(
158158
dimension,
@@ -161,7 +161,7 @@ class Collapse extends React.Component {
161161
triggerBrowserReflow(elem);
162162
};
163163

164-
handleExiting = elem => {
164+
handleExiting = (elem) => {
165165
elem.style[this.getDimension()] = null;
166166
};
167167

src/DropdownItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const DropdownItem = React.forwardRef(
8383
? makeEventKey(activeKey) === key
8484
: propActive;
8585

86-
const handleClick = useEventCallback(event => {
86+
const handleClick = useEventCallback((event) => {
8787
// SafeAnchor handles the disabled case, but we handle it here
8888
// for other components
8989
if (disabled) return;

src/ElementChildren.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import React from 'react';
1111
function map(children, func) {
1212
let index = 0;
1313

14-
return React.Children.map(children, child =>
14+
return React.Children.map(children, (child) =>
1515
React.isValidElement(child) ? func(child, index++) : child,
1616
);
1717
}
@@ -24,7 +24,7 @@ function map(children, func) {
2424
*/
2525
function forEach(children, func) {
2626
let index = 0;
27-
React.Children.forEach(children, child => {
27+
React.Children.forEach(children, (child) => {
2828
if (React.isValidElement(child)) func(child, index++);
2929
});
3030
}

src/Fade.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const fadeStyles = {
7878

7979
const Fade = React.forwardRef(({ className, children, ...props }, ref) => {
8080
const handleEnter = useCallback(
81-
node => {
81+
(node) => {
8282
triggerBrowserReflow(node);
8383
if (props.onEnter) props.onEnter(node);
8484
},

src/InputGroup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ const InputGroupText = createWithBsPrefix('input-group-text', {
6464
Component: 'span',
6565
});
6666

67-
const InputGroupCheckbox = props => (
67+
const InputGroupCheckbox = (props) => (
6868
<InputGroupText>
6969
<input type="checkbox" {...props} />
7070
</InputGroupText>
7171
);
7272

73-
const InputGroupRadio = props => (
73+
const InputGroupRadio = (props) => (
7474
<InputGroupText>
7575
<input type="radio" {...props} />
7676
</InputGroupText>

src/ListGroupItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const ListGroupItem = React.forwardRef(
7272
bsPrefix = useBootstrapPrefix(bsPrefix, 'list-group-item');
7373

7474
const handleClick = useCallback(
75-
event => {
75+
(event) => {
7676
if (disabled) {
7777
event.preventDefault();
7878
event.stopPropagation();

src/Modal.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class Modal extends React.Component {
203203
removeEventListener(window, 'resize', this.handleWindowResize);
204204
}
205205

206-
setModalRef = ref => {
206+
setModalRef = (ref) => {
207207
this._modal = ref;
208208
};
209209

@@ -214,14 +214,14 @@ class Modal extends React.Component {
214214
this._waitingForMouseUp = true;
215215
};
216216

217-
handleMouseUp = e => {
217+
handleMouseUp = (e) => {
218218
if (this._waitingForMouseUp && e.target === this._modal.dialog) {
219219
this._ignoreBackdropClick = true;
220220
}
221221
this._waitingForMouseUp = false;
222222
};
223223

224-
handleClick = e => {
224+
handleClick = (e) => {
225225
if (this._ignoreBackdropClick || e.target !== e.currentTarget) {
226226
this._ignoreBackdropClick = false;
227227
return;
@@ -294,7 +294,7 @@ class Modal extends React.Component {
294294
});
295295
}
296296

297-
renderBackdrop = props => {
297+
renderBackdrop = (props) => {
298298
const { bsPrefix, backdropClassName, animation } = this.props;
299299

300300
return (

src/NavbarCollapse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const NavbarCollapse = React.forwardRef(
1515
bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-collapse');
1616
return (
1717
<NavbarContext.Consumer>
18-
{context => (
18+
{(context) => (
1919
<Collapse in={!!(context && context.expanded)} {...props}>
2020
<div ref={ref} className={bsPrefix}>
2121
{children}

src/NavbarToggle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const NavbarToggle = React.forwardRef(
4646

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

49-
const handleClick = useEventCallback(e => {
49+
const handleClick = useEventCallback((e) => {
5050
if (onClick) onClick(e);
5151
if (onToggle) onToggle();
5252
});

src/Overlay.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ function wrapRefs(props, arrowProps) {
115115
const { ref } = props;
116116
const { ref: aRef } = arrowProps;
117117

118-
props.ref = ref.__wrapped || (ref.__wrapped = r => ref(findDOMNode(r)));
118+
props.ref = ref.__wrapped || (ref.__wrapped = (r) => ref(findDOMNode(r)));
119119
arrowProps.ref =
120-
aRef.__wrapped || (aRef.__wrapped = r => aRef(findDOMNode(r)));
120+
aRef.__wrapped || (aRef.__wrapped = (r) => aRef(findDOMNode(r)));
121121
}
122122

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

0 commit comments

Comments
 (0)