diff --git a/frontend/src/App/SelectContext.tsx b/frontend/src/App/SelectContext.tsx index eca22c6c78..02a4123327 100644 --- a/frontend/src/App/SelectContext.tsx +++ b/frontend/src/App/SelectContext.tsx @@ -25,8 +25,7 @@ export type SelectContextAction = export type SelectDispatch = (action: SelectContextAction) => void; interface SelectProviderOptions { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - children: any; + children: React.ReactNode; items: Array; } diff --git a/frontend/src/Components/Error/ErrorBoundaryError.tsx b/frontend/src/Components/Error/ErrorBoundaryError.tsx index 1a4d71745d..6257d79624 100644 --- a/frontend/src/Components/Error/ErrorBoundaryError.tsx +++ b/frontend/src/Components/Error/ErrorBoundaryError.tsx @@ -53,9 +53,9 @@ function ErrorBoundaryError(props: Readonly) { {error ?
{error.message}
: null} {detailedError ? ( - detailedError.map((d, index) => { + detailedError.map((d) => { return ( -
+
{` at ${d.functionName} (${d.fileName}:${d.lineNumber}:${d.columnNumber})`}
); diff --git a/frontend/src/Components/Form/AutoSuggestInput.tsx b/frontend/src/Components/Form/AutoSuggestInput.tsx index 312fb0945d..3e31bbda0a 100644 --- a/frontend/src/Components/Form/AutoSuggestInput.tsx +++ b/frontend/src/Components/Form/AutoSuggestInput.tsx @@ -58,8 +58,7 @@ interface AutoSuggestInputProps extends Omit< onChange?: (change: InputChanged) => unknown; } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function AutoSuggestInput(props: AutoSuggestInputProps) { +function AutoSuggestInput(props: AutoSuggestInputProps) { const { // TODO: forwaredRef should be replaces with React.forwardRef forwardedRef, diff --git a/frontend/src/Components/Form/Form.tsx b/frontend/src/Components/Form/Form.tsx index 3883d569af..eb3fe0fcaf 100644 --- a/frontend/src/Components/Form/Form.tsx +++ b/frontend/src/Components/Form/Form.tsx @@ -21,17 +21,17 @@ function Form({
{validationErrors.length || validationWarnings.length ? (
- {validationErrors.map((error, index) => { + {validationErrors.map((error) => { return ( - + {error.errorMessage} ); })} - {validationWarnings.map((warning, index) => { + {validationWarnings.map((warning) => { return ( - + {warning.errorMessage} ); diff --git a/frontend/src/Components/Form/FormInputGroup.tsx b/frontend/src/Components/Form/FormInputGroup.tsx index 2ce93775dd..e3762d9eee 100644 --- a/frontend/src/Components/Form/FormInputGroup.tsx +++ b/frontend/src/Components/Form/FormInputGroup.tsx @@ -269,10 +269,10 @@ function FormInputGroup( {!checkInput && helpTexts ? (
- {helpTexts.map((text, index) => { + {helpTexts.map((text) => { return ( @@ -287,10 +287,12 @@ function FormInputGroup( {helpLink ? {translate('MoreInfo')} : null} - {errors.map((error, index) => { + {errors.map((error) => { + const message = + 'errorMessage' in error ? error.errorMessage : error.message; return 'errorMessage' in error ? ( ( /> ) : ( ( ); })} - {warnings.map((warning, index) => { + {warnings.map((warning) => { + const message = + 'errorMessage' in warning ? warning.errorMessage : warning.message; return 'errorMessage' in warning ? ( ( /> ) : ( {[...value, { key: '', value: '' }].map((v, index) => ( , V>( return ''; }, [value, values, isMultiSelect]); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const handleComputeMaxHeight = useCallback((data: any) => { + const handleComputeMaxHeight: ModifierFn = useCallback((data: Data) => { const windowHeight = window.innerHeight; - data.styles.maxHeight = windowHeight - MINIMUM_DISTANCE_FROM_EDGE; + data.styles.maxHeight = `${windowHeight - MINIMUM_DISTANCE_FROM_EDGE}px`; return data; }, []); diff --git a/frontend/src/Components/Loading/LoadingIndicator.tsx b/frontend/src/Components/Loading/LoadingIndicator.tsx index d0feeea08b..f341dba6a0 100644 --- a/frontend/src/Components/Loading/LoadingIndicator.tsx +++ b/frontend/src/Components/Loading/LoadingIndicator.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import React, { useMemo } from 'react'; import styles from './LoadingIndicator.css'; interface LoadingIndicatorProps { @@ -14,20 +14,24 @@ function LoadingIndicator({ size = 50, }: Readonly) { const sizeInPx = `${size}px`; - const width = sizeInPx; - const height = sizeInPx; + + const containerStyle = useMemo(() => ({ height: sizeInPx }), [sizeInPx]); + const rippleContainerStyle = useMemo( + () => ({ width: sizeInPx, height: sizeInPx }), + [sizeInPx] + ); return ( -
+
-
+
-
+
-
+
); diff --git a/frontend/src/Components/ProgressBar.tsx b/frontend/src/Components/ProgressBar.tsx index 01d064e7f5..797bc6cb98 100644 --- a/frontend/src/Components/ProgressBar.tsx +++ b/frontend/src/Components/ProgressBar.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import React, { useMemo } from 'react'; import { ColorImpairedConsumer } from 'App/ColorImpairedContext'; import { Kind } from 'Helpers/Props/kinds'; import { Size } from 'Helpers/Props/sizes'; @@ -35,6 +35,12 @@ function ProgressBar({ const progressText = text || progressPercent; const actualWidth = width ? `${width}px` : '100%'; + const widthStyle = useMemo(() => ({ width: actualWidth }), [actualWidth]); + const progressStyle = useMemo( + () => ({ width: progressPercent }), + [progressPercent] + ); + return ( {(enableColorImpairedMode) => { @@ -42,12 +48,12 @@ function ProgressBar({
{showText && width ? (
{progressText}
@@ -68,18 +74,15 @@ function ProgressBar({ aria-valuenow={Math.floor(progress)} aria-valuemin={0} aria-valuemax={100} - style={{ width: progressPercent }} + style={progressStyle} /> {showText ? (
-
+
{progressText}
diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.tsx b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.tsx index 50ddde9b98..118cdc83ad 100644 --- a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.tsx +++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.tsx @@ -376,8 +376,8 @@ function InteractiveImportRow(props: Readonly) { title={translate('ReleaseRejected')} body={
    - {rejections.map((rejection, index) => { - return
  • {rejection.reason}
  • ; + {rejections.map((rejection) => { + return
  • {rejection.reason}
  • ; })}
} diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.tsx b/frontend/src/InteractiveSearch/InteractiveSearchRow.tsx index f198ad27ae..c5fdcfc03d 100644 --- a/frontend/src/InteractiveSearch/InteractiveSearchRow.tsx +++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.tsx @@ -302,8 +302,8 @@ function InteractiveSearchRow(props: Readonly) { title={translate('IndexerFlags')} body={
    - {indexerFlags.map((flag, index) => { - return
  • {flag}
  • ; + {indexerFlags.map((flag) => { + return
  • {flag}
  • ; })}
} @@ -319,8 +319,8 @@ function InteractiveSearchRow(props: Readonly) { title={translate('ReleaseRejected')} body={
    - {rejections.map((rejection, index) => { - return
  • {rejection}
  • ; + {rejections.map((rejection) => { + return
  • {rejection}
  • ; })}
} diff --git a/frontend/src/Movie/IndexerFlags.tsx b/frontend/src/Movie/IndexerFlags.tsx index 73f07949f3..1af60bff4a 100644 --- a/frontend/src/Movie/IndexerFlags.tsx +++ b/frontend/src/Movie/IndexerFlags.tsx @@ -16,8 +16,8 @@ function IndexerFlags({ indexerFlags = 0 }: Readonly) { return flags.length ? (
    - {flags.map((flag, index) => { - return
  • {flag.name}
  • ; + {flags.map((flag) => { + return
  • {flag.name}
  • ; })}
) : null; diff --git a/frontend/src/MovieFile/Extras/ExtraFileDetailsPopover.tsx b/frontend/src/MovieFile/Extras/ExtraFileDetailsPopover.tsx index e10390ed31..293ee4f270 100644 --- a/frontend/src/MovieFile/Extras/ExtraFileDetailsPopover.tsx +++ b/frontend/src/MovieFile/Extras/ExtraFileDetailsPopover.tsx @@ -38,9 +38,9 @@ function ExtraFileDetailsPopover( title={translate('Tags')} body={
    - {details.map(({ name, value }, index) => { + {details.map(({ name, value }) => { return ( -
  • +
  • {name}: {value}
  • ); diff --git a/frontend/src/Settings/MediaManagement/RootFolder/AddRootFolder.tsx b/frontend/src/Settings/MediaManagement/RootFolder/AddRootFolder.tsx index dee012cc3f..4f903a188f 100644 --- a/frontend/src/Settings/MediaManagement/RootFolder/AddRootFolder.tsx +++ b/frontend/src/Settings/MediaManagement/RootFolder/AddRootFolder.tsx @@ -41,8 +41,12 @@ function AddRootFolder() {
      {Array.isArray(saveError.responseJSON) ? ( - saveError.responseJSON.map((e, index) => { - return
    • {e.errorMessage}
    • ; + saveError.responseJSON.map((e) => { + return ( +
    • + {e.errorMessage} +
    • + ); }) ) : (
    • {JSON.stringify(saveError.responseJSON)}
    • diff --git a/frontend/src/Settings/Tags/AutoTagging/AutoTagging.tsx b/frontend/src/Settings/Tags/AutoTagging/AutoTagging.tsx index 72e4f5ea74..f4c8603002 100644 --- a/frontend/src/Settings/Tags/AutoTagging/AutoTagging.tsx +++ b/frontend/src/Settings/Tags/AutoTagging/AutoTagging.tsx @@ -83,7 +83,7 @@ export default function AutoTagging({
      - {specifications.map((item, index) => { + {specifications.map((item) => { if (!item) { return null; } @@ -98,7 +98,7 @@ export default function AutoTagging({ } return ( -