mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: remove all warnings (#3055)
This commit is contained in:
		
							parent
							
								
									3387e6fc39
								
							
						
					
					
						commit
						377e0e9d3e
					
				| @ -150,7 +150,8 @@ | |||||||
|     "rules": { |     "rules": { | ||||||
|       "no-restricted-globals": "off", |       "no-restricted-globals": "off", | ||||||
|       "no-useless-computed-key": "off", |       "no-useless-computed-key": "off", | ||||||
|       "import/no-anonymous-default-export": "off" |       "import/no-anonymous-default-export": "off", | ||||||
|  |       "react-hooks/exhaustive-deps": "off" | ||||||
|     }, |     }, | ||||||
|     "ignorePatterns": [ |     "ignorePatterns": [ | ||||||
|       "cypress" |       "cypress" | ||||||
|  | |||||||
| @ -4,7 +4,6 @@ import cloneDeep from 'lodash.clonedeep'; | |||||||
| import useProjectRolePermissions from 'hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions'; | import useProjectRolePermissions from 'hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions'; | ||||||
| import useProjectRolesApi from 'hooks/api/actions/useProjectRolesApi/useProjectRolesApi'; | import useProjectRolesApi from 'hooks/api/actions/useProjectRolesApi/useProjectRolesApi'; | ||||||
| import { formatUnknownError } from 'utils/formatUnknownError'; | import { formatUnknownError } from 'utils/formatUnknownError'; | ||||||
| import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; |  | ||||||
| 
 | 
 | ||||||
| export interface ICheckedPermission { | export interface ICheckedPermission { | ||||||
|     [key: string]: IPermission; |     [key: string]: IPermission; | ||||||
| @ -24,7 +23,6 @@ const useProjectRoleForm = ( | |||||||
|     initialRoleDesc = '', |     initialRoleDesc = '', | ||||||
|     initialCheckedPermissions: IPermission[] = [] |     initialCheckedPermissions: IPermission[] = [] | ||||||
| ) => { | ) => { | ||||||
|     const { uiConfig } = useUiConfig(); |  | ||||||
|     const { permissions } = useProjectRolePermissions({ |     const { permissions } = useProjectRolePermissions({ | ||||||
|         revalidateIfStale: false, |         revalidateIfStale: false, | ||||||
|         revalidateOnReconnect: false, |         revalidateOnReconnect: false, | ||||||
|  | |||||||
| @ -219,13 +219,7 @@ export const ServiceAccountTokens = ({ | |||||||
|         tokens |         tokens | ||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|     const { |     const { headerGroups, rows, prepareRow, setHiddenColumns } = useTable( | ||||||
|         headerGroups, |  | ||||||
|         rows, |  | ||||||
|         prepareRow, |  | ||||||
|         state: { sortBy }, |  | ||||||
|         setHiddenColumns, |  | ||||||
|     } = useTable( |  | ||||||
|         { |         { | ||||||
|             columns, |             columns, | ||||||
|             data, |             data, | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| import { FC, VFC } from 'react'; | import { FC, VFC } from 'react'; | ||||||
| import { Box, Button, styled, Typography, useTheme } from '@mui/material'; | import { Box, Button, styled, Typography } from '@mui/material'; | ||||||
| import { DynamicSidebarModal } from 'component/common/SidebarModal/SidebarModal'; | import { DynamicSidebarModal } from 'component/common/SidebarModal/SidebarModal'; | ||||||
| import { PageContent } from 'component/common/PageContent/PageContent'; | import { PageContent } from 'component/common/PageContent/PageContent'; | ||||||
| import { PageHeader } from 'component/common/PageHeader/PageHeader'; | import { PageHeader } from 'component/common/PageHeader/PageHeader'; | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| import { Divider, styled, Tooltip } from '@mui/material'; | import { styled, Tooltip } from '@mui/material'; | ||||||
| import { ConstraintViewHeaderOperator } from './ConstraintViewHeaderOperator'; | import { ConstraintViewHeaderOperator } from './ConstraintViewHeaderOperator'; | ||||||
| import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | ||||||
| import { ConstraintAccordionViewHeaderSingleValue } from './ConstraintAccordionViewHeaderSingleValue'; | import { ConstraintAccordionViewHeaderSingleValue } from './ConstraintAccordionViewHeaderSingleValue'; | ||||||
|  | |||||||
| @ -1,7 +1,6 @@ | |||||||
| import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | ||||||
| import { styled } from '@mui/material'; | import { styled } from '@mui/material'; | ||||||
| import React, { useEffect, useMemo, useState } from 'react'; | import React, { useEffect, useMemo, useState } from 'react'; | ||||||
| import classnames from 'classnames'; |  | ||||||
| import { IConstraint } from 'interfaces/strategy'; | import { IConstraint } from 'interfaces/strategy'; | ||||||
| 
 | 
 | ||||||
| const StyledValuesSpan = styled('span')(({ theme }) => ({ | const StyledValuesSpan = styled('span')(({ theme }) => ({ | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ import { | |||||||
|     InputLabel, |     InputLabel, | ||||||
|     SelectChangeEvent, |     SelectChangeEvent, | ||||||
|     styled, |     styled, | ||||||
|     Box, |  | ||||||
| } from '@mui/material'; | } from '@mui/material'; | ||||||
| import { | import { | ||||||
|     Operator, |     Operator, | ||||||
| @ -17,7 +16,6 @@ import { | |||||||
| } from 'constants/operators'; | } from 'constants/operators'; | ||||||
| import React, { useState } from 'react'; | import React, { useState } from 'react'; | ||||||
| import { formatOperatorDescription } from 'component/common/ConstraintAccordion/ConstraintOperator/formatOperatorDescription'; | import { formatOperatorDescription } from 'component/common/ConstraintAccordion/ConstraintOperator/formatOperatorDescription'; | ||||||
| import classNames from 'classnames'; |  | ||||||
| 
 | 
 | ||||||
| interface IConstraintOperatorSelectProps { | interface IConstraintOperatorSelectProps { | ||||||
|     options: Operator[]; |     options: Operator[]; | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| import { FormControl, styled, Typography } from '@mui/material'; | import { styled, Typography } from '@mui/material'; | ||||||
| interface IDividerTextProps { | interface IDividerTextProps { | ||||||
|     text: string; |     text: string; | ||||||
| } | } | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/perm | |||||||
| import { Dialogue } from 'component/common/Dialogue/Dialogue'; | import { Dialogue } from 'component/common/Dialogue/Dialogue'; | ||||||
| import PermissionButton from '../PermissionButton/PermissionButton'; | import PermissionButton from '../PermissionButton/PermissionButton'; | ||||||
| import { formatCreateStrategyPath } from 'component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate'; | import { formatCreateStrategyPath } from 'component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate'; | ||||||
| import { FormControl, styled } from '@mui/material'; | import { styled } from '@mui/material'; | ||||||
| 
 | 
 | ||||||
| interface IEnvironmentStrategyDialogProps { | interface IEnvironmentStrategyDialogProps { | ||||||
|     open: boolean; |     open: boolean; | ||||||
|  | |||||||
| @ -53,6 +53,7 @@ interface IMessageFlag { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // TODO: Grab a real feature flag instead
 | // TODO: Grab a real feature flag instead
 | ||||||
|  | /* eslint-disable @typescript-eslint/no-unused-vars */ | ||||||
| const mockFlag: IMessageFlag = { | const mockFlag: IMessageFlag = { | ||||||
|     enabled: true, |     enabled: true, | ||||||
|     message: |     message: | ||||||
|  | |||||||
| @ -63,12 +63,12 @@ const PremiumFeatures = { | |||||||
|     }, |     }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| type PremiumFeature = keyof typeof PremiumFeatures; | type PremiumFeatureType = keyof typeof PremiumFeatures; | ||||||
| 
 | 
 | ||||||
| const UPGRADE_URL = 'https://www.getunleash.io/plans'; | const UPGRADE_URL = 'https://www.getunleash.io/plans'; | ||||||
| 
 | 
 | ||||||
| export interface PremiumFeatureProps { | export interface PremiumFeatureProps { | ||||||
|     feature: PremiumFeature; |     feature: PremiumFeatureType; | ||||||
|     tooltip?: boolean; |     tooltip?: boolean; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,5 +1,4 @@ | |||||||
| import { ComponentType, FC } from 'react'; | import { FC } from 'react'; | ||||||
| import { Link, styled, Typography } from '@mui/material'; |  | ||||||
| import { Link as RouterLink } from 'react-router-dom'; | import { Link as RouterLink } from 'react-router-dom'; | ||||||
| import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | ||||||
| import { Highlighter } from 'component/common/Highlighter/Highlighter'; | import { Highlighter } from 'component/common/Highlighter/Highlighter'; | ||||||
|  | |||||||
| @ -25,7 +25,6 @@ import { | |||||||
|     VisibilityOffOutlined, |     VisibilityOffOutlined, | ||||||
|     VisibilityOutlined, |     VisibilityOutlined, | ||||||
| } from '@mui/icons-material'; | } from '@mui/icons-material'; | ||||||
| import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; |  | ||||||
| import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | ||||||
| 
 | 
 | ||||||
| const StyledMenuList = styled(MenuList)(({ theme }) => ({ | const StyledMenuList = styled(MenuList)(({ theme }) => ({ | ||||||
| @ -59,8 +58,6 @@ export const EnvironmentActionCellPopover = ({ | |||||||
|     onClone, |     onClone, | ||||||
|     onDelete, |     onDelete, | ||||||
| }: IEnvironmentActionCellPopoverProps) => { | }: IEnvironmentActionCellPopoverProps) => { | ||||||
|     const { uiConfig } = useUiConfig(); |  | ||||||
| 
 |  | ||||||
|     const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null); |     const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null); | ||||||
| 
 | 
 | ||||||
|     const open = Boolean(anchorEl); |     const open = Boolean(anchorEl); | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||||
| import { Box, Button, styled } from '@mui/material'; | import { Box, styled } from '@mui/material'; | ||||||
| import { SectionSeparator } from 'component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/SectionSeparator/SectionSeparator'; | import { SectionSeparator } from 'component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/SectionSeparator/SectionSeparator'; | ||||||
| import useFeatureStrategyApi from 'hooks/api/actions/useFeatureStrategyApi/useFeatureStrategyApi'; | import useFeatureStrategyApi from 'hooks/api/actions/useFeatureStrategyApi/useFeatureStrategyApi'; | ||||||
| import useToast from 'hooks/useToast'; | import useToast from 'hooks/useToast'; | ||||||
|  | |||||||
| @ -33,8 +33,6 @@ import { FavoriteIconHeader } from 'component/common/Table/FavoriteIconHeader/Fa | |||||||
| import { useGlobalLocalStorage } from 'hooks/useGlobalLocalStorage'; | import { useGlobalLocalStorage } from 'hooks/useGlobalLocalStorage'; | ||||||
| import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns'; | import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns'; | ||||||
| import FileDownload from '@mui/icons-material/FileDownload'; | import FileDownload from '@mui/icons-material/FileDownload'; | ||||||
| import { Dialogue } from 'component/common/Dialogue/Dialogue'; |  | ||||||
| import GeneralSelect from 'component/common/GeneralSelect/GeneralSelect'; |  | ||||||
| import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments'; | import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments'; | ||||||
| import { ExportDialog } from './ExportDialog'; | import { ExportDialog } from './ExportDialog'; | ||||||
| import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; | import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| import { MouseEvent, useContext, useState, VFC } from 'react'; | import { MouseEvent, useState, VFC } from 'react'; | ||||||
| import { | import { | ||||||
|     IconButton, |     IconButton, | ||||||
|     ListItemIcon, |     ListItemIcon, | ||||||
|  | |||||||
| @ -88,7 +88,7 @@ export const FeatureOverviewSidePanelEnvironmentSwitches = ({ | |||||||
| 
 | 
 | ||||||
|                 const hasWarning = |                 const hasWarning = | ||||||
|                     environment.enabled && |                     environment.enabled && | ||||||
|                     variants.length == 0 && |                     variants.length === 0 && | ||||||
|                     someEnabledEnvironmentHasVariants; |                     someEnabledEnvironmentHasVariants; | ||||||
|                 return ( |                 return ( | ||||||
|                     <FeatureOverviewSidePanelEnvironmentSwitch |                     <FeatureOverviewSidePanelEnvironmentSwitch | ||||||
|  | |||||||
| @ -200,7 +200,7 @@ export const VariantForm = ({ | |||||||
|         const hasOnlyOneVariableVariant = |         const hasOnlyOneVariableVariant = | ||||||
|             variants.filter(variant => { |             variants.filter(variant => { | ||||||
|                 return variant.weightType === WeightType.VARIABLE; |                 return variant.weightType === WeightType.VARIABLE; | ||||||
|             }).length == 1; |             }).length === 1; | ||||||
| 
 | 
 | ||||||
|         return ( |         return ( | ||||||
|             atLeastOneFixedVariant && hasOnlyOneVariableVariant && isVariable |             atLeastOneFixedVariant && hasOnlyOneVariableVariant && isVariable | ||||||
|  | |||||||
| @ -18,6 +18,7 @@ const VariantsWarningTooltip = () => { | |||||||
|                     <a |                     <a | ||||||
|                         href="https://docs.getunleash.io/reference/feature-toggle-variants#the-disabled-variant" |                         href="https://docs.getunleash.io/reference/feature-toggle-variants#the-disabled-variant" | ||||||
|                         target="_blank" |                         target="_blank" | ||||||
|  |                         rel="noreferrer" | ||||||
|                     > |                     > | ||||||
|                         disabled variant |                         disabled variant | ||||||
|                     </a> |                     </a> | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| import { styled } from '@mui/material'; | import { styled } from '@mui/material'; | ||||||
| import { FileDropZone } from './FileDropZone'; | import { FileDropZone } from './FileDropZone'; | ||||||
| import React from 'react'; |  | ||||||
| 
 | 
 | ||||||
| export const StyledFileDropZone = styled(FileDropZone)(({ theme }) => ({ | export const StyledFileDropZone = styled(FileDropZone)(({ theme }) => ({ | ||||||
|     padding: theme.spacing(4, 2, 2, 2), |     padding: theme.spacing(4, 2, 2, 2), | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| import { Box, styled, Typography } from '@mui/material'; | import { Box, styled, Typography } from '@mui/material'; | ||||||
| import { ProjectStatsSchema } from 'openapi/models'; | import { ProjectStatsSchema } from 'openapi/models'; | ||||||
| import { object } from 'prop-types'; |  | ||||||
| import { StatusBox } from './StatusBox'; | import { StatusBox } from './StatusBox'; | ||||||
| 
 | 
 | ||||||
| const StyledBox = styled(Box)(({ theme }) => ({ | const StyledBox = styled(Box)(({ theme }) => ({ | ||||||
|  | |||||||
| @ -16,8 +16,6 @@ import { useFavoriteProjectsApi } from 'hooks/api/actions/useFavoriteProjectsApi | |||||||
| import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | ||||||
| import { FavoriteIconButton } from 'component/common/FavoriteIconButton/FavoriteIconButton'; | import { FavoriteIconButton } from 'component/common/FavoriteIconButton/FavoriteIconButton'; | ||||||
| import { DeleteProjectDialogue } from '../Project/DeleteProject/DeleteProjectDialogue'; | import { DeleteProjectDialogue } from '../Project/DeleteProject/DeleteProjectDialogue'; | ||||||
| import { styled } from '@mui/material'; |  | ||||||
| import { flexRow } from 'themes/themeStyles'; |  | ||||||
| import { | import { | ||||||
|     StyledProjectCard, |     StyledProjectCard, | ||||||
|     StyledDivHeader, |     StyledDivHeader, | ||||||
|  | |||||||
| @ -57,7 +57,6 @@ const ProjectEnvironmentList = () => { | |||||||
| 
 | 
 | ||||||
|     // api state
 |     // api state
 | ||||||
|     const { setToastData, setToastApiError } = useToast(); |     const { setToastData, setToastApiError } = useToast(); | ||||||
|     const { uiConfig } = useUiConfig(); |  | ||||||
|     const { environments, loading, error, refetchEnvironments } = |     const { environments, loading, error, refetchEnvironments } = | ||||||
|         useProjectEnvironments(projectId); |         useProjectEnvironments(projectId); | ||||||
|     const { project, refetch: refetchProject } = useProject(projectId); |     const { project, refetch: refetchProject } = useProject(projectId); | ||||||
|  | |||||||
| @ -9,16 +9,6 @@ import { styled } from '@mui/material'; | |||||||
| export type SegmentFormStep = 1 | 2; | export type SegmentFormStep = 1 | 2; | ||||||
| export type SegmentFormMode = 'create' | 'edit'; | export type SegmentFormMode = 'create' | 'edit'; | ||||||
| 
 | 
 | ||||||
| const Styled = styled('div')(({ theme }) => ({ |  | ||||||
|     display: 'flex', |  | ||||||
|     flexDirection: 'column', |  | ||||||
|     alignItems: 'center', |  | ||||||
|     justifyContent: 'center', |  | ||||||
|     margin: theme.spacing(6), |  | ||||||
|     marginLeft: 'auto', |  | ||||||
|     marginRight: 'auto', |  | ||||||
| })); |  | ||||||
| 
 |  | ||||||
| interface ISegmentProps { | interface ISegmentProps { | ||||||
|     name: string; |     name: string; | ||||||
|     description: string; |     description: string; | ||||||
|  | |||||||
| @ -76,7 +76,7 @@ export const NewUser = () => { | |||||||
|         } |         } | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     if (isValidToken === false && isValidInvite == false) { |     if (!isValidToken && !isValidInvite) { | ||||||
|         return ( |         return ( | ||||||
|             <NewUserWrapper loading={resetLoading || inviteLoading}> |             <NewUserWrapper loading={resetLoading || inviteLoading}> | ||||||
|                 <InvalidToken /> |                 <InvalidToken /> | ||||||
|  | |||||||
| @ -1,5 +1,4 @@ | |||||||
| import { FormEventHandler, useState, VFC } from 'react'; | import { FormEventHandler, useState, VFC } from 'react'; | ||||||
| import classnames from 'classnames'; |  | ||||||
| import { Button, styled, TextField } from '@mui/material'; | import { Button, styled, TextField } from '@mui/material'; | ||||||
| import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; | ||||||
| import { useNavigate } from 'react-router'; | import { useNavigate } from 'react-router'; | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| import { Alert, styled, Typography } from '@mui/material'; | import { styled, Typography } from '@mui/material'; | ||||||
| import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||||
| 
 | 
 | ||||||
| const StyledContainer = styled('div')(({ theme }) => ({ | const StyledContainer = styled('div')(({ theme }) => ({ | ||||||
|  | |||||||
| @ -10,7 +10,7 @@ export const useEnterpriseSWR = <Data = any, Error = any>( | |||||||
| ) => { | ) => { | ||||||
|     const { isEnterprise } = useUiConfig(); |     const { isEnterprise } = useUiConfig(); | ||||||
| 
 | 
 | ||||||
|     const result = useConditionalSWR( |     const result = useConditionalSWR<Data, Error>( | ||||||
|         isEnterprise(), |         isEnterprise(), | ||||||
|         fallback, |         fallback, | ||||||
|         key, |         key, | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import useSWR from 'swr'; |  | ||||||
| import { useCallback } from 'react'; | import { useCallback } from 'react'; | ||||||
| import { formatApiPath } from 'utils/formatPath'; | import { formatApiPath } from 'utils/formatPath'; | ||||||
| import handleErrorResponses from '../httpErrorResponseHandler'; | import handleErrorResponses from '../httpErrorResponseHandler'; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user