diff --git a/.prettierrc b/.prettierrc index 84d393d1..5989126d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,6 +3,7 @@ "trailingComma": "all", "printWidth": 100, "proseWrap": "never", + "arrowParens": "avoid", "overrides": [ { "files": ".prettierrc", diff --git a/src/TabNavList/index.tsx b/src/TabNavList/index.tsx index 3bf307c4..025567ec 100644 --- a/src/TabNavList/index.tsx +++ b/src/TabNavList/index.tsx @@ -168,7 +168,7 @@ function TabNavList(props: TabNavListProps, ref: React.Ref) { useTouchMove(tabsWrapperRef, (offsetX, offsetY) => { function doMove(setState: React.Dispatch>, offset: number) { - setState((value) => { + setState(value => { const newValue = alignInRange(value + offset); return newValue; @@ -299,7 +299,7 @@ function TabNavList(props: TabNavListProps, ref: React.Ref) { renderWrapper={children} removeAriaLabel={locale?.removeAriaLabel} ref={getBtnRef(key)} - onClick={(e) => { + onClick={e => { onTabClick(key, e); }} onRemove={() => { @@ -413,7 +413,7 @@ function TabNavList(props: TabNavListProps, ref: React.Ref) { // Should recalculate when rtl changed useEffect(() => { onListHolderResize(); - }, [rtl, tabBarGutter, activeKey, tabs.map((tab) => tab.key).join('_')]); + }, [rtl, tabBarGutter, activeKey, tabs.map(tab => tab.key).join('_')]); // ========================= Render ======================== const hasDropdown = !!hiddenTabs.length; diff --git a/src/interface.ts b/src/interface.ts index 4d7af0ce..da75b642 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -1,3 +1,4 @@ +import type { TabNavListProps } from './TabNavList'; import type { TabPaneProps } from './TabPanelList/TabPane'; export type TabSizeMap = Map< @@ -38,9 +39,12 @@ type RenderTabBarProps = { extra: TabBarExtraContent; style: React.CSSProperties; panes: React.ReactNode; -} +}; -export type RenderTabBar = (props: RenderTabBarProps, DefaultTabBar: React.ComponentType) => React.ReactElement; +export type RenderTabBar = ( + props: RenderTabBarProps, + DefaultTabBar: React.ComponentType, +) => React.ReactElement; export interface TabsLocale { dropdownAriaLabel?: string;