8000 refactor: resolve eslint warnings · coreui/coreui-react@59f25ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 59f25ff

Browse files
committed
refactor: resolve eslint warnings
1 parent 2bc6a6b commit 59f25ff

File tree

9 files changed

+19
-18
lines changed

9 files changed

+19
-18
lines changed

packages/coreui-react/src/components/carousel/CCarousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export const CCarousel = forwardRef<HTMLDivElement, CCarouselProps>(
253253
!animating && handleIndicatorClick(index)
254254
}}
255255
className={classNames({
256-
active: active === index
256+
active: active === index,
257257
})}
258258
data-coreui-target=""
259259
{...(active === index && { 'aria-current': true })}

packages/coreui-react/src/components/close-button/CCloseButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface CCloseButtonProps extends HTMLAttributes<HTMLButtonElement> {
1717
disabled?: boolean
1818
/**
1919
* Change the default color to white.
20-
*
20+
*
2121
* @deprecated 5.0.0
2222
*/
2323
white?: boolean

packages/coreui-react/src/components/dropdown/CDropdown.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,16 @@ export const CDropdown = forwardRef<HTMLDivElement | HTMLLIElement, CDropdownPro
197197
}, [_visible])
198198

199199
const handleKeydown = (event: KeyboardEvent) => {
200-
if (_visible && dropdownMenuRef.current && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
200+
if (
201+
_visible &&
202+
dropdownMenuRef.current &&
203+
(event.key === 'ArrowDown' || event.key === 'ArrowUp')
204+
) {
201205
event.preventDefault()
202206
const target = event.target as HTMLElement
203-
const items: HTMLElement[] = Array.from(dropdownMenuRef.current.querySelectorAll('.dropdown-item:not(.disabled):not(:disabled)'))
207+
const items: HTMLElement[] = Array.from(
208+
dropdownMenuRef.current.querySelectorAll('.dropdown-item:not(.disabled):not(:disabled)'),
209+
)
204210
getNextActiveElement(items, target, event.key === 'ArrowDown', true).focus()
205211
}
206212
}

packages/coreui-react/src/components/dropdown/CDropdownMenu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useForkedRef } from '../../hooks'
99

1010
import { getAlignmentClassNames } from './utils'
1111

12-
1312
export interface CDropdownMenuProps extends HTMLAttributes<HTMLDivElement | HTMLUListElement> {
1413
/**
1514
* A string of all className you want applied to the base component.

packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
2020
custom?: boolean
2121
/**
2222
* If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button.
23-
*
23+
*
2424
* @since v5.0.0-beta.1
2525
*/
2626
navLink?: boolean

packages/coreui-react/src/components/dropdown/utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ import type { Alignments, Breakpoints } from './types'
55
export const getAlignmentClassNames = (alignment: Alignments) => {
66
const classNames: string[] = []
77
if (typeof alignment === 'object') {
8-
98
for (const key in alignment) {
10-
classNames.push(`dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key as keyof Breakpoints]}`)
9+
classNames.push(
10+
`dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key as keyof Breakpoints]}`,
11+
)
1112
}
1213
}
1314

1415
if (typeof alignment === 'string') {
1516
classNames.push(`dropdown-menu-${alignment}`)
1617
}
17-
18+
1819
return classNames
1920
}
2021

@@ -69,4 +70,4 @@ export const getPlacement = (
6970
}
7071

7172
return _placement
72-
}
73+
}

packages/coreui-react/src/components/widgets/CWidgetStatsA.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ export const CWidgetStatsA = forwardRef<HTMLDivElement, CWidgetStatsAProps>(
4040
({ action, chart, className, color, title, value, ...rest }, ref) => {
4141
return (
4242
<CCard
43-
className={classNames(
44-
{ [`bg-${color}`]: color, 'text-white': color },
45-
className,
46-
)}
43+
className={classNames({ [`bg-${color}`]: color, 'text-white': color }, className)}
4744
{...rest}
4845
ref={ref}
4946
>

packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ test('CWidgetStatsD customize', async () => {
4141
expect(container.firstChild.lastChild.firstChild.firstChild).toHaveClass('fw-semibold')
4242
expect(container.firstChild.lastChild.firstChild.firstChild).toHaveTextContent('89K')
4343
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('text-uppercase')
44-
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass(
45-
'text-body-secondary',
46-
)
44+
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('text-body-secondary')
4745
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('small')
4846
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveTextContent('friends')
4947
}

packages/coreui-react/src/utils/getTransitionDurationFromElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ const getTransitionDurationFromElement = (element: HTMLElement) => {
2121
return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * 1000
2222
}
2323

24-
export default getTransitionDurationFromElement
24+
export default getTransitionDurationFromElement

0 commit comments

Comments
 (0)
0