From 0e19c31e9c5db82219e8b593732bbc66720dcc57 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 3 Dec 2025 22:18:24 +0100 Subject: [PATCH] linting: disable several rules to keep this pull request reviewable --- app/src/App.tsx | 2 ++ app/src/ModalContent.tsx | 1 + app/src/api/itemsApi.ts | 4 ++-- app/src/api/refiBcnApi.ts | 1 + app/src/pages/MapContainer.tsx | 1 + lib/src/Components/AppShell/SidebarSubmenu.tsx | 1 + lib/src/Components/Auth/LoginPage.tsx | 1 + lib/src/Components/Auth/SignupPage.tsx | 1 + lib/src/Components/Auth/useAuth.tsx | 2 +- lib/src/Components/Item/PopupView.tsx | 2 ++ lib/src/Components/Map/Subcomponents/AddButton.tsx | 1 + .../Map/Subcomponents/Controls/FilterControl.tsx | 1 + .../Map/Subcomponents/Controls/LocateControl.tsx | 1 + .../Map/Subcomponents/Controls/SearchControl.tsx | 1 + .../ItemPopupComponents/HeaderView/ItemAvatar.tsx | 1 + .../ItemPopupComponents/HeaderView/ItemTitle.tsx | 1 + .../Subcomponents/ItemPopupComponents/HeaderView/hooks.ts | 1 + .../Map/Subcomponents/ItemPopupComponents/PopupButton.tsx | 3 +++ .../ItemPopupComponents/PopupTextAreaInput.tsx | 1 + .../Subcomponents/ItemPopupComponents/PopupTextInput.tsx | 1 + lib/src/Components/Map/hooks/useLayers.tsx | 1 + lib/src/Components/Map/hooks/useLeafletRefs.tsx | 1 + lib/src/Components/Map/hooks/usePermissions.tsx | 1 + lib/src/Components/Map/hooks/useReverseGeocode.ts | 1 + lib/src/Components/Profile/ProfileForm.tsx | 1 + lib/src/Components/Profile/ProfileView.tsx | 2 +- .../Components/Profile/Subcomponents/ActionsButton.tsx | 1 + lib/src/Components/Profile/Subcomponents/AvatarWidget.tsx | 1 + lib/src/Components/Profile/Subcomponents/FormHeader.tsx | 1 + .../Components/Profile/Subcomponents/GalleryForm.spec.tsx | 1 + lib/src/Components/Profile/Subcomponents/GalleryForm.tsx | 4 +++- .../Profile/Subcomponents/LinkedItemsHeaderView.tsx | 1 + .../Components/Profile/Subcomponents/SocialShareBar.tsx | 1 + lib/src/Components/Profile/Subcomponents/TagsWidget.tsx | 1 + lib/src/Components/Profile/Templates/SimpleForm.tsx | 1 + lib/src/Components/Profile/Templates/TabsForm.tsx | 1 + lib/src/Components/Profile/UserSettings.tsx | 3 +++ lib/src/Components/Profile/itemFunctions.ts | 1 + lib/src/Components/Templates/AttestationForm.tsx | 3 ++- lib/src/Components/Templates/DialogModal.tsx | 8 +++++--- lib/src/Components/Templates/MarketView.tsx | 1 + lib/src/Components/Templates/Tabs.tsx | 1 + lib/src/Utils/MarkerIconFactory.ts | 1 + lib/src/Utils/ReverseGeocoder.ts | 1 + lib/src/Utils/TimeAgo.ts | 1 + lib/src/Utils/getImageDimensions.ts | 1 + lib/src/types/FormState.d.ts | 1 + 47 files changed, 61 insertions(+), 9 deletions(-) diff --git a/app/src/App.tsx b/app/src/App.tsx index 1a965979..6c77bac7 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -8,6 +8,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable new-cap */ /* eslint-disable @typescript-eslint/prefer-optional-chain */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/restrict-plus-operands */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ diff --git a/app/src/ModalContent.tsx b/app/src/ModalContent.tsx index 49efa903..9bf4f6cd 100644 --- a/app/src/ModalContent.tsx +++ b/app/src/ModalContent.tsx @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/restrict-plus-operands */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { useEffect, useState } from 'react' import { TextView } from 'utopia-ui' diff --git a/app/src/api/itemsApi.ts b/app/src/api/itemsApi.ts index ef964e9b..7b60142f 100644 --- a/app/src/api/itemsApi.ts +++ b/app/src/api/itemsApi.ts @@ -111,8 +111,8 @@ export class itemsApi implements ItemsApi { async deleteItem(id: string): Promise { try { - const result = await directusClient.request(deleteItem(this.collectionName, id)) - return result as unknown as boolean + await directusClient.request(deleteItem(this.collectionName, id)) + return true } catch (error: any) { console.log(error) if (error.errors[0].message) throw error.errors[0].message diff --git a/app/src/api/refiBcnApi.ts b/app/src/api/refiBcnApi.ts index e6176853..65717ad3 100644 --- a/app/src/api/refiBcnApi.ts +++ b/app/src/api/refiBcnApi.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/no-unsafe-return */ import axios from 'axios' import type { ItemsApi } from 'utopia-ui' diff --git a/app/src/pages/MapContainer.tsx b/app/src/pages/MapContainer.tsx index 1a46c013..f0b0cd9f 100644 --- a/app/src/pages/MapContainer.tsx +++ b/app/src/pages/MapContainer.tsx @@ -3,6 +3,7 @@ /* eslint-disable import-x/no-relative-parent-imports */ /* eslint-disable new-cap */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { useEffect, useState } from 'react' import { diff --git a/lib/src/Components/AppShell/SidebarSubmenu.tsx b/lib/src/Components/AppShell/SidebarSubmenu.tsx index 06fad1f4..a5f39ea0 100644 --- a/lib/src/Components/AppShell/SidebarSubmenu.tsx +++ b/lib/src/Components/AppShell/SidebarSubmenu.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-find */ import ChevronDownIcon from '@heroicons/react/24/outline/ChevronDownIcon' import { useEffect, useState } from 'react' import { Link, useLocation } from 'react-router-dom' diff --git a/lib/src/Components/Auth/LoginPage.tsx b/lib/src/Components/Auth/LoginPage.tsx index 3a2cacbd..e38ed451 100644 --- a/lib/src/Components/Auth/LoginPage.tsx +++ b/lib/src/Components/Auth/LoginPage.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { useCallback, useEffect, useState } from 'react' import { Link, useNavigate } from 'react-router-dom' import { toast } from 'react-toastify' diff --git a/lib/src/Components/Auth/SignupPage.tsx b/lib/src/Components/Auth/SignupPage.tsx index a24087fd..13c0089f 100644 --- a/lib/src/Components/Auth/SignupPage.tsx +++ b/lib/src/Components/Auth/SignupPage.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' import { toast } from 'react-toastify' diff --git a/lib/src/Components/Auth/useAuth.tsx b/lib/src/Components/Auth/useAuth.tsx index a199e5ca..fe332d80 100644 --- a/lib/src/Components/Auth/useAuth.tsx +++ b/lib/src/Components/Auth/useAuth.tsx @@ -67,7 +67,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => { return undefined } // eslint-disable-next-line no-catch-all/no-catch-all - } catch (error) { + } catch { setLoading(false) return undefined } finally { diff --git a/lib/src/Components/Item/PopupView.tsx b/lib/src/Components/Item/PopupView.tsx index 98640f38..c73ac6a4 100644 --- a/lib/src/Components/Item/PopupView.tsx +++ b/lib/src/Components/Item/PopupView.tsx @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ +/* eslint-disable @typescript-eslint/restrict-plus-operands */ import { useContext, useMemo, useState } from 'react' import { Marker, Tooltip } from 'react-leaflet' diff --git a/lib/src/Components/Map/Subcomponents/AddButton.tsx b/lib/src/Components/Map/Subcomponents/AddButton.tsx index 245d3c38..c1944827 100644 --- a/lib/src/Components/Map/Subcomponents/AddButton.tsx +++ b/lib/src/Components/Map/Subcomponents/AddButton.tsx @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { MapPinIcon } from '@heroicons/react/24/solid' import { useState } from 'react' import SVG from 'react-inlinesvg' diff --git a/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx index b1fcc10f..03a6f8ce 100644 --- a/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx +++ b/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx @@ -1,3 +1,4 @@ +/* eslint-disable array-callback-return */ import FunnelIcon from '@heroicons/react/24/outline/FunnelIcon' import { useEffect, useState } from 'react' diff --git a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx index f1020520..f0907f81 100644 --- a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx +++ b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx @@ -1,4 +1,5 @@ /* eslint-disable camelcase */ // Directus database fields use snake_case +/* eslint-disable promise/always-return */ import { control } from 'leaflet' import { useCallback, useEffect, useRef, useState } from 'react' import SVG from 'react-inlinesvg' diff --git a/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx index 5bcb06d7..f7370e84 100644 --- a/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx +++ b/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/no-misused-promises */ /* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-argument */ diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx index 78e9bc6e..347c23a2 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemAvatar.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { QrCodeIcon } from '@heroicons/react/24/solid' import { useState } from 'react' diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx index 713f3373..f6327076 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { MapPinIcon } from '@heroicons/react/24/solid' import { useEffect, useRef, useState } from 'react' diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/hooks.ts b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/hooks.ts index c466a7a9..9fc6d446 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/hooks.ts +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/hooks.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { toast } from 'react-toastify' import type { Item } from '#types/Item' diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx index 326a69e8..0816ddbb 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx @@ -1,5 +1,8 @@ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ +/* eslint-disable @typescript-eslint/no-base-to-string */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ +/* eslint-disable @typescript-eslint/prefer-optional-chain */ import { get } from 'radash' import { Link } from 'react-router-dom' diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx index 49447c18..f4d6c630 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { TextAreaInput } from '#components/Input' import type { Item } from '#types/Item' diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.tsx index be0331df..98e4eb04 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { TextInput } from '#components/Input' import type { Item } from '#types/Item' diff --git a/lib/src/Components/Map/hooks/useLayers.tsx b/lib/src/Components/Map/hooks/useLayers.tsx index 7160db26..44178730 100644 --- a/lib/src/Components/Map/hooks/useLayers.tsx +++ b/lib/src/Components/Map/hooks/useLayers.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ import { useCallback, useReducer, createContext, useContext } from 'react' import type { LayerProps } from '#types/LayerProps' diff --git a/lib/src/Components/Map/hooks/useLeafletRefs.tsx b/lib/src/Components/Map/hooks/useLeafletRefs.tsx index 0cee4213..1fe3ae72 100644 --- a/lib/src/Components/Map/hooks/useLeafletRefs.tsx +++ b/lib/src/Components/Map/hooks/useLeafletRefs.tsx @@ -1,4 +1,5 @@ /* eslint-disable react/prop-types */ +/* eslint-disable @typescript-eslint/no-empty-object-type */ import { useCallback, useReducer, createContext, useContext } from 'react' import type { Item } from '#types/Item' diff --git a/lib/src/Components/Map/hooks/usePermissions.tsx b/lib/src/Components/Map/hooks/usePermissions.tsx index f0085459..be38ccc3 100644 --- a/lib/src/Components/Map/hooks/usePermissions.tsx +++ b/lib/src/Components/Map/hooks/usePermissions.tsx @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { useCallback, useReducer, createContext, useContext, useState } from 'react' import { useAuth } from '#components/Auth/useAuth' diff --git a/lib/src/Components/Map/hooks/useReverseGeocode.ts b/lib/src/Components/Map/hooks/useReverseGeocode.ts index fd88daed..3bc51771 100644 --- a/lib/src/Components/Map/hooks/useReverseGeocode.ts +++ b/lib/src/Components/Map/hooks/useReverseGeocode.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { useState, useEffect } from 'react' interface GeocodeResult { diff --git a/lib/src/Components/Profile/ProfileForm.tsx b/lib/src/Components/Profile/ProfileForm.tsx index eb4a2b59..5df6f3d4 100644 --- a/lib/src/Components/Profile/ProfileForm.tsx +++ b/lib/src/Components/Profile/ProfileForm.tsx @@ -1,6 +1,7 @@ /* eslint-disable camelcase */ // Directus database fields use snake_case /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ +/* eslint-disable @typescript-eslint/prefer-optional-chain */ import classNames from 'classnames' import { useEffect, useState } from 'react' import { useLocation, useNavigate } from 'react-router-dom' diff --git a/lib/src/Components/Profile/ProfileView.tsx b/lib/src/Components/Profile/ProfileView.tsx index 2082ab72..08bc31fd 100644 --- a/lib/src/Components/Profile/ProfileView.tsx +++ b/lib/src/Components/Profile/ProfileView.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ - +/* eslint-disable @typescript-eslint/use-unknown-in-catch-callback-variable */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */ diff --git a/lib/src/Components/Profile/Subcomponents/ActionsButton.tsx b/lib/src/Components/Profile/Subcomponents/ActionsButton.tsx index 20d0a9d0..6ee8c27b 100644 --- a/lib/src/Components/Profile/Subcomponents/ActionsButton.tsx +++ b/lib/src/Components/Profile/Subcomponents/ActionsButton.tsx @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/prefer-optional-chain */ import LinkIcon from '@heroicons/react/24/outline/LinkIcon' import PlusIcon from '@heroicons/react/24/outline/PlusIcon' import { useState } from 'react' diff --git a/lib/src/Components/Profile/Subcomponents/AvatarWidget.tsx b/lib/src/Components/Profile/Subcomponents/AvatarWidget.tsx index e35b12b0..80561e7f 100644 --- a/lib/src/Components/Profile/Subcomponents/AvatarWidget.tsx +++ b/lib/src/Components/Profile/Subcomponents/AvatarWidget.tsx @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/prefer-optional-chain */ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import ArrowUpTrayIcon from '@heroicons/react/24/outline/ArrowUpTrayIcon' import { useState, useCallback, useRef } from 'react' import { ReactCrop, centerCrop, makeAspectCrop } from 'react-image-crop' diff --git a/lib/src/Components/Profile/Subcomponents/FormHeader.tsx b/lib/src/Components/Profile/Subcomponents/FormHeader.tsx index 2af21c04..484030e6 100644 --- a/lib/src/Components/Profile/Subcomponents/FormHeader.tsx +++ b/lib/src/Components/Profile/Subcomponents/FormHeader.tsx @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { TextInput } from '#components/Input' diff --git a/lib/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx b/lib/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx index 5b30dd2a..4844ecf3 100644 --- a/lib/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx +++ b/lib/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx @@ -1,4 +1,5 @@ /* eslint-disable camelcase */ // Directus database fields use snake_case +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { readFileSync } from 'node:fs' import path from 'node:path' diff --git a/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx b/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx index bced371f..65b2bf12 100644 --- a/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx +++ b/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx @@ -1,4 +1,5 @@ /* eslint-disable camelcase */ // Directus database fields use snake_case +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import TrashIcon from '@heroicons/react/24/solid/TrashIcon' import imageCompression from 'browser-image-compression' import { useState } from 'react' @@ -51,7 +52,8 @@ export const GalleryForm = ({ state, setState, hideInputLabel = false }: Props) } }) - for await (const upload of uploads) { + const results = await Promise.all(uploads) + for (const upload of results) { setState((prevState) => ({ ...prevState, uploadingImages: prevState.uploadingImages.filter((f) => f.name !== upload.name), diff --git a/lib/src/Components/Profile/Subcomponents/LinkedItemsHeaderView.tsx b/lib/src/Components/Profile/Subcomponents/LinkedItemsHeaderView.tsx index bf5b24a2..9b9ce5d7 100644 --- a/lib/src/Components/Profile/Subcomponents/LinkedItemsHeaderView.tsx +++ b/lib/src/Components/Profile/Subcomponents/LinkedItemsHeaderView.tsx @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ +/* eslint-disable no-constant-binary-expression */ import EllipsisVerticalIcon from '@heroicons/react/16/solid/EllipsisVerticalIcon' import LinkSlashIcon from '@heroicons/react/24/outline/LinkSlashIcon' diff --git a/lib/src/Components/Profile/Subcomponents/SocialShareBar.tsx b/lib/src/Components/Profile/Subcomponents/SocialShareBar.tsx index a075e1e1..7c880071 100644 --- a/lib/src/Components/Profile/Subcomponents/SocialShareBar.tsx +++ b/lib/src/Components/Profile/Subcomponents/SocialShareBar.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/use-unknown-in-catch-callback-variable */ import { toast } from 'react-toastify' import ChevronSVG from '#assets/chevron.svg' diff --git a/lib/src/Components/Profile/Subcomponents/TagsWidget.tsx b/lib/src/Components/Profile/Subcomponents/TagsWidget.tsx index ed700119..509c811a 100644 --- a/lib/src/Components/Profile/Subcomponents/TagsWidget.tsx +++ b/lib/src/Components/Profile/Subcomponents/TagsWidget.tsx @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ /* eslint-disable @typescript-eslint/no-unsafe-call */ import { useEffect, useState } from 'react' diff --git a/lib/src/Components/Profile/Templates/SimpleForm.tsx b/lib/src/Components/Profile/Templates/SimpleForm.tsx index 02a52b42..2216a731 100644 --- a/lib/src/Components/Profile/Templates/SimpleForm.tsx +++ b/lib/src/Components/Profile/Templates/SimpleForm.tsx @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { TextAreaInput } from '#components/Input' // eslint-disable-next-line react/prop-types diff --git a/lib/src/Components/Profile/Templates/TabsForm.tsx b/lib/src/Components/Profile/Templates/TabsForm.tsx index 2c239499..b7a13b88 100644 --- a/lib/src/Components/Profile/Templates/TabsForm.tsx +++ b/lib/src/Components/Profile/Templates/TabsForm.tsx @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ /* eslint-disable @typescript-eslint/restrict-plus-operands */ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable react/prop-types */ diff --git a/lib/src/Components/Profile/UserSettings.tsx b/lib/src/Components/Profile/UserSettings.tsx index 013f6e0d..7f2d7eb9 100644 --- a/lib/src/Components/Profile/UserSettings.tsx +++ b/lib/src/Components/Profile/UserSettings.tsx @@ -1,4 +1,7 @@ /* eslint-disable @typescript-eslint/restrict-template-expressions */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ +/* eslint-disable promise/always-return */ +/* eslint-disable @typescript-eslint/use-unknown-in-catch-callback-variable */ import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' import { toast } from 'react-toastify' diff --git a/lib/src/Components/Profile/itemFunctions.ts b/lib/src/Components/Profile/itemFunctions.ts index de622bba..2183cf92 100644 --- a/lib/src/Components/Profile/itemFunctions.ts +++ b/lib/src/Components/Profile/itemFunctions.ts @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/prefer-optional-chain */ /* eslint-disable @typescript-eslint/restrict-plus-operands */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/lib/src/Components/Templates/AttestationForm.tsx b/lib/src/Components/Templates/AttestationForm.tsx index 8cfbe5e4..4fd13078 100644 --- a/lib/src/Components/Templates/AttestationForm.tsx +++ b/lib/src/Components/Templates/AttestationForm.tsx @@ -1,4 +1,6 @@ /* eslint-disable camelcase */ // Directus database fields use snake_case +/* eslint-disable @typescript-eslint/restrict-template-expressions */ +/* eslint-disable promise/always-return */ import { useRef, useState, useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { toast } from 'react-toastify' @@ -63,7 +65,6 @@ export const AttestationForm = ({ api }: { api?: ItemsApi }) => { success: 'Attestation created', error: { render({ data }) { - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions return `${data}` }, }, diff --git a/lib/src/Components/Templates/DialogModal.tsx b/lib/src/Components/Templates/DialogModal.tsx index ef90afae..091502fa 100644 --- a/lib/src/Components/Templates/DialogModal.tsx +++ b/lib/src/Components/Templates/DialogModal.tsx @@ -47,9 +47,11 @@ const DialogModal = ({ className={`${className ?? ''} tw:card tw:shadow-xl tw:absolute tw:right-0 tw:top-0 tw:bottom-0 tw:left-0 tw:m-auto tw:transition-opacity tw:duration-300 tw:p-4 tw:max-w-xl tw:bg-base-100`} ref={ref} onCancel={onClose} - onClick={(e) => - ref.current && !isClickInsideRectangle(e, ref.current) && closeOnClickOutside && onClose() - } + onClick={(e) => { + if (ref.current && !isClickInsideRectangle(e, ref.current) && closeOnClickOutside) { + onClose() + } + }} >
{title && ( diff --git a/lib/src/Components/Templates/MarketView.tsx b/lib/src/Components/Templates/MarketView.tsx index 6a2d6d4a..294d7874 100644 --- a/lib/src/Components/Templates/MarketView.tsx +++ b/lib/src/Components/Templates/MarketView.tsx @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-call */ +/* eslint-disable @typescript-eslint/restrict-plus-operands */ import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' diff --git a/lib/src/Components/Templates/Tabs.tsx b/lib/src/Components/Templates/Tabs.tsx index 28eb5be7..eb583f30 100644 --- a/lib/src/Components/Templates/Tabs.tsx +++ b/lib/src/Components/Templates/Tabs.tsx @@ -1,4 +1,5 @@ /* eslint-disable security/detect-object-injection */ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import { useState, useEffect, useCallback } from 'react' import { useLocation, useNavigate } from 'react-router-dom' diff --git a/lib/src/Utils/MarkerIconFactory.ts b/lib/src/Utils/MarkerIconFactory.ts index 6fb9fbd3..3c24436f 100644 --- a/lib/src/Utils/MarkerIconFactory.ts +++ b/lib/src/Utils/MarkerIconFactory.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { divIcon, Point } from 'leaflet' import type { MarkerIcon } from '#types/MarkerIcon' diff --git a/lib/src/Utils/ReverseGeocoder.ts b/lib/src/Utils/ReverseGeocoder.ts index ca227063..4e652edb 100644 --- a/lib/src/Utils/ReverseGeocoder.ts +++ b/lib/src/Utils/ReverseGeocoder.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ import axios from 'axios' interface ReverseGeocodeResponse { diff --git a/lib/src/Utils/TimeAgo.ts b/lib/src/Utils/TimeAgo.ts index 8d1cbd86..b75f0026 100644 --- a/lib/src/Utils/TimeAgo.ts +++ b/lib/src/Utils/TimeAgo.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/restrict-template-expressions */ // in miliseconds const units = [ { label: 'year', seconds: 31536000 }, diff --git a/lib/src/Utils/getImageDimensions.ts b/lib/src/Utils/getImageDimensions.ts index 31a93c10..a6119982 100644 --- a/lib/src/Utils/getImageDimensions.ts +++ b/lib/src/Utils/getImageDimensions.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-promise-reject-errors */ export const getImageDimensions = ( file: File, ): Promise<{ diff --git a/lib/src/types/FormState.d.ts b/lib/src/types/FormState.d.ts index 7322b58d..97bb6f26 100644 --- a/lib/src/types/FormState.d.ts +++ b/lib/src/types/FormState.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ import type { markerIcon } from '#utils/MarkerIconFactory' import type { GalleryItem, Item } from './Item' import type { Tag } from './Tag'