From 4950a1eb60e057eac640be8a589a9c0bfdedab4f Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 2 Nov 2024 23:18:08 +0100 Subject: [PATCH 1/5] install eslint comments --- .eslintrc.js | 9 ++++----- package-lock.json | 34 ++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9ba7d4cc..d5873c77 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line no-undef module.exports = { env: { browser: true, @@ -7,7 +6,7 @@ module.exports = { extends: [ 'standard', 'eslint:recommended', - // 'plugin:@eslint-community/eslint-comments/recommended', + 'plugin:@eslint-community/eslint-comments/recommended', // 'plugin:@typescript-eslint/recommended', // 'plugin:import/recommended', // 'plugin:import/typescript', @@ -56,9 +55,9 @@ module.exports = { // ignores: ['+Page'], // }, // ], - // // Optional eslint-comments rule - // '@eslint-community/eslint-comments/no-unused-disable': 'error', - // '@eslint-community/eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }], + // Optional eslint-comments rule + '@eslint-community/eslint-comments/no-unused-disable': 'error', + '@eslint-community/eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }], // // import // 'import/export': 'error', // 'import/no-deprecated': 'error', diff --git a/package-lock.json b/package-lock.json index 6b861ac4..eeeb13f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "tw-elements": "^1.0.0" }, "devDependencies": { + "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", "@types/leaflet": "^1.7.11", "@types/react": "^18.2.0", "@types/react-dom": "^18.0.5", @@ -71,6 +72,39 @@ "node": ">=0.10.0" } }, + "node_modules/@eslint-community/eslint-plugin-eslint-comments": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-4.4.1.tgz", + "integrity": "sha512-lb/Z/MzbTf7CaVYM9WCFNQZ4L1yi3ev2fsFPF99h31ljhSEyUoyEsKsNWiU+qD1glbYTDJdqgyaLKtyTkkqtuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^4.0.0", + "ignore": "^5.2.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/@eslint-community/eslint-plugin-eslint-comments/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", diff --git a/package.json b/package.json index ecf7ffd5..833a6fd2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "author": "Anton Tranelis", "license": "MIT", "devDependencies": { + "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", "@types/leaflet": "^1.7.11", "@types/react": "^18.2.0", "@types/react-dom": "^18.0.5", From 2f77dde3dab2dd42cf035c19a2d9e56c4944a1b0 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 2 Nov 2024 23:18:29 +0100 Subject: [PATCH 2/5] remove used eslint disables --- postcss.config.js | 1 - src/Components/AppShell/hooks/useAssets.tsx | 2 +- src/Components/Auth/useAuth.tsx | 12 ++++++------ src/Components/Gaming/hooks/useQuests.tsx | 2 +- src/Components/Input/Autocomplete.tsx | 1 - src/Components/Input/ComboBoxInput.tsx | 2 +- src/Components/Input/SelectBox.tsx | 2 +- src/Components/Input/TextAreaInput.tsx | 2 +- src/Components/Input/TextInput.tsx | 2 +- .../ItemPopupComponents/PopupStartEndInput.tsx | 4 ++-- .../ItemPopupComponents/TextView.tsx | 5 ++--- src/Components/Map/hooks/useFilter.tsx | 18 +++++++++--------- src/Components/Map/hooks/useItems.tsx | 12 ++++++------ src/Components/Map/hooks/useLayers.tsx | 2 +- src/Components/Map/hooks/useLeafletRefs.tsx | 4 ++-- src/Components/Map/hooks/usePermissions.tsx | 8 ++++---- src/Components/Map/hooks/useTags.tsx | 1 - src/Components/Profile/Templates/TabsForm.tsx | 1 - src/Components/Profile/Templates/TabsView.tsx | 1 - src/Utils/ReplaceURLs.ts | 2 +- src/types.ts | 2 -- tailwind.config.js | 1 - 22 files changed, 39 insertions(+), 48 deletions(-) diff --git a/postcss.config.js b/postcss.config.js index 3b33f365..33ad091d 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line no-undef module.exports = { plugins: { tailwindcss: {}, diff --git a/src/Components/AppShell/hooks/useAssets.tsx b/src/Components/AppShell/hooks/useAssets.tsx index 573d8930..d301df79 100644 --- a/src/Components/AppShell/hooks/useAssets.tsx +++ b/src/Components/AppShell/hooks/useAssets.tsx @@ -12,7 +12,7 @@ const AssetContext = createContext({ function useAssetsManager(): { api: AssetsApi - // eslint-disable-next-line no-unused-vars + setAssetsApi: (api: AssetsApi) => void } { const [api, setApi] = useState({} as AssetsApi) diff --git a/src/Components/Auth/useAuth.tsx b/src/Components/Auth/useAuth.tsx index 8be9b9ae..f70a6485 100644 --- a/src/Components/Auth/useAuth.tsx +++ b/src/Components/Auth/useAuth.tsx @@ -16,18 +16,18 @@ type AuthCredentials = { type AuthContextProps = { isAuthenticated: boolean user: UserItem | null - // eslint-disable-next-line no-unused-vars + login: (credentials: AuthCredentials) => Promise - // eslint-disable-next-line no-unused-vars + register: (credentials: AuthCredentials, userName: string) => Promise loading: boolean logout: () => Promise - // eslint-disable-next-line no-unused-vars + updateUser: (user: UserItem) => any token: string | null - // eslint-disable-next-line no-unused-vars + requestPasswordReset: (email: string, reset_url: string) => Promise - // eslint-disable-next-line no-unused-vars + passwordReset: (token: string, new_password: string) => Promise } @@ -111,7 +111,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => { const updateUser = async (user: UserItem) => { setLoading(true) - // eslint-disable-next-line no-unused-vars + const { id, ...userRest } = user try { diff --git a/src/Components/Gaming/hooks/useQuests.tsx b/src/Components/Gaming/hooks/useQuests.tsx index 6287126f..2461558c 100644 --- a/src/Components/Gaming/hooks/useQuests.tsx +++ b/src/Components/Gaming/hooks/useQuests.tsx @@ -10,7 +10,7 @@ const QuestContext = createContext({ function useQuestsManager(initialOpen: boolean): { open: boolean - // eslint-disable-next-line no-unused-vars + setQuestsOpen: (open: boolean) => void } { const [open, setOpen] = useState(initialOpen) diff --git a/src/Components/Input/Autocomplete.tsx b/src/Components/Input/Autocomplete.tsx index 4bf4668c..ce25467a 100644 --- a/src/Components/Input/Autocomplete.tsx +++ b/src/Components/Input/Autocomplete.tsx @@ -2,7 +2,6 @@ import * as React from 'react' import { useEffect } from 'react' import { TagView } from '../Templates/TagView' -// eslint-disable-next-line no-unused-vars export const Autocomplete = ({ inputProps, suggestions, diff --git a/src/Components/Input/ComboBoxInput.tsx b/src/Components/Input/ComboBoxInput.tsx index 558d2e65..e81948e0 100644 --- a/src/Components/Input/ComboBoxInput.tsx +++ b/src/Components/Input/ComboBoxInput.tsx @@ -5,7 +5,7 @@ interface ComboBoxProps { id?: string options: { value: string; label: string }[] value: string - // eslint-disable-next-line no-unused-vars + onValueChange: (newValue: string) => void } diff --git a/src/Components/Input/SelectBox.tsx b/src/Components/Input/SelectBox.tsx index f7bed383..4bcf3a09 100644 --- a/src/Components/Input/SelectBox.tsx +++ b/src/Components/Input/SelectBox.tsx @@ -9,7 +9,7 @@ type SelectBoxProps = { containerStyle?: string defaultValue: string placeholder?: string - // eslint-disable-next-line no-unused-vars + updateFormValue: (value: string) => void options: { name: string; value: string }[] diff --git a/src/Components/Input/TextAreaInput.tsx b/src/Components/Input/TextAreaInput.tsx index 09577cff..8106ca7e 100644 --- a/src/Components/Input/TextAreaInput.tsx +++ b/src/Components/Input/TextAreaInput.tsx @@ -11,7 +11,7 @@ type TextAreaProps = { inputStyle?: string defaultValue: string placeholder?: string - // eslint-disable-next-line no-unused-vars + updateFormValue?: (value: string) => void } diff --git a/src/Components/Input/TextInput.tsx b/src/Components/Input/TextInput.tsx index 2888a880..1d454e40 100644 --- a/src/Components/Input/TextInput.tsx +++ b/src/Components/Input/TextInput.tsx @@ -11,7 +11,7 @@ type InputTextProps = { defaultValue?: string placeholder?: string autocomplete?: string - // eslint-disable-next-line no-unused-vars + updateFormValue?: (value: string) => void } diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx index e3a22242..b83de691 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx @@ -5,9 +5,9 @@ import { Item } from '../../../../types' type StartEndInputProps = { item?: Item showLabels?: boolean - // eslint-disable-next-line no-unused-vars + updateStartValue?: (value: string) => void - // eslint-disable-next-line no-unused-vars + updateEndValue?: (value: string) => void } diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx index 55194681..264d933e 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx @@ -38,15 +38,14 @@ export const TextView = ({ if (item && text) replacedText = fixUrls(text) - // eslint-disable-next-line no-useless-escape if (replacedText) { replacedText = replacedText.replace(/(? { let shortUrl = url - // eslint-disable-next-line no-useless-escape + if (url.match('^https://')) { shortUrl = url.split('https://')[1] } - // eslint-disable-next-line no-useless-escape + if (url.match('^http://')) { shortUrl = url.split('http://')[1] } diff --git a/src/Components/Map/hooks/useFilter.tsx b/src/Components/Map/hooks/useFilter.tsx index dc5b7c3e..4d6a1d39 100644 --- a/src/Components/Map/hooks/useFilter.tsx +++ b/src/Components/Map/hooks/useFilter.tsx @@ -43,25 +43,25 @@ function useFilterManager(initialTags: Tag[]): { searchPhrase: string visibleLayers: LayerProps[] visibleGroupTypes: string[] - // eslint-disable-next-line no-unused-vars + addFilterTag: (tag: Tag) => void - // eslint-disable-next-line no-unused-vars + removeFilterTag: (name: string) => void resetFilterTags: () => void - // eslint-disable-next-line no-unused-vars + setSearchPhrase: (phrase: string) => void - // eslint-disable-next-line no-unused-vars + addVisibleLayer: (layer: LayerProps) => void - // eslint-disable-next-line no-unused-vars + toggleVisibleLayer: (layer: LayerProps) => void resetVisibleLayers: () => void - // eslint-disable-next-line no-unused-vars + isLayerVisible: (layer: LayerProps) => boolean - // eslint-disable-next-line no-unused-vars + addVisibleGroupType: (groupType: string) => void - // eslint-disable-next-line no-unused-vars + toggleVisibleGroupType: (groupType: string) => void - // eslint-disable-next-line no-unused-vars + isGroupTypeVisible: (groupType: string) => boolean } { const [filterTags, dispatchTags] = useReducer((state: Tag[], action: ActionType) => { diff --git a/src/Components/Map/hooks/useItems.tsx b/src/Components/Map/hooks/useItems.tsx index 43ed380c..bba55845 100644 --- a/src/Components/Map/hooks/useItems.tsx +++ b/src/Components/Map/hooks/useItems.tsx @@ -25,17 +25,17 @@ const ItemContext = createContext({ function useItemsManager(initialItems: Item[]): { items: Item[] - // eslint-disable-next-line no-unused-vars + addItem: (item: Item) => void - // eslint-disable-next-line no-unused-vars + updateItem: (item: Item) => void - // eslint-disable-next-line no-unused-vars + removeItem: (item: Item) => void - // eslint-disable-next-line no-unused-vars + resetItems: (layer: LayerProps) => void - // eslint-disable-next-line no-unused-vars + setItemsApi: (layer: LayerProps) => void - // eslint-disable-next-line no-unused-vars + setItemsData: (layer: LayerProps) => void allItemsLoaded: boolean } { diff --git a/src/Components/Map/hooks/useLayers.tsx b/src/Components/Map/hooks/useLayers.tsx index 79c29888..ac84113d 100644 --- a/src/Components/Map/hooks/useLayers.tsx +++ b/src/Components/Map/hooks/useLayers.tsx @@ -13,7 +13,7 @@ const LayerContext = createContext({ function useLayerManager(initialLayers: LayerProps[]): { layers: LayerProps[] - // eslint-disable-next-line no-unused-vars + addLayer: (layer: LayerProps) => void } { const [layers, dispatch] = useReducer((state: LayerProps[], action: ActionType) => { diff --git a/src/Components/Map/hooks/useLeafletRefs.tsx b/src/Components/Map/hooks/useLeafletRefs.tsx index d964e14b..73f41d9f 100644 --- a/src/Components/Map/hooks/useLeafletRefs.tsx +++ b/src/Components/Map/hooks/useLeafletRefs.tsx @@ -23,9 +23,9 @@ const LeafletRefsContext = createContext({ function useLeafletRefsManager(initialLeafletRefs: {}): { leafletRefs: Record - // eslint-disable-next-line no-unused-vars + addMarker: (item: Item, marker: Marker) => void - // eslint-disable-next-line no-unused-vars + addPopup: (item: Item, popup: Popup) => void } { const [leafletRefs, dispatch] = useReducer( diff --git a/src/Components/Map/hooks/usePermissions.tsx b/src/Components/Map/hooks/usePermissions.tsx index b565e129..6b0ee635 100644 --- a/src/Components/Map/hooks/usePermissions.tsx +++ b/src/Components/Map/hooks/usePermissions.tsx @@ -17,13 +17,13 @@ const PermissionContext = createContext({ function usePermissionsManager(initialPermissions: Permission[]): { permissions: Permission[] - // eslint-disable-next-line no-unused-vars + setPermissionApi: (api: ItemsApi) => void - // eslint-disable-next-line no-unused-vars + setPermissionData: (data: Permission[]) => void - // eslint-disable-next-line no-unused-vars + setAdminRole: (adminRole: string) => void - // eslint-disable-next-line no-unused-vars + hasUserPermission: ( collectionName: string, action: PermissionAction, diff --git a/src/Components/Map/hooks/useTags.tsx b/src/Components/Map/hooks/useTags.tsx index 88d06a47..06002842 100644 --- a/src/Components/Map/hooks/useTags.tsx +++ b/src/Components/Map/hooks/useTags.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-unused-vars */ import { useCallback, useReducer, createContext, useContext, useState } from 'react' import * as React from 'react' import { Item, ItemsApi, Tag } from '../../../types' diff --git a/src/Components/Profile/Templates/TabsForm.tsx b/src/Components/Profile/Templates/TabsForm.tsx index 5b19afb2..38f47a8e 100644 --- a/src/Components/Profile/Templates/TabsForm.tsx +++ b/src/Components/Profile/Templates/TabsForm.tsx @@ -8,7 +8,6 @@ import { TagsWidget } from '../Subcomponents/TagsWidget' import { useNavigate } from 'react-router-dom' import { useUpdateItem } from '../../Map/hooks/useItems' -// eslint-disable-next-line react/prop-types export const TabsForm = ({ item, state, diff --git a/src/Components/Profile/Templates/TabsView.tsx b/src/Components/Profile/Templates/TabsView.tsx index d80736f1..2f3276af 100644 --- a/src/Components/Profile/Templates/TabsView.tsx +++ b/src/Components/Profile/Templates/TabsView.tsx @@ -10,7 +10,6 @@ import { useItems } from '../../Map/hooks/useItems' import { useAssetApi } from '../../AppShell/hooks/useAssets' import { timeAgo } from '../../../Utils/TimeAgo' -// eslint-disable-next-line no-unused-vars export const TabsView = ({ attestations, userType, diff --git a/src/Utils/ReplaceURLs.ts b/src/Utils/ReplaceURLs.ts index 04436dbe..9d6be119 100644 --- a/src/Utils/ReplaceURLs.ts +++ b/src/Utils/ReplaceURLs.ts @@ -6,7 +6,7 @@ export const mailRegex = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi export function fixUrls(message: string): string { message = message.replace(urlRegex, function (url) { let hyperlink = url.replace(' ', '') - // eslint-disable-next-line no-useless-escape + if (!hyperlink.match('^https?://')) { hyperlink = 'https://' + hyperlink } diff --git a/src/types.ts b/src/types.ts index c51d3bf9..26038fe5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,3 @@ -/* eslint-disable no-unused-vars */ - import * as React from 'react' import { ItemFormPopupProps } from './Components/Map/Subcomponents/ItemFormPopup' diff --git a/tailwind.config.js b/tailwind.config.js index c93ddc32..37d47197 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /** @type {import('tailwindcss').Config} */ module.exports = { content: ['./src/**/*.{js,jsx,ts,tsx}', './node_modules/tw-elements/dist/js/**/*.js'], From 6d3f2bf38cae7869bf8ad5f25a08ca0d99e09f30 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 2 Nov 2024 23:26:14 +0100 Subject: [PATCH 3/5] remove new lines --- src/Components/AppShell/hooks/useAssets.tsx | 1 - src/Components/Auth/useAuth.tsx | 6 ------ src/Components/Input/ComboBoxInput.tsx | 1 - src/Components/Input/TextAreaInput.tsx | 1 - .../ItemPopupComponents/PopupStartEndInput.tsx | 2 -- src/Components/Map/hooks/useFilter.tsx | 9 --------- src/Components/Map/hooks/useItems.tsx | 6 ------ src/Components/Map/hooks/useLayers.tsx | 1 - src/Components/Map/hooks/useLeafletRefs.tsx | 2 -- src/Components/Map/hooks/usePermissions.tsx | 4 ---- 10 files changed, 33 deletions(-) diff --git a/src/Components/AppShell/hooks/useAssets.tsx b/src/Components/AppShell/hooks/useAssets.tsx index d301df79..c3e4465e 100644 --- a/src/Components/AppShell/hooks/useAssets.tsx +++ b/src/Components/AppShell/hooks/useAssets.tsx @@ -12,7 +12,6 @@ const AssetContext = createContext({ function useAssetsManager(): { api: AssetsApi - setAssetsApi: (api: AssetsApi) => void } { const [api, setApi] = useState({} as AssetsApi) diff --git a/src/Components/Auth/useAuth.tsx b/src/Components/Auth/useAuth.tsx index f70a6485..f5a1cfeb 100644 --- a/src/Components/Auth/useAuth.tsx +++ b/src/Components/Auth/useAuth.tsx @@ -16,18 +16,13 @@ type AuthCredentials = { type AuthContextProps = { isAuthenticated: boolean user: UserItem | null - login: (credentials: AuthCredentials) => Promise - register: (credentials: AuthCredentials, userName: string) => Promise loading: boolean logout: () => Promise - updateUser: (user: UserItem) => any token: string | null - requestPasswordReset: (email: string, reset_url: string) => Promise - passwordReset: (token: string, new_password: string) => Promise } @@ -111,7 +106,6 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => { const updateUser = async (user: UserItem) => { setLoading(true) - const { id, ...userRest } = user try { diff --git a/src/Components/Input/ComboBoxInput.tsx b/src/Components/Input/ComboBoxInput.tsx index e81948e0..91b49d88 100644 --- a/src/Components/Input/ComboBoxInput.tsx +++ b/src/Components/Input/ComboBoxInput.tsx @@ -5,7 +5,6 @@ interface ComboBoxProps { id?: string options: { value: string; label: string }[] value: string - onValueChange: (newValue: string) => void } diff --git a/src/Components/Input/TextAreaInput.tsx b/src/Components/Input/TextAreaInput.tsx index 8106ca7e..fc66f731 100644 --- a/src/Components/Input/TextAreaInput.tsx +++ b/src/Components/Input/TextAreaInput.tsx @@ -11,7 +11,6 @@ type TextAreaProps = { inputStyle?: string defaultValue: string placeholder?: string - updateFormValue?: (value: string) => void } diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx index b83de691..4a728ee0 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx @@ -5,9 +5,7 @@ import { Item } from '../../../../types' type StartEndInputProps = { item?: Item showLabels?: boolean - updateStartValue?: (value: string) => void - updateEndValue?: (value: string) => void } diff --git a/src/Components/Map/hooks/useFilter.tsx b/src/Components/Map/hooks/useFilter.tsx index 4d6a1d39..6d1eb765 100644 --- a/src/Components/Map/hooks/useFilter.tsx +++ b/src/Components/Map/hooks/useFilter.tsx @@ -32,7 +32,6 @@ const FilterContext = createContext({ toggleVisibleLayer: () => {}, resetVisibleLayers: () => {}, isLayerVisible: () => true, - addVisibleGroupType: () => {}, toggleVisibleGroupType: () => {}, isGroupTypeVisible: () => true, @@ -45,23 +44,15 @@ function useFilterManager(initialTags: Tag[]): { visibleGroupTypes: string[] addFilterTag: (tag: Tag) => void - removeFilterTag: (name: string) => void resetFilterTags: () => void - setSearchPhrase: (phrase: string) => void - addVisibleLayer: (layer: LayerProps) => void - toggleVisibleLayer: (layer: LayerProps) => void resetVisibleLayers: () => void - isLayerVisible: (layer: LayerProps) => boolean - addVisibleGroupType: (groupType: string) => void - toggleVisibleGroupType: (groupType: string) => void - isGroupTypeVisible: (groupType: string) => boolean } { const [filterTags, dispatchTags] = useReducer((state: Tag[], action: ActionType) => { diff --git a/src/Components/Map/hooks/useItems.tsx b/src/Components/Map/hooks/useItems.tsx index bba55845..0b75cf86 100644 --- a/src/Components/Map/hooks/useItems.tsx +++ b/src/Components/Map/hooks/useItems.tsx @@ -25,17 +25,11 @@ const ItemContext = createContext({ function useItemsManager(initialItems: Item[]): { items: Item[] - addItem: (item: Item) => void - updateItem: (item: Item) => void - removeItem: (item: Item) => void - resetItems: (layer: LayerProps) => void - setItemsApi: (layer: LayerProps) => void - setItemsData: (layer: LayerProps) => void allItemsLoaded: boolean } { diff --git a/src/Components/Map/hooks/useLayers.tsx b/src/Components/Map/hooks/useLayers.tsx index ac84113d..d37197a7 100644 --- a/src/Components/Map/hooks/useLayers.tsx +++ b/src/Components/Map/hooks/useLayers.tsx @@ -13,7 +13,6 @@ const LayerContext = createContext({ function useLayerManager(initialLayers: LayerProps[]): { layers: LayerProps[] - addLayer: (layer: LayerProps) => void } { const [layers, dispatch] = useReducer((state: LayerProps[], action: ActionType) => { diff --git a/src/Components/Map/hooks/useLeafletRefs.tsx b/src/Components/Map/hooks/useLeafletRefs.tsx index 73f41d9f..73c7a4a8 100644 --- a/src/Components/Map/hooks/useLeafletRefs.tsx +++ b/src/Components/Map/hooks/useLeafletRefs.tsx @@ -23,9 +23,7 @@ const LeafletRefsContext = createContext({ function useLeafletRefsManager(initialLeafletRefs: {}): { leafletRefs: Record - addMarker: (item: Item, marker: Marker) => void - addPopup: (item: Item, popup: Popup) => void } { const [leafletRefs, dispatch] = useReducer( diff --git a/src/Components/Map/hooks/usePermissions.tsx b/src/Components/Map/hooks/usePermissions.tsx index 6b0ee635..e9cbbe7c 100644 --- a/src/Components/Map/hooks/usePermissions.tsx +++ b/src/Components/Map/hooks/usePermissions.tsx @@ -17,13 +17,9 @@ const PermissionContext = createContext({ function usePermissionsManager(initialPermissions: Permission[]): { permissions: Permission[] - setPermissionApi: (api: ItemsApi) => void - setPermissionData: (data: Permission[]) => void - setAdminRole: (adminRole: string) => void - hasUserPermission: ( collectionName: string, action: PermissionAction, From 663971cd9cbd4123d02ac3f4efdaa4eff02ef00b Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 2 Nov 2024 23:27:22 +0100 Subject: [PATCH 4/5] missing change --- src/Components/Gaming/hooks/useQuests.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/Gaming/hooks/useQuests.tsx b/src/Components/Gaming/hooks/useQuests.tsx index 2461558c..17e4323f 100644 --- a/src/Components/Gaming/hooks/useQuests.tsx +++ b/src/Components/Gaming/hooks/useQuests.tsx @@ -10,7 +10,6 @@ const QuestContext = createContext({ function useQuestsManager(initialOpen: boolean): { open: boolean - setQuestsOpen: (open: boolean) => void } { const [open, setOpen] = useState(initialOpen) From 4cf0670941368a1e4086c918f0d67607468e1380 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 2 Nov 2024 23:29:47 +0100 Subject: [PATCH 5/5] missing change --- src/Components/Input/TextInput.tsx | 1 - .../Map/Subcomponents/ItemPopupComponents/TextView.tsx | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Input/TextInput.tsx b/src/Components/Input/TextInput.tsx index 1d454e40..2c1248d3 100644 --- a/src/Components/Input/TextInput.tsx +++ b/src/Components/Input/TextInput.tsx @@ -11,7 +11,6 @@ type InputTextProps = { defaultValue?: string placeholder?: string autocomplete?: string - updateFormValue?: (value: string) => void } diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx index 264d933e..fb749735 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx @@ -49,6 +49,7 @@ export const TextView = ({ if (url.match('^http://')) { shortUrl = url.split('http://')[1] } + return `[${shortUrl}](${url})` }) }