Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ export default typescriptEslint.config(
},
rules: {
...eslintPluginReactHooks.configs.recommended.rules,
// react-hooks@7 promoted the react-compiler rules into recommended; treat the
// newly-introduced ones as warnings so they don't fail CI on working components
'react-hooks/refs': 'warn',
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/static-components': 'warn',
'@typescript-eslint/no-unused-expressions': [
'error',
{ allowShortCircuit: true, allowTernary: true },
],
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
setTimeout(() => {
if (count !== 0) {
// @ts-expect-error reflow is necessary to proper transition
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const reflow = carouselItemRef.current?.offsetHeight

const _reflow = carouselItemRef.current?.offsetHeight
setDirectionClassName(`carousel-item-${direction === 'next' ? 'start' : 'end'}`)
}
}, 0)
Expand All @@ -61,7 +61,7 @@
prevActive.current = active

if (count === 0) setCount(count + 1)
}, [active])

Check warning on line 64 in packages/coreui-react/src/components/carousel/CCarouselItem.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'count', 'direction', 'interval', and 'setCustomInterval'. Either include them or remove the dependency array. You can also do a functional update 'setCount(c => ...)' if you only need 'count' in the 'setCount' call

useEffect(() => {
const element = carouselItemRef.current
Expand Down Expand Up @@ -93,7 +93,7 @@
element.removeEventListener('transitionstart', handleTransitionStart)
element.removeEventListener('transitionend', handleTransitionEnd)
}
}, [active])

Check warning on line 96 in packages/coreui-react/src/components/carousel/CCarouselItem.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'setAnimating'. Either include it or remove the dependency array

return (
<div
Expand Down
4 changes: 2 additions & 2 deletions packages/coreui-react/src/components/nav/CNavGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export const CNavGroup: PolymorphicRefForwardingComponent<'li', CNavGroupProps>

const onExiting = () => {
// @ts-expect-error reflow is necessary to get correct height of the element
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const reflow = navItemsRef.current?.offsetHeight

const _reflow = navItemsRef.current?.offsetHeight
setHeight(0)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/coreui-react/src/components/table/CTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, TableHTMLAttributes, useMemo } from 'react'
import React, { forwardRef, ReactNode, TableHTMLAttributes, useMemo } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'

Expand Down Expand Up @@ -210,7 +210,7 @@ export const CTable = forwardRef<HTMLTableElement, CTableProps>(
})}
key={index}
>
{item[colName]}
{item[colName] as ReactNode}
</CTableDataCell>
) : null
})}
Expand Down
3 changes: 2 additions & 1 deletion packages/coreui-react/src/components/table/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type FooterItem = {
}

export type Item = {
[key: string]: number | string | any
_cellProps?: Record<string, CTableDataCellProps | undefined>
_props?: CTableRowProps
[key: string]: unknown
}
2 changes: 1 addition & 1 deletion packages/coreui-react/src/components/tabs/CTabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const CTabList = forwardRef<HTMLDivElement, CTabListProps>(
) {
event.preventDefault()
const target = event.target as HTMLElement
// eslint-disable-next-line unicorn/prefer-spread

const items: HTMLElement[] = Array.from(
tabListRef.current.querySelectorAll('.nav-link:not(.disabled):not(:disabled)')
)
Expand Down
10 changes: 1 addition & 9 deletions packages/coreui-react/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'

export type Colors =
| 'primary'
| 'secondary'
| 'success'
| 'danger'
| 'warning'
| 'info'
| 'dark'
| 'light'
| string
'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string

export type Placements =
| 'auto'
Expand Down
Loading