diff --git a/eslint.config.mjs b/eslint.config.mjs index 6a3ef44856..078b5d9c0c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -21,7 +21,9 @@ export default [ "src/core/cover-service-api/cover-service.ts", "src/core/dpl-cms/model", "src/core/dpl-cms/dpl-cms.ts", + "src/core/fbs/model", "src/core/fbs/fbs.ts", + "src/core/publizon/model", "src/core/publizon/publizon.ts", "postcss.config.js" ] @@ -33,7 +35,12 @@ export default [ "plugin:react-hooks/recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended", - "plugin:cypress/recommended" + "plugin:cypress/recommended", + "plugin:import/recommended", + "plugin:import/errors", + "plugin:import/warnings", + "plugin:import/typescript", + "plugin:jsx-a11y/recommended" ), { plugins: { @@ -65,7 +72,16 @@ export default [ react: { version: "detect" // Automatically detect the React version }, - "import/core-modules": ["vitest"] + "import/core-modules": ["vitest"], + "import/resolver": [ + "webpack", + { + node: { + extensions: [".ts", ".tsx", ".js", ".jsx"], + moduleDirectory: ["src", "node_modules"] + } + } + ] }, rules: { diff --git a/package.json b/package.json index 2fe3a086fb..ed8e1a0e7a 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "dotenv": "^16.4.7", "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-webpack": "^0.13.10", "eslint-loader": "^4.0.2", "eslint-plugin-cypress": "^4.1.0", "eslint-plugin-import": "^2.31.0", diff --git a/src/apps/dashboard/dashboard-notification-list/Notifications.tsx b/src/apps/dashboard/dashboard-notification-list/Notifications.tsx index 25deeb7bbc..f10b936368 100644 --- a/src/apps/dashboard/dashboard-notification-list/Notifications.tsx +++ b/src/apps/dashboard/dashboard-notification-list/Notifications.tsx @@ -34,8 +34,8 @@ const Notifications: FC = ({ if (isLoading && displayedNotifications.length === 0) { return ( <> - {[0, 1].map(() => { - return ; + {[0, 1].map((number) => { + return ; })} ); diff --git a/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.tsx b/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.tsx index d8d5279389..cc0063f278 100644 --- a/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.tsx +++ b/src/apps/favorites-list-material-component/FavoritesListMaterialComponent.tsx @@ -40,7 +40,12 @@ const FavoritesListMaterialComponent: FC = () => {
    {materials.map((pid) => ( - + ))}
diff --git a/src/apps/favorites-list/FavoritesList.tsx b/src/apps/favorites-list/FavoritesList.tsx index 81e275f01e..c917cc891a 100644 --- a/src/apps/favorites-list/FavoritesList.tsx +++ b/src/apps/favorites-list/FavoritesList.tsx @@ -51,8 +51,8 @@ const FavoritesList: React.FC = ({ pageSize }) => { {/* We'll show 5 skeleton cards which should cover most screens. */} - {[...Array(5)].map(() => ( -
  • + {[...Array(5)].map((_, index) => ( +
  • ))} diff --git a/src/apps/loan-list/list/loan-list-items.tsx b/src/apps/loan-list/list/loan-list-items.tsx index d50e8e8f1a..2be87fe25d 100644 --- a/src/apps/loan-list/list/loan-list-items.tsx +++ b/src/apps/loan-list/list/loan-list-items.tsx @@ -49,7 +49,7 @@ const LoanListItems: FC = ({ ); const loan = loansUniqueDueDate[0] || {}; return ( -
      +
        {loan && ( = ({ return ( <> {renewalStatusList && - renewalStatusList.map((text) => { + renewalStatusList.map((text, index) => { if (text !== "deniedOtherReason") { - return {getStatusText(text, t)}; + return ( + + {getStatusText(text, t)} + + ); } return null; })} diff --git a/src/apps/loan-list/materials/utils/digital-material-fetch-hoc.tsx b/src/apps/loan-list/materials/utils/digital-material-fetch-hoc.tsx index 0d854c404a..d7f1b87dd6 100644 --- a/src/apps/loan-list/materials/utils/digital-material-fetch-hoc.tsx +++ b/src/apps/loan-list/materials/utils/digital-material-fetch-hoc.tsx @@ -14,17 +14,13 @@ const fetchDigitalMaterial = Component: ComponentType

        , LoadingComponent?: ComponentType ): FC

        => + // TODO: rewrite the code below and remove the eslint-disable-next-line react/display-name comment + // eslint-disable-next-line react/display-name ({ item, ...props }: InputProps) => { // If this is a physical book, another HOC fetches the data and this // HOC just returns the component if (item.faust) { - return ( - - ); + return ; } if (item.identifier) { @@ -59,12 +55,7 @@ const fetchDigitalMaterial = if (!digitalMaterial) return null; return ( - + ); } return null; diff --git a/src/apps/loan-list/materials/utils/material-fetch-hoc.tsx b/src/apps/loan-list/materials/utils/material-fetch-hoc.tsx index d03baf9da9..19012003d4 100644 --- a/src/apps/loan-list/materials/utils/material-fetch-hoc.tsx +++ b/src/apps/loan-list/materials/utils/material-fetch-hoc.tsx @@ -23,17 +23,13 @@ const fetchMaterial = Component: ComponentType

        , FallbackComponent?: ComponentType ): FC

        => + // TODO: rewrite the code below and remove the eslint-disable-next-line react/display-name comment + // eslint-disable-next-line react/display-name ({ item, ...props }: InputProps) => { // If this is a digital book, another HOC fetches the data and this // HOC just returns the component if (item?.identifier) { - return ( - - ); + return ; } if (item?.faust) { @@ -77,14 +73,7 @@ const fetchMaterial = // in cases where the material is not found we return null, else we would load forever if (!material) return null; - return ( - - ); + return ; } return null; }; diff --git a/src/apps/material-grid/MaterialGrid.tsx b/src/apps/material-grid/MaterialGrid.tsx index 8f5f741341..6fd23f7606 100644 --- a/src/apps/material-grid/MaterialGrid.tsx +++ b/src/apps/material-grid/MaterialGrid.tsx @@ -60,7 +60,6 @@ const MaterialGrid: React.FC = ({ } if (!materials.length) { - // eslint-disable-next-line no-console console.warn(`No materials to show for MaterialGrid: ${title}`); return null; } diff --git a/src/apps/material-grid/MaterialGridSkeleton.tsx b/src/apps/material-grid/MaterialGridSkeleton.tsx index 33ed8d401b..193aa919b5 100644 --- a/src/apps/material-grid/MaterialGridSkeleton.tsx +++ b/src/apps/material-grid/MaterialGridSkeleton.tsx @@ -10,8 +10,8 @@ const MaterialGridSkeleton: FC = ({ title }) => {

        {title &&
        {title}
        }
        - {[...Array(4)].map(() => ( -
        + {[...Array(4)].map((_, index) => ( +
        ))} diff --git a/src/apps/material-search/MaterialSearch.stories.tsx b/src/apps/material-search/MaterialSearch.stories.tsx index ec1c26a577..4233734033 100644 --- a/src/apps/material-search/MaterialSearch.stories.tsx +++ b/src/apps/material-search/MaterialSearch.stories.tsx @@ -76,7 +76,6 @@ const MaterialSearchHiddenInputs = ({ />
        - {/* eslint-disable-next-line react/jsx-props-no-spreading */}
        ); @@ -247,7 +246,6 @@ export const WithPreviouslySelectedValues: Story = { const defaultMaterialType = previouslySelectedMaterialType; const modifiedProps = { ...args, defaultWorkId, defaultMaterialType }; - // eslint-disable-next-line react/jsx-props-no-spreading return ; } }; @@ -261,7 +259,6 @@ export const materialWithInvalidType: Story = { const defaultMaterialType = "invalid-type"; const modifiedProps = { ...args, defaultWorkId, defaultMaterialType }; - // eslint-disable-next-line react/jsx-props-no-spreading return ; } }; @@ -275,7 +272,6 @@ export const materialWithInvalidWorkId: Story = { const defaultMaterialType = previouslySelectedMaterialType; const modifiedProps = { ...args, defaultWorkId, defaultMaterialType }; - // eslint-disable-next-line react/jsx-props-no-spreading return ; } }; diff --git a/src/apps/material-search/useGetHiddenInputs.tsx b/src/apps/material-search/useGetHiddenInputs.tsx index d70fd53cdf..4309cb5df8 100644 --- a/src/apps/material-search/useGetHiddenInputs.tsx +++ b/src/apps/material-search/useGetHiddenInputs.tsx @@ -24,7 +24,6 @@ const useGetHiddenInputs = (uniqueIdentifier: string): HiddenInputsResult => { ) as HTMLInputElement | null; if (!workElement) { - // eslint-disable-next-line no-console console.debug( `Could not find input for work ID with unique identifier: ${uniqueIdentifier}` ); @@ -34,7 +33,6 @@ const useGetHiddenInputs = (uniqueIdentifier: string): HiddenInputsResult => { } if (!materialElement) { - // eslint-disable-next-line no-console console.debug( `Could not find input for material type with unique identifier: ${uniqueIdentifier}` ); diff --git a/src/apps/material-search/useUpdateFields.ts b/src/apps/material-search/useUpdateFields.ts index 13d9259c2f..084b458e28 100644 --- a/src/apps/material-search/useUpdateFields.ts +++ b/src/apps/material-search/useUpdateFields.ts @@ -41,7 +41,6 @@ const useUpdateFields = ({ } // Leaving a debug message hif the input element is not found. - // eslint-disable-next-line no-console console.debug( `Could not find input element to update with ID: ${uniqueIdentifier}` ); diff --git a/src/apps/material/material.tsx b/src/apps/material/material.tsx index 5281d969c4..75adb9ac3d 100644 --- a/src/apps/material/material.tsx +++ b/src/apps/material/material.tsx @@ -163,6 +163,7 @@ const Material: React.FC = ({ wid }) => { > {manifestations.map((manifestation) => ( = ({ pageSize }) => {
          {menuNavigationData.map((menuNavigationItem) => ( { - // eslint-disable-next-line react/jsx-props-no-spreading const menu = ; // We use the Header component as context to the search bar. // It is the Header that creates the Search bar's design - diff --git a/src/apps/opening-hours-editor/DialogFormEdit.tsx b/src/apps/opening-hours-editor/DialogFormEdit.tsx index 42e9e204cd..b779029a6d 100644 --- a/src/apps/opening-hours-editor/DialogFormEdit.tsx +++ b/src/apps/opening-hours-editor/DialogFormEdit.tsx @@ -45,7 +45,6 @@ const DialogFormEdit: React.FC = ({ endTime }: EventFormOnSubmitType) => { if (!eventInfo.start || !eventInfo.end) { - // eslint-disable-next-line no-alert alert(t("openingHoursInvalidEventText")); return; } @@ -120,7 +119,6 @@ const DialogFormEdit: React.FC = ({ }; if (!eventInfo.start || !eventInfo.end) { - // eslint-disable-next-line no-alert alert(t("openingHoursInvalidEventText")); return null; } diff --git a/src/apps/opening-hours-editor/helper.ts b/src/apps/opening-hours-editor/helper.ts index 99936dfc21..8688bd6b84 100644 --- a/src/apps/opening-hours-editor/helper.ts +++ b/src/apps/opening-hours-editor/helper.ts @@ -187,7 +187,7 @@ export const getInitialDateFromUrl = (): Date | null => { if (!Number.isNaN(date.getTime())) { return date; } - // eslint-disable-next-line no-console + console.debug( "Invalid date format in URL parameter: initialDate =", initialDateString diff --git a/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx b/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx index b4d72ead79..12355d039d 100644 --- a/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx +++ b/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx @@ -56,7 +56,6 @@ const useOpeningHoursEditor = () => { }; const onError = (message: string) => { - // eslint-disable-next-line no-alert alert(message); // reload page to get the latest data window.location.reload(); diff --git a/src/apps/opening-hours-sidebar/OpeningHoursSidebar.stories.tsx b/src/apps/opening-hours-sidebar/OpeningHoursSidebar.stories.tsx index 58837fcae5..8b5c7fa1ff 100644 --- a/src/apps/opening-hours-sidebar/OpeningHoursSidebar.stories.tsx +++ b/src/apps/opening-hours-sidebar/OpeningHoursSidebar.stories.tsx @@ -56,6 +56,5 @@ export default meta; type Story = StoryObj; export const App: Story = { - // eslint-disable-next-line react/jsx-props-no-spreading render: (args) => }; diff --git a/src/apps/opening-hours-sidebar/OpeningHoursSidebarDetails.tsx b/src/apps/opening-hours-sidebar/OpeningHoursSidebarDetails.tsx index 040853a3d1..34fd5fbfba 100644 --- a/src/apps/opening-hours-sidebar/OpeningHoursSidebarDetails.tsx +++ b/src/apps/opening-hours-sidebar/OpeningHoursSidebarDetails.tsx @@ -10,7 +10,6 @@ const OpeningHoursSidebarDetails: FC<
          {openingHoursData.map(({ term, description }, i) => ( - // eslint-disable-next-line react/no-array-index-key
          {term}
          diff --git a/src/apps/opening-hours/OpeningHourWeekListSkeleton.tsx b/src/apps/opening-hours/OpeningHourWeekListSkeleton.tsx index a3c1f69ee7..70d3ec2619 100644 --- a/src/apps/opening-hours/OpeningHourWeekListSkeleton.tsx +++ b/src/apps/opening-hours/OpeningHourWeekListSkeleton.tsx @@ -4,14 +4,14 @@ import clsx from "clsx"; const OpeningHourWeekListSkeleton = () => { return (
            - {[...Array(5)].map(() => ( -
          • + {[...Array(5)].map((_, index) => ( +
            • - {[...Array(3)].map((_, index) => { + {[...Array(3)].map((_, indexInner) => { const isOdd = index % 2 === 0; return ( -
            • +
            • = ({ )} {branches.map(({ branchId, title }) => (
            diff --git a/src/apps/search-header/search-header.stories.tsx b/src/apps/search-header/search-header.stories.tsx index 2c9aad429f..752fc6a678 100644 --- a/src/apps/search-header/search-header.stories.tsx +++ b/src/apps/search-header/search-header.stories.tsx @@ -151,7 +151,6 @@ export const Search: Story = { // It is the Header that creates the Search bar's design - // - without it, the Search bar loses its shape. render: (args: SearchHeaderEntryProps) => ( - // eslint-disable-next-line react/jsx-props-no-spreading } /> ) }; diff --git a/src/apps/search-result/search-result-skeleton.tsx b/src/apps/search-result/search-result-skeleton.tsx index 36cc8afb61..9d96cf1ead 100644 --- a/src/apps/search-result/search-result-skeleton.tsx +++ b/src/apps/search-result/search-result-skeleton.tsx @@ -26,8 +26,8 @@ const SearchResultSkeleton: FC = ({
              {/* Show skeleton search result items if no data is available yet. We'll show 5 items which should cover most screens. */} - {[...Array(5)].map(() => ( -
            • + {[...Array(5)].map((_, index) => ( +
            • ))} diff --git a/src/apps/something-similar/SomethingSimilarList.tsx b/src/apps/something-similar/SomethingSimilarList.tsx index db3b7b555d..bcd8c71f6e 100644 --- a/src/apps/something-similar/SomethingSimilarList.tsx +++ b/src/apps/something-similar/SomethingSimilarList.tsx @@ -97,12 +97,22 @@ const SomethingSimilarList: FC = ({ {recommendView && somethingSimilar && somethingSimilar.map((work) => ( - + ))} {!recommendView && authorMaterials && authorMaterials.map((work) => ( - + ))}
            diff --git a/src/components/Buttons/ButtonTag.tsx b/src/components/Buttons/ButtonTag.tsx index 4b808693cd..da44653bd3 100644 --- a/src/components/Buttons/ButtonTag.tsx +++ b/src/components/Buttons/ButtonTag.tsx @@ -11,6 +11,7 @@ type ButtonTagProps = { dataCy?: string; }; +// eslint-disable-next-line react/display-name const ButtonTag = React.forwardRef( ({ onClick, selected, children, size, removable = false, dataCy }, ref) => { const className = clsx( diff --git a/src/components/autosuggest-category/autosuggest-category.tsx b/src/components/autosuggest-category/autosuggest-category.tsx index 9f92d4a32c..5726f90330 100644 --- a/src/components/autosuggest-category/autosuggest-category.tsx +++ b/src/components/autosuggest-category/autosuggest-category.tsx @@ -25,7 +25,6 @@ const AutosuggestCategory: FC = ({ const t = useText(); return ( <> - {/* eslint-disable react/jsx-props-no-spreading */} {/* The downshift combobox works this way by design (line 43) */} {categoryData.map((item, incorrectIndex) => { // incorrectIndex because in the whole of autosuggest dropdown it is diff --git a/src/components/autosuggest-material/autosuggest-material.tsx b/src/components/autosuggest-material/autosuggest-material.tsx index 7f5ac7dd90..27aa83e394 100644 --- a/src/components/autosuggest-material/autosuggest-material.tsx +++ b/src/components/autosuggest-material/autosuggest-material.tsx @@ -31,7 +31,6 @@ const AutosuggestMaterial: React.FC = ({ const t = useText(); return ( <> - {/* eslint-disable react/jsx-props-no-spreading */} {/* The downshift combobox works this way by design (line 54) */} {materialData.map((item, incorrectIndex) => { // incorrectIndex because in the whole of autosuggest dropdown it is @@ -71,7 +70,6 @@ const AutosuggestMaterial: React.FC = ({ {...getItemProps({ item, index })} data-cy={dataCy} > - {/* eslint-enable react/jsx-props-no-spreading */}
            = ({ const t = useText(); return ( <> - {/* eslint-disable react/jsx-props-no-spreading */} {/* The downshift combobox works this way by design */}
          • = ({ lang={isoLang} >

            - {/* eslint-enable react/jsx-props-no-spreading */} {item.type === SuggestionTypeEnum.Creator ? `${item.term} (${t("stringSuggestionAuthorText")})` : null} diff --git a/src/components/autosuggest-text/autosuggest-text.tsx b/src/components/autosuggest-text/autosuggest-text.tsx index c7b973a869..f7f889b28a 100644 --- a/src/components/autosuggest-text/autosuggest-text.tsx +++ b/src/components/autosuggest-text/autosuggest-text.tsx @@ -45,6 +45,7 @@ export const AutosuggestText: React.FC = ({ }; return ( = ({ return ( <> - {/* eslint-disable react/jsx-props-no-spreading */} {/* The downshift combobox works this way by design */}

              = ({ style={!isOpen ? { display: "none" } : {}} data-cy={dataCy} > - {/* eslint-enable react/jsx-props-no-spreading */} - {}; return ( - // eslint-disable-next-line react/jsx-props-no-spreading ); } diff --git a/src/components/card-item-list/MaterialListItem.tsx b/src/components/card-item-list/MaterialListItem.tsx index b71b60b50c..ced77af1bf 100644 --- a/src/components/card-item-list/MaterialListItem.tsx +++ b/src/components/card-item-list/MaterialListItem.tsx @@ -5,6 +5,7 @@ export interface MaterialListItemProps { className?: string; } +// eslint-disable-next-line react/display-name const MaterialListItem = forwardRef( ({ children, className }, ref) => { return ( diff --git a/src/components/card-item-list/SearchResultList.tsx b/src/components/card-item-list/SearchResultList.tsx index 29ee2f247b..313919f057 100644 --- a/src/components/card-item-list/SearchResultList.tsx +++ b/src/components/card-item-list/SearchResultList.tsx @@ -33,8 +33,8 @@ const SearchResultList: React.FC = ({ We'll show 5 items which should cover most screens. */} {!worksAreLoaded && - [...Array(5)].map(() => ( -
            • + [...Array(5)].map((_, index) => ( +
            • ))} diff --git a/src/components/contact-info-section/ContactInfoInputs.tsx b/src/components/contact-info-section/ContactInfoInputs.tsx index d65cb4f84c..265603d104 100644 --- a/src/components/contact-info-section/ContactInfoInputs.tsx +++ b/src/components/contact-info-section/ContactInfoInputs.tsx @@ -38,7 +38,6 @@ const ContactInfoInputs: FC = ({ "mr-16": i < renderableChildren.length - 1 }); return ( - // eslint-disable-next-line react/no-array-index-key
              {child}
              diff --git a/src/components/cover/cover.stories.tsx b/src/components/cover/cover.stories.tsx index e5afad5f47..fb0c43d284 100644 --- a/src/components/cover/cover.stories.tsx +++ b/src/components/cover/cover.stories.tsx @@ -60,7 +60,6 @@ type Story = StoryObj; export const Item: Story = { render: (args) => { const WrappedCover = withUrls(Cover); - // eslint-disable-next-line react/jsx-props-no-spreading return ; } }; diff --git a/src/components/description-list/description-list.tsx b/src/components/description-list/description-list.tsx index f760976482..bba12bec47 100644 --- a/src/components/description-list/description-list.tsx +++ b/src/components/description-list/description-list.tsx @@ -17,10 +17,10 @@ const DescriptionList: React.FC = ({ className={`list-description ${classNames ?? ""}`} data-cy="list-description" > - {data.map((item) => { + {data.map((item, index) => { const { label, value } = item; return ( -
              +
              {label}
              {value}
              diff --git a/src/components/dialog/Dialog.tsx b/src/components/dialog/Dialog.tsx index 50b598724d..2c870b6cf2 100644 --- a/src/components/dialog/Dialog.tsx +++ b/src/components/dialog/Dialog.tsx @@ -1,6 +1,4 @@ -// The dialog element allready has keyboard support -/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ -/* eslint-disable jsx-a11y/click-events-have-key-events */ +// The dialog element already has keyboard support import React, { forwardRef } from "react"; import clsx from "clsx"; import iconCross from "@danskernesdigitalebibliotek/dpl-design-system/build/icons/basic/icon-cross.svg"; @@ -12,10 +10,12 @@ type DialogType = { isSidebar?: boolean; }; +// eslint-disable-next-line react/display-name const Dialog = forwardRef( ({ children, closeDialog, isSidebar }, ref) => { useEscapeKey({ closeDialog }); return ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions ( { // We just want to confirm that the click handler works and show it in storybook. - // eslint-disable-next-line no-alert alert("Close button clicked!"); }} /> diff --git a/src/components/facet-browser/FacetBrowserModalBody.tsx b/src/components/facet-browser/FacetBrowserModalBody.tsx index d6a42e528f..2718adfaa8 100644 --- a/src/components/facet-browser/FacetBrowserModalBody.tsx +++ b/src/components/facet-browser/FacetBrowserModalBody.tsx @@ -88,7 +88,7 @@ const FacetBrowserModalBody: React.FunctionComponent< }; return ( -
            • +
            • = ({
                {facets && - facets.map(({ name, values }) => { + facets.map(({ name, values }, index) => { if (values.length > 1) { const translatedName = getFacetFieldTranslation( name as FacetFieldEnum ); return ( -
              • +
              • = ({ if (filters?.[name]?.[term]) return null; return ( -
              • +
              • = { return ( <> - {/* eslint-disable-next-line react/jsx-props-no-spreading */} ); diff --git a/src/components/guarded-app.tsx b/src/components/guarded-app.tsx index 6242032e71..9ade184032 100644 --- a/src/components/guarded-app.tsx +++ b/src/components/guarded-app.tsx @@ -31,7 +31,6 @@ const GuardedApp = ({ app, children }: GuardedAppProps) => { const didAuthenticate = getUrlQueryParam(AUTH_PARAM); // We'll leave this debugging here temporarily also in the testing phase for troubleshooting. - // eslint-disable-next-line no-console console.debug("PERSISTED REQUEST:", persistedRequest); useEffect(() => { @@ -40,11 +39,8 @@ const GuardedApp = ({ app, children }: GuardedAppProps) => { } // We'll leave this debugging here temporarily also in the testing phase for troubleshooting. - // eslint-disable-next-line no-console console.debug("HAS REQUEST EXPIRED?", hasRequestExpired(persistedRequest)); - // eslint-disable-next-line no-console console.debug("CURRENT TIMESTAMP", getCurrentUnixTime()); - // eslint-disable-next-line no-console console.debug("EXPIRE TIMESTAMP", persistedRequest.expire); // If request has expired remove it. @@ -83,7 +79,6 @@ const GuardedApp = ({ app, children }: GuardedAppProps) => { // This is a special case. We need to return a JSX element // and children is not a JSX element. - // eslint-disable-next-line react/jsx-no-useless-fragment return <>{children}; }; diff --git a/src/components/material/ReviewHearts.tsx b/src/components/material/ReviewHearts.tsx index 5e381052f8..b4d6cfc754 100644 --- a/src/components/material/ReviewHearts.tsx +++ b/src/components/material/ReviewHearts.tsx @@ -26,11 +26,25 @@ const ReviewHearts: React.FC = ({ amountOfHearts }) => { }); return (
                - {filledHeartsArray.map(() => { - return ; + {filledHeartsArray.map((_, index) => { + return ( + + ); })} - {emptyHeartsArray.map(() => { - return ; + {emptyHeartsArray.map((_, index) => { + return ( + + ); })}
                ); diff --git a/src/components/material/ReviewInfomedia.tsx b/src/components/material/ReviewInfomedia.tsx index fa1737af2d..c2041c78fd 100644 --- a/src/components/material/ReviewInfomedia.tsx +++ b/src/components/material/ReviewInfomedia.tsx @@ -123,7 +123,6 @@ const ReviewInfomedia: React.FC = ({ )} {/* We consider infomedia to be a trustworthy source & decided not to sanitize the text data that we render as HTML. */} - {/* eslint-disable react/no-danger */} {infomedia.article?.text && (

                = ({

                {headline}

                diff --git a/src/components/message/modal-message/ModalMessage.stories.tsx b/src/components/message/modal-message/ModalMessage.stories.tsx index 6eccbe770c..5b6457ea3b 100644 --- a/src/components/message/modal-message/ModalMessage.stories.tsx +++ b/src/components/message/modal-message/ModalMessage.stories.tsx @@ -21,7 +21,6 @@ const ModalTemplate: StoryFn = (props) => { classNames="modal-cta modal-padding" > diff --git a/src/components/message/modal-message/ModalMessage.tsx b/src/components/message/modal-message/ModalMessage.tsx index 688637a482..6205808f89 100644 --- a/src/components/message/modal-message/ModalMessage.tsx +++ b/src/components/message/modal-message/ModalMessage.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import * as React from "react"; import { FC } from "react"; import withFocusTrap from "../../../core/utils/withFocusTrap"; @@ -23,6 +22,7 @@ interface ModalMessageProps extends MessageProps { } & (RequiredModalId | RequireCloseAllModals); } +// eslint-disable-next-line react/display-name const ModalMessage: FC = React.forwardRef((props) => { const { close, closeAll } = useModalButtonHandler(); const { ctaButton, ...messageProps } = props; diff --git a/src/components/multiselect/Multiselect.stories.tsx b/src/components/multiselect/Multiselect.stories.tsx index eb6701ade6..f0e5ff39d5 100644 --- a/src/components/multiselect/Multiselect.stories.tsx +++ b/src/components/multiselect/Multiselect.stories.tsx @@ -51,7 +51,6 @@ const meta: Meta = { options }, render: (args) => { - // eslint-disable-next-line react/jsx-props-no-spreading return ; } }; diff --git a/src/components/multiselect/Multiselect.tsx b/src/components/multiselect/Multiselect.tsx index 711873448b..059cc49bea 100644 --- a/src/components/multiselect/Multiselect.tsx +++ b/src/components/multiselect/Multiselect.tsx @@ -129,7 +129,6 @@ const Multiselect: FC = ({ <> {caption &&
                {caption}
                }
                - {/* eslint-disable react/jsx-props-no-spreading */} {/* The downshift combobox works this way by design */}