diff --git a/packages/react/src/ActionList/ActionList.examples.stories.tsx b/packages/react/src/ActionList/ActionList.examples.stories.tsx index 5baeed843be..28498adc788 100644 --- a/packages/react/src/ActionList/ActionList.examples.stories.tsx +++ b/packages/react/src/ActionList/ActionList.examples.stories.tsx @@ -33,7 +33,8 @@ const meta: Meta = { export default meta const NextJSLikeLink = forwardRef( - ({href, children}: {href: string; children: React.ReactNode}, ref): React.ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ({href, children}: {href: string; children: React.ReactNode}, ref): React.ReactElement => { const child = React.Children.only(children) const childProps = { ref, diff --git a/packages/react/src/ActionList/ActionListContainerContext.tsx b/packages/react/src/ActionList/ActionListContainerContext.tsx index 9a2aca01b38..439ababd933 100644 --- a/packages/react/src/ActionList/ActionListContainerContext.tsx +++ b/packages/react/src/ActionList/ActionListContainerContext.tsx @@ -14,7 +14,8 @@ type ContextProps = { // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type afterSelect?: Function enableFocusZone?: boolean - defaultTrailingVisual?: React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + defaultTrailingVisual?: React.ReactElement } export const ActionListContainerContext = React.createContext({}) diff --git a/packages/react/src/ActionMenu/ActionMenu.test.tsx b/packages/react/src/ActionMenu/ActionMenu.test.tsx index af225bec3ce..d1c2971b327 100644 --- a/packages/react/src/ActionMenu/ActionMenu.test.tsx +++ b/packages/react/src/ActionMenu/ActionMenu.test.tsx @@ -53,7 +53,8 @@ function ExampleWithTooltip(): JSX.Element { ) } -function ExampleWithTooltipV2(actionMenuTrigger: React.ReactElement): JSX.Element { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function ExampleWithTooltipV2(actionMenuTrigger: React.ReactElement): JSX.Element { return ( diff --git a/packages/react/src/ActionMenu/ActionMenu.tsx b/packages/react/src/ActionMenu/ActionMenu.tsx index d159f98a329..7ed22316759 100644 --- a/packages/react/src/ActionMenu/ActionMenu.tsx +++ b/packages/react/src/ActionMenu/ActionMenu.tsx @@ -35,7 +35,8 @@ export type ActionMenuProps = { /** * Recommended: `ActionMenu.Button` or `ActionMenu.Anchor` with `ActionMenu.Overlay` */ - children: React.ReactElement[] | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + children: React.ReactElement[] | React.ReactElement /** * If defined, will control the open/closed state of the overlay. Must be used in conjunction with `onOpenChange`. @@ -179,11 +180,13 @@ const Menu: FCWithSlotMarker> = ({ ) } -export type ActionMenuAnchorProps = {children: React.ReactElement; id?: string} & React.HTMLAttributes +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type ActionMenuAnchorProps = {children: React.ReactElement; id?: string} & React.HTMLAttributes const Anchor: WithSlotMarker< React.ForwardRefExoticComponent< { - children: React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + children: React.ReactElement id?: string } & React.HTMLAttributes & React.RefAttributes diff --git a/packages/react/src/Autocomplete/AutocompleteMenu.tsx b/packages/react/src/Autocomplete/AutocompleteMenu.tsx index 12a9fab533d..bd987d0068d 100644 --- a/packages/react/src/Autocomplete/AutocompleteMenu.tsx +++ b/packages/react/src/Autocomplete/AutocompleteMenu.tsx @@ -19,9 +19,11 @@ import classes from './AutocompleteMenu.module.css' type OnSelectedChange = (item: T | T[]) => void export type AutocompleteMenuItem = MandateProps & { - leadingVisual?: React.FunctionComponent> | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + leadingVisual?: React.FunctionComponent> | React.ReactElement text?: string - trailingVisual?: React.FunctionComponent> | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + trailingVisual?: React.FunctionComponent> | React.ReactElement } const getDefaultSortFn = (isItemSelectedFn: (itemId: string) => boolean) => (itemIdA: string, itemIdB: string) => diff --git a/packages/react/src/Breadcrumbs/Breadcrumbs.tsx b/packages/react/src/Breadcrumbs/Breadcrumbs.tsx index f917d3c1ca0..5a59efe2f4c 100644 --- a/packages/react/src/Breadcrumbs/Breadcrumbs.tsx +++ b/packages/react/src/Breadcrumbs/Breadcrumbs.tsx @@ -41,7 +41,8 @@ const BreadcrumbsList = ({children}: React.PropsWithChildren) => { } type BreadcrumbsMenuItemProps = { - items: React.ReactElement[] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + items: React.ReactElement[] 'aria-label'?: string } @@ -141,7 +142,8 @@ const BreadcrumbsMenuItem = React.forwardRef { - return React.Children.toArray(children).filter(child => React.isValidElement(child)) as React.ReactElement[] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return React.Children.toArray(children).filter(child => React.isValidElement(child)) as React.ReactElement[] } function Breadcrumbs({className, children, style, overflow = 'wrap', variant = 'normal'}: BreadcrumbsProps) { @@ -166,10 +168,12 @@ function Breadcrumbs({className, children, style, overflow = 'wrap', variant = ' const rootItem = childArray[0] - const [visibleItems, setVisibleItems] = useState(() => childArray) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const [visibleItems, setVisibleItems] = useState[]>(() => childArray) const [childArrayWidths, setChildArrayWidths] = useState(() => []) - const [menuItems, setMenuItems] = useState([]) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const [menuItems, setMenuItems] = useState[]>([]) const [rootItemWidth, setRootItemWidth] = useState(0) const MENU_BUTTON_FALLBACK_WIDTH = 32 // Design system small IconButton @@ -203,7 +207,8 @@ function Breadcrumbs({className, children, style, overflow = 'wrap', variant = ' let currentVisibleItems = [...childArray] let currentVisibleItemWidths = [...childArrayWidths] - let currentMenuItems: React.ReactElement[] = [] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let currentMenuItems: React.ReactElement[] = [] let currentMenuItemsWidths: number[] = [] if (availableWidth > 0 && currentVisibleItemWidths.length > 0) { diff --git a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx index abdc253af3f..a76bdf2f950 100644 --- a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +++ b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx @@ -5,7 +5,8 @@ import userEvent from '@testing-library/user-event' import {FeatureFlags} from '../../FeatureFlags' // Helper function to render with theme and feature flags -const renderWithTheme = (component: React.ReactElement, flags?: Record) => { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const renderWithTheme = (component: React.ReactElement, flags?: Record) => { const wrappedComponent = flags ? {component} : <>{component} return HTMLRender(wrappedComponent) } diff --git a/packages/react/src/Button/ButtonBase.tsx b/packages/react/src/Button/ButtonBase.tsx index db96ec4c305..ba376b52eae 100644 --- a/packages/react/src/Button/ButtonBase.tsx +++ b/packages/react/src/Button/ButtonBase.tsx @@ -13,7 +13,8 @@ import classes from './ButtonBase.module.css' import {isElement} from 'react-is' const renderModuleVisual = ( - Visual: React.ElementType | React.ReactElement, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Visual: React.ElementType | React.ReactElement, loading: boolean, visualName: string, counterLabel: boolean, diff --git a/packages/react/src/Button/types.ts b/packages/react/src/Button/types.ts index 7afc46a10bf..6870562b516 100644 --- a/packages/react/src/Button/types.ts +++ b/packages/react/src/Button/types.ts @@ -58,17 +58,20 @@ export type ButtonProps = { /** * The icon for the IconButton */ - icon?: React.FunctionComponent | React.ElementType | React.ReactElement | null + // eslint-disable-next-line @typescript-eslint/no-explicit-any + icon?: React.FunctionComponent | React.ElementType | React.ReactElement | null /** * The leading visual which comes before the button content */ - leadingVisual?: React.ElementType | React.ReactElement | null + // eslint-disable-next-line @typescript-eslint/no-explicit-any + leadingVisual?: React.ElementType | React.ReactElement | null /** * The trailing visual which comes after the button content */ - trailingVisual?: React.ElementType | React.ReactElement | null + // eslint-disable-next-line @typescript-eslint/no-explicit-any + trailingVisual?: React.ElementType | React.ReactElement | null /** * Trailing action which comes after the trailing visual and is always the last element diff --git a/packages/react/src/Checkbox/Checkbox.tsx b/packages/react/src/Checkbox/Checkbox.tsx index d54c372cd80..a83bb60ccf6 100644 --- a/packages/react/src/Checkbox/Checkbox.tsx +++ b/packages/react/src/Checkbox/Checkbox.tsx @@ -43,7 +43,8 @@ const Checkbox = React.forwardRef( ( {checked, className, defaultChecked, indeterminate, disabled, onChange, required, validationStatus, value, ...rest}, ref, - ): ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): ReactElement => { const checkboxRef = useProvidedRefOrCreate(ref as React.RefObject) const checkboxGroupContext = useContext(CheckboxGroupContext) const handleOnChange: ChangeEventHandler = e => { diff --git a/packages/react/src/Details/Details.tsx b/packages/react/src/Details/Details.tsx index f493bf495e1..c9135b2db31 100644 --- a/packages/react/src/Details/Details.tsx +++ b/packages/react/src/Details/Details.tsx @@ -5,7 +5,8 @@ import classes from './Details.module.css' import {useMergedRefs} from '../internal/hooks/useMergedRefs' const Root = React.forwardRef( - ({className, children, ...rest}, forwardRef): ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ({className, children, ...rest}, forwardRef): ReactElement => { const detailsRef = React.useRef(null) const ref = useMergedRefs(forwardRef, detailsRef) diff --git a/packages/react/src/FilteredActionList/types.ts b/packages/react/src/FilteredActionList/types.ts index 68e0ca62458..7ae5343d46b 100644 --- a/packages/react/src/FilteredActionList/types.ts +++ b/packages/react/src/FilteredActionList/types.ts @@ -4,7 +4,8 @@ import type {Group} from '../ActionList/Group' import type {ActionListGroupProps} from '../deprecated' import type {AriaRole} from '../utils/types' -export type RenderItemFn = (props: FilteredActionListItemProps) => React.ReactElement +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type RenderItemFn = (props: FilteredActionListItemProps) => React.ReactElement export type ItemInput = | Merge, FilteredActionListItemProps> diff --git a/packages/react/src/NavList/NavList.features.stories.tsx b/packages/react/src/NavList/NavList.features.stories.tsx index 9bc8ecfa226..ce3420c4952 100644 --- a/packages/react/src/NavList/NavList.features.stories.tsx +++ b/packages/react/src/NavList/NavList.features.stories.tsx @@ -118,7 +118,8 @@ export const WithReactRouterLink = () => ( type NextJSLinkProps = {href: string; children: React.ReactNode} const NextJSLikeLink = React.forwardRef( - ({href, children}, ref): React.ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ({href, children}, ref): React.ReactElement => { const child = React.Children.only(children) const childProps = { ref, diff --git a/packages/react/src/NavList/NavList.test.tsx b/packages/react/src/NavList/NavList.test.tsx index 3965a1f987e..f91ddd2b82d 100644 --- a/packages/react/src/NavList/NavList.test.tsx +++ b/packages/react/src/NavList/NavList.test.tsx @@ -8,7 +8,8 @@ import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink' type NextJSLinkProps = {href: string; children: React.ReactNode} const NextJSLikeLink = React.forwardRef( - ({href, children}, ref): React.ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ({href, children}, ref): React.ReactElement => { const child = React.Children.only(children) const childProps = { ref, diff --git a/packages/react/src/NavList/NavList.tsx b/packages/react/src/NavList/NavList.tsx index e0bb35c1867..c00ef3813e0 100644 --- a/packages/react/src/NavList/NavList.tsx +++ b/packages/react/src/NavList/NavList.tsx @@ -158,7 +158,8 @@ function ItemWithSubNav({children, subNav, depth: _depth, defaultOpen, style}: I - {React.cloneElement(subNav as React.ReactElement, {ref: subNavRef})} + {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */} + {React.cloneElement(subNav as React.ReactElement, {ref: subNavRef})} ) diff --git a/packages/react/src/Overlay/Overlay.tsx b/packages/react/src/Overlay/Overlay.tsx index 399078d4e37..b2cf178ff32 100644 --- a/packages/react/src/Overlay/Overlay.tsx +++ b/packages/react/src/Overlay/Overlay.tsx @@ -106,7 +106,8 @@ export const BaseOverlay = React.forwardRef( ...rest }, forwardedRef, - ): ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): ReactElement => { return ( ( ...props }, forwardedRef, - ): ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): ReactElement => { const overlayRef = useRef(null) useRefObjectAsForwardedRef(forwardedRef, overlayRef) const slideAnimationDistance = 8 // var(--base-size-8), hardcoded to do some math diff --git a/packages/react/src/Radio/Radio.tsx b/packages/react/src/Radio/Radio.tsx index 16a98b94a53..8efa4501af1 100644 --- a/packages/react/src/Radio/Radio.tsx +++ b/packages/react/src/Radio/Radio.tsx @@ -51,7 +51,8 @@ const Radio = React.forwardRef( ...rest }: RadioProps, ref, - ): ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): ReactElement => { const radioGroupContext = useContext(RadioGroupContext) const handleOnChange: ChangeEventHandler = e => { radioGroupContext?.onChange && radioGroupContext.onChange(e) diff --git a/packages/react/src/SegmentedControl/SegmentedControl.figma.tsx b/packages/react/src/SegmentedControl/SegmentedControl.figma.tsx index 3b6b6598ed7..f99587819f5 100644 --- a/packages/react/src/SegmentedControl/SegmentedControl.figma.tsx +++ b/packages/react/src/SegmentedControl/SegmentedControl.figma.tsx @@ -44,7 +44,8 @@ figma.connect( { props: { selected: figma.enum('state', {selected: true}), - icon: figma.instance('icon').getProps<{name: string; fn: React.ReactElement}>(), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + icon: figma.instance('icon').getProps<{name: string; fn: React.ReactElement}>(), }, example: ({selected, icon}) => ( diff --git a/packages/react/src/SegmentedControl/SegmentedControl.tsx b/packages/react/src/SegmentedControl/SegmentedControl.tsx index 76d25fbb64c..51a24b7b61f 100644 --- a/packages/react/src/SegmentedControl/SegmentedControl.tsx +++ b/packages/react/src/SegmentedControl/SegmentedControl.tsx @@ -61,7 +61,8 @@ const Root: React.FC> = ({ ) ? React.Children.toArray(children)[selectedIndex] : undefined - const getChildIcon = (childArg: React.ReactNode): React.ReactElement | null => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const getChildIcon = (childArg: React.ReactNode): React.ReactElement | null => { if ( React.isValidElement(childArg) && (childArg.type === Button || isSlot(childArg, Button)) diff --git a/packages/react/src/SegmentedControl/SegmentedControlButton.tsx b/packages/react/src/SegmentedControl/SegmentedControlButton.tsx index 94803bb2152..e549b43dc87 100644 --- a/packages/react/src/SegmentedControl/SegmentedControlButton.tsx +++ b/packages/react/src/SegmentedControl/SegmentedControlButton.tsx @@ -16,9 +16,11 @@ export type SegmentedControlButtonProps = { /** Whether the segment is selected. This is used for uncontrolled `SegmentedControls` to pick one `SegmentedControlButton` that is selected on the initial render. */ defaultSelected?: boolean /** The leading visual comes before item label */ - leadingVisual?: React.FunctionComponent> | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + leadingVisual?: React.FunctionComponent> | React.ReactElement /** @deprecated Use `leadingVisual` instead. The leading icon comes before item label */ - leadingIcon?: React.FunctionComponent> | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + leadingIcon?: React.FunctionComponent> | React.ReactElement /** Optional counter to display on the right side of the button */ count?: number | string } & ButtonHTMLAttributes diff --git a/packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx b/packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx index ee70b240efd..230e32aa3b0 100644 --- a/packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx +++ b/packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx @@ -12,7 +12,8 @@ import type {FCWithSlotMarker} from '../utils/types' export type SegmentedControlIconButtonProps = { 'aria-label': string /** The icon that represents the segmented control item */ - icon: React.FunctionComponent> | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + icon: React.FunctionComponent> | React.ReactElement /** Whether the segment is selected. This is used for controlled SegmentedControls, and needs to be updated using the onChange handler on SegmentedControl. */ selected?: boolean /** Whether the segment is selected. This is used for uncontrolled SegmentedControls to pick one SegmentedControlButton that is selected on the initial render. */ diff --git a/packages/react/src/SelectPanel/SelectPanel.features.stories.tsx b/packages/react/src/SelectPanel/SelectPanel.features.stories.tsx index 448dcfc8f74..1147b1bbd74 100644 --- a/packages/react/src/SelectPanel/SelectPanel.features.stories.tsx +++ b/packages/react/src/SelectPanel/SelectPanel.features.stories.tsx @@ -43,7 +43,8 @@ const NoResultsMessage = (filter: string): {variant: 'empty'; title: string; bod } } -const EmptyMessage: {variant: 'empty'; title: string; body: React.ReactElement} = { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const EmptyMessage: {variant: 'empty'; title: string; body: React.ReactElement} = { variant: 'empty', title: `You haven't created any projects yet`, body: ( @@ -340,7 +341,8 @@ export const WithNotice = () => { const [open, setOpen] = useState(false) const [noticeVariant, setNoticeVariant] = useState(0) - const noticeVariants: Array<{text: string | React.ReactElement; variant: 'info' | 'warning' | 'error'}> = [ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const noticeVariants: Array<{text: string | React.ReactElement; variant: 'info' | 'warning' | 'error'}> = [ { variant: 'info', text: 'Try a different search term.', @@ -637,7 +639,8 @@ export const CustomisedNoInitialItems = () => { setIsError(!isError) }, [setIsError, isError]) - function getMessage(): {variant: 'empty' | 'error'; title: string; body: string | React.ReactElement} { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function getMessage(): {variant: 'empty' | 'error'; title: string; body: string | React.ReactElement} { if (isError) return ErrorMessage else if (filter) return NoResultsMessage(filter) else return EmptyMessage @@ -901,10 +904,12 @@ export const WithMessage = () => { | undefined | { title: string - body: string | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + body: string | React.ReactElement variant: 'empty' | 'error' | 'warning' icon?: React.ComponentType - action?: React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + action?: React.ReactElement } > = [ undefined, // Default message diff --git a/packages/react/src/SelectPanel/SelectPanel.tsx b/packages/react/src/SelectPanel/SelectPanel.tsx index cd99fc00bc2..4e5f84e5df5 100644 --- a/packages/react/src/SelectPanel/SelectPanel.tsx +++ b/packages/react/src/SelectPanel/SelectPanel.tsx @@ -75,8 +75,10 @@ export type SelectPanelSecondaryAction = interface SelectPanelBaseProps { // TODO: Make `title` required in the next major version - title?: string | React.ReactElement - subtitle?: string | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + title?: string | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + subtitle?: string | React.ReactElement onOpenChange: ( open: boolean, gesture: 'anchor-click' | 'anchor-key-press' | 'click-outside' | 'escape' | 'selection' | 'cancel', @@ -89,20 +91,24 @@ interface SelectPanelBaseProps { initialLoadingType?: InitialLoadingType className?: string notice?: { - text: string | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + text: string | React.ReactElement variant: 'info' | 'warning' | 'error' } message?: { title: string - body: string | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + body: string | React.ReactElement variant: 'empty' | 'error' | 'warning' icon?: React.ComponentType - action?: React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + action?: React.ReactElement } /** * @deprecated Use `secondaryAction` instead. */ - footer?: string | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + footer?: string | React.ReactElement showSelectedOptionsFirst?: boolean /** * Whether to disable fullscreen behavior on narrow viewports. diff --git a/packages/react/src/SelectPanel/SelectPanelMessage.tsx b/packages/react/src/SelectPanel/SelectPanelMessage.tsx index 23a1c171461..64fc56f1bf0 100644 --- a/packages/react/src/SelectPanel/SelectPanelMessage.tsx +++ b/packages/react/src/SelectPanel/SelectPanelMessage.tsx @@ -21,7 +21,8 @@ export type SelectPanelMessageProps = { * Ensure the action element is accessible by providing appropriate ARIA attributes * and making it keyboard-navigable. */ - action?: React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + action?: React.ReactElement } export const SelectPanelMessage: React.FC = ({ diff --git a/packages/react/src/Textarea/Textarea.tsx b/packages/react/src/Textarea/Textarea.tsx index 39d86684372..bf777977003 100644 --- a/packages/react/src/Textarea/Textarea.tsx +++ b/packages/react/src/Textarea/Textarea.tsx @@ -71,7 +71,8 @@ const Textarea = React.forwardRef( ...rest }: TextareaProps, ref, - ): ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ): ReactElement => { return ( ) -function ExampleWithActionMenu(actionMenuTrigger: React.ReactElement): JSX.Element { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function ExampleWithActionMenu(actionMenuTrigger: React.ReactElement): JSX.Element { return ( diff --git a/packages/react/src/UnderlineNav/UnderlineNav.tsx b/packages/react/src/UnderlineNav/UnderlineNav.tsx index 2f6386c9a47..c0a252d3ffe 100644 --- a/packages/react/src/UnderlineNav/UnderlineNav.tsx +++ b/packages/react/src/UnderlineNav/UnderlineNav.tsx @@ -43,7 +43,8 @@ const MORE_BTN_HEIGHT = 45 const overflowEffect = ( navWidth: number, moreMenuWidth: number, - childArray: Array, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + childArray: Array>, childWidthArray: ChildWidthArray, noIconChildWidthArray: ChildWidthArray, updateListAndMenu: (props: ResponsiveProps, iconsVisible: boolean) => void, @@ -60,8 +61,10 @@ const overflowEffect = ( navWidth, moreMenuWidth || MORE_BTN_WIDTH, ) - const items: Array = [] - const menuItems: Array = [] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const items: Array> = [] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const menuItems: Array> = [] // First, we check if we can fit all the items with their icons if (childArray.length <= numberOfItemsPossible) { @@ -105,7 +108,8 @@ const overflowEffect = ( } export const getValidChildren = (children: React.ReactNode) => { - return React.Children.toArray(children).filter(child => React.isValidElement(child)) as React.ReactElement[] + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return React.Children.toArray(children).filter(child => React.isValidElement(child)) as React.ReactElement[] } const calculatePossibleItems = (childWidthArray: ChildWidthArray, navWidth: number, moreMenuWidth = 0) => { @@ -201,7 +205,8 @@ export const UnderlineNav = forwardRef( } const swapMenuItemWithListItem = ( - prospectiveListItem: React.ReactElement, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + prospectiveListItem: React.ReactElement, indexOfProspectiveListItem: number, event: React.MouseEvent | React.KeyboardEvent, callback: (props: ResponsiveProps, displayIcons: boolean) => void, diff --git a/packages/react/src/UnderlineNav/UnderlineNavItem.tsx b/packages/react/src/UnderlineNav/UnderlineNavItem.tsx index 963f7c033f1..dde70d1c9f9 100644 --- a/packages/react/src/UnderlineNav/UnderlineNavItem.tsx +++ b/packages/react/src/UnderlineNav/UnderlineNavItem.tsx @@ -36,7 +36,8 @@ export type UnderlineNavItemProps = { /** * Icon before the text */ - icon?: React.FunctionComponent | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + icon?: React.FunctionComponent | React.ReactElement /** * Renders `UnderlineNav.Item` as given component i.e. react-router's Link **/ diff --git a/packages/react/src/UnderlineNav/types.ts b/packages/react/src/UnderlineNav/types.ts index 55c2e7318c9..8e50e5582f0 100644 --- a/packages/react/src/UnderlineNav/types.ts +++ b/packages/react/src/UnderlineNav/types.ts @@ -4,6 +4,8 @@ export type ChildSize = { } export type ChildWidthArray = Array export type ResponsiveProps = { - items: Array - menuItems: Array + // eslint-disable-next-line @typescript-eslint/no-explicit-any + items: Array> + // eslint-disable-next-line @typescript-eslint/no-explicit-any + menuItems: Array> } diff --git a/packages/react/src/deprecated/ActionList/List.tsx b/packages/react/src/deprecated/ActionList/List.tsx index 46c559dd374..635ffc6c122 100644 --- a/packages/react/src/deprecated/ActionList/List.tsx +++ b/packages/react/src/deprecated/ActionList/List.tsx @@ -10,7 +10,8 @@ import {clsx} from 'clsx' import type {Merge} from '../../utils/types/Merge' import classes from './List.module.css' -export type RenderItemFn = (props: ItemProps) => React.ReactElement +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type RenderItemFn = (props: ItemProps) => React.ReactElement export type ItemInput = | Merge, ItemProps> diff --git a/packages/react/src/experimental/SelectPanel2/SelectPanel.tsx b/packages/react/src/experimental/SelectPanel2/SelectPanel.tsx index f1fd2fcc16b..a8ae8ee2e14 100644 --- a/packages/react/src/experimental/SelectPanel2/SelectPanel.tsx +++ b/packages/react/src/experimental/SelectPanel2/SelectPanel.tsx @@ -116,7 +116,8 @@ const Panel: React.FC = ({ // 🚨 Hack for good API! // we strip out Anchor from children and wire it up to Dialog // with additional props for accessibility - let Anchor: React.ReactElement | undefined + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let Anchor: React.ReactElement | undefined const anchorRef = useProvidedRefOrCreate(providedAnchorRef) const onAnchorClick = () => { diff --git a/packages/react/src/internal/components/UnderlineTabbedInterface.tsx b/packages/react/src/internal/components/UnderlineTabbedInterface.tsx index 7516a0cd4f1..a6fa4bee785 100644 --- a/packages/react/src/internal/components/UnderlineTabbedInterface.tsx +++ b/packages/react/src/internal/components/UnderlineTabbedInterface.tsx @@ -51,7 +51,8 @@ export type UnderlineItemProps = { iconsVisible?: boolean loadingCounters?: boolean counter?: number | string - icon?: FC | React.ReactElement + // eslint-disable-next-line @typescript-eslint/no-explicit-any + icon?: FC | React.ReactElement id?: string ref?: React.Ref } & React.ComponentPropsWithoutRef diff --git a/packages/react/src/stories/deprecated/ActionList.stories.tsx b/packages/react/src/stories/deprecated/ActionList.stories.tsx index 40ad442547d..444d838d94c 100644 --- a/packages/react/src/stories/deprecated/ActionList.stories.tsx +++ b/packages/react/src/stories/deprecated/ActionList.stories.tsx @@ -348,7 +348,8 @@ export function SizeStressTestingStory(): JSX.Element { SizeStressTestingStory.storyName = 'Size Stress Testing' const NextJSLikeLink = forwardRef( - ({href, children}: {href: string; children: React.ReactNode}, ref): React.ReactElement => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ({href, children}: {href: string; children: React.ReactNode}, ref): React.ReactElement => { const child = React.Children.only(children) const childProps = { ref, diff --git a/packages/react/src/utils/polymorphic.ts b/packages/react/src/utils/polymorphic.ts index 769d7c0cd2b..896d978947e 100644 --- a/packages/react/src/utils/polymorphic.ts +++ b/packages/react/src/utils/polymorphic.ts @@ -57,7 +57,7 @@ interface ForwardRefComponent< : As extends keyof JSX.IntrinsicElements ? Merge : never, - ): React.ReactElement | null + ): React.ReactElement | null } export type {ForwardRefComponent, OwnProps, IntrinsicElement, Merge}