Continue ESLINT9 Migration (#13795)

Might already fix #13793
This commit is contained in:
Félix Malfait
2025-08-10 23:25:58 +02:00
committed by GitHub
parent df68cf98d4
commit 464a480043
2549 changed files with 6262 additions and 5481 deletions
@@ -1,7 +1,7 @@
import { MobileBreadcrumb } from '@/ui/navigation/bread-crumb/components/MobileBreadcrumb';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import styled from '@emotion/styled';
import { Fragment, ReactNode } from 'react';
import { Fragment, type ReactNode } from 'react';
import { Link } from 'react-router-dom';
export type BreadcrumbProps = {
@@ -2,7 +2,7 @@ import { useOpenSettingsMenu } from '@/navigation/hooks/useOpenSettings';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { isNonEmptyString } from '@sniptt/guards';
import { ReactNode } from 'react';
import { type ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { IconChevronLeft } from 'twenty-ui/display';
@@ -1,4 +1,4 @@
import { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { Breadcrumb } from '../Breadcrumb';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
@@ -1,15 +1,15 @@
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { useTheme } from '@emotion/react';
import { Placement } from '@floating-ui/react';
import { FunctionComponent, MouseEvent, ReactElement, ReactNode } from 'react';
import { type Placement } from '@floating-ui/react';
import { type FunctionComponent, type MouseEvent, type ReactElement, type ReactNode } from 'react';
import {
IconChevronRight,
IconComponent,
type IconComponent,
IconDotsVertical,
} from 'twenty-ui/display';
import { LightIconButton, LightIconButtonProps } from 'twenty-ui/input';
import { LightIconButton, type LightIconButtonProps } from 'twenty-ui/input';
import {
MenuItemAccent,
type MenuItemAccent,
MenuItemLeftContent,
StyledHoverableMenuItemBase,
StyledMenuItemLeftContent,
@@ -1,4 +1,4 @@
import { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
import { ComponentDecorator } from 'twenty-ui/testing';
@@ -19,7 +19,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { MULTI_WORKSPACE_DROPDOWN_ID } from '@/ui/navigation/navigation-drawer/constants/MultiWorkspaceDropdownId';
import { multiWorkspaceDropdownState } from '@/ui/navigation/navigation-drawer/states/multiWorkspaceDropdownState';
import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';
import { ApolloError } from '@apollo/client';
import { type ApolloError } from '@apollo/client';
import styled from '@emotion/styled';
import { useLingui } from '@lingui/react/macro';
import { useRecoilValue, useSetRecoilState } from 'recoil';
@@ -38,7 +38,7 @@ import {
UndecoratedLink,
} from 'twenty-ui/navigation';
import {
AvailableWorkspace,
type AvailableWorkspace,
useSignUpInNewWorkspaceMutation,
} from '~/generated-metadata/graphql';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
@@ -35,7 +35,7 @@ export const MultiWorkspaceDropdownThemesComponents = () => {
<MenuItem
key={theme.id}
LeftIcon={theme.icon}
/* eslint-disable-next-line lingui/no-expression-in-message */
text={t`${theme.id}`}
onClick={() => setColorScheme(theme.id)}
RightIcon={theme.id === colorScheme ? IconCheck : undefined}
@@ -1,7 +1,7 @@
import { Avatar } from 'twenty-ui/display';
import { MenuItemSelectAvatar, UndecoratedLink } from 'twenty-ui/navigation';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
import { AvailableWorkspace } from '~/generated/graphql';
import { type AvailableWorkspace } from '~/generated/graphql';
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
import { getAvailableWorkspacePathAndSearchParams } from '@/auth/utils/availableWorkspacesUtils';
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { motion } from 'framer-motion';
import { ReactNode, useState } from 'react';
import { type ReactNode, useState } from 'react';
import { useRecoilValue } from 'recoil';
import { NAV_DRAWER_WIDTHS } from '@/ui/navigation/navigation-drawer/constants/NavDrawerWidths';
@@ -2,7 +2,7 @@ import { useIsSettingsPage } from '@/navigation/hooks/useIsSettingsPage';
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { AnimationControls, motion, TargetAndTransition } from 'framer-motion';
import { type AnimationControls, motion, type TargetAndTransition } from 'framer-motion';
import { useRecoilValue } from 'recoil';
const StyledAnimatedContainer = styled(motion.span)`
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import { type ReactNode } from 'react';
import { useIsSettingsDrawer } from '@/navigation/hooks/useIsSettingsDrawer';
import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSection';
@@ -4,10 +4,10 @@ import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
import { FocusEvent, useRef } from 'react';
import { type FocusEvent, useRef } from 'react';
import { Key } from 'ts-key-enum';
import { isDefined } from 'twenty-shared/utils';
import { IconComponent, TablerIconsProps } from 'twenty-ui/display';
import { type IconComponent, type TablerIconsProps } from 'twenty-ui/display';
type NavigationDrawerInputProps = {
className?: string;
@@ -3,26 +3,26 @@ import { NavigationDrawerAnimatedCollapseWrapper } from '@/ui/navigation/navigat
import { NavigationDrawerItemBreadcrumb } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItemBreadcrumb';
import { NAV_DRAWER_WIDTHS } from '@/ui/navigation/navigation-drawer/constants/NavDrawerWidths';
import { useNavigationDrawerTooltip } from '@/ui/navigation/navigation-drawer/hooks/useNavigationDrawerTooltip';
import { NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';
import { type NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import isPropValid from '@emotion/is-prop-valid';
import { css, useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { ReactNode } from 'react';
import { type ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { useRecoilState } from 'recoil';
import { Pill } from 'twenty-ui/components';
import {
AppTooltip,
IconComponent,
type IconComponent,
Label,
TablerIconsProps,
type TablerIconsProps,
TooltipDelay,
TooltipPosition,
} from 'twenty-ui/display';
import { MOBILE_VIEWPORT } from 'twenty-ui/theme';
import { TriggerEventType, useMouseDownNavigation } from 'twenty-ui/utilities';
import { type TriggerEventType, useMouseDownNavigation } from 'twenty-ui/utilities';
const DEFAULT_INDENTATION_LEVEL = 1;
@@ -1,4 +1,4 @@
import { NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';
import { type NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';
import styled from '@emotion/styled';
export type NavigationDrawerItemBreadcrumbProps = {
@@ -2,8 +2,8 @@ import { useIsSettingsPage } from '@/navigation/hooks/useIsSettingsPage';
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { AnimationControls, motion, TargetAndTransition } from 'framer-motion';
import { ReactNode } from 'react';
import { type AnimationControls, motion, type TargetAndTransition } from 'framer-motion';
import { type ReactNode } from 'react';
import { useRecoilValue } from 'recoil';
const StyledAnimationGroupContainer = styled(motion.div)``;
@@ -1,7 +1,7 @@
import { useIsSettingsDrawer } from '@/navigation/hooks/useIsSettingsDrawer';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import styled from '@emotion/styled';
import { ReactNode } from 'react';
import { type ReactNode } from 'react';
import { useIsMobile } from 'twenty-ui/utilities';
const StyledItemsContainer = styled.div`
@@ -1,6 +1,6 @@
import {
NavigationDrawerItem,
NavigationDrawerItemProps,
type NavigationDrawerItemProps,
} from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
type NavigationDrawerSubItemProps = NavigationDrawerItemProps;
@@ -1,5 +1,5 @@
import { expect } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { within } from '@storybook/test';
import { useEffect } from 'react';
import { useSetRecoilState } from 'recoil';
@@ -1,4 +1,4 @@
import { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { NavigationDrawerCollapseButton } from '../NavigationDrawerCollapseButton';
import { ComponentDecorator } from 'twenty-ui/testing';
@@ -1,8 +1,8 @@
import styled from '@emotion/styled';
import { Meta, StoryObj } from '@storybook/react';
import { type Meta, type StoryObj } from '@storybook/react';
import { IconSearch } from 'twenty-ui/display';
import { CatalogDecorator, CatalogStory } from 'twenty-ui/testing';
import { CatalogDecorator, type CatalogStory } from 'twenty-ui/testing';
import { getOsControlSymbol } from 'twenty-ui/utilities';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
import { MemoryRouterDecorator } from '~/testing/decorators/MemoryRouterDecorator';
@@ -1,6 +1,6 @@
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useRecoilValue } from 'recoil';
import { AvailableWorkspace } from '~/generated/graphql';
import { type AvailableWorkspace } from '~/generated/graphql';
export const useFilteredAvailableWorkspaces = () => {
const currentWorkspace = useRecoilValue(currentWorkspaceState);
@@ -1,4 +1,4 @@
import { NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';
import { type NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';
export const getNavigationSubItemLeftAdornment = ({
index,
@@ -4,7 +4,7 @@ import React from 'react';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { MOBILE_VIEWPORT } from 'twenty-ui/theme';
import { Step, StepProps } from './Step';
import { Step, type StepProps } from './Step';
const StyledContainer = styled.div`
display: flex;