mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-12 23:36:00 +00:00
remove used eslint disables
This commit is contained in:
parent
4950a1eb60
commit
2f77dde3da
@ -1,4 +1,3 @@
|
||||
// eslint-disable-next-line no-undef
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
|
||||
@ -12,7 +12,7 @@ const AssetContext = createContext<UseAssetManagerResult>({
|
||||
|
||||
function useAssetsManager(): {
|
||||
api: AssetsApi
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
setAssetsApi: (api: AssetsApi) => void
|
||||
} {
|
||||
const [api, setApi] = useState<AssetsApi>({} as AssetsApi)
|
||||
|
||||
@ -16,18 +16,18 @@ type AuthCredentials = {
|
||||
type AuthContextProps = {
|
||||
isAuthenticated: boolean
|
||||
user: UserItem | null
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
login: (credentials: AuthCredentials) => Promise<UserItem | undefined>
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
register: (credentials: AuthCredentials, userName: string) => Promise<UserItem | undefined>
|
||||
loading: boolean
|
||||
logout: () => Promise<any>
|
||||
// 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<any>
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
passwordReset: (token: string, new_password: string) => Promise<any>
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -10,7 +10,7 @@ const QuestContext = createContext<UseQuestManagerResult>({
|
||||
|
||||
function useQuestsManager(initialOpen: boolean): {
|
||||
open: boolean
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
setQuestsOpen: (open: boolean) => void
|
||||
} {
|
||||
const [open, setOpen] = useState<boolean>(initialOpen)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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 }[]
|
||||
|
||||
@ -11,7 +11,7 @@ type TextAreaProps = {
|
||||
inputStyle?: string
|
||||
defaultValue: string
|
||||
placeholder?: string
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
updateFormValue?: (value: string) => void
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ type InputTextProps = {
|
||||
defaultValue?: string
|
||||
placeholder?: string
|
||||
autocomplete?: string
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
updateFormValue?: (value: string) => void
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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(/(?<!\]?\()https?:\/\/[^\s)]+(?!\))/g, (url) => {
|
||||
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]
|
||||
}
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -25,17 +25,17 @@ const ItemContext = createContext<UseItemManagerResult>({
|
||||
|
||||
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
|
||||
} {
|
||||
|
||||
@ -13,7 +13,7 @@ const LayerContext = createContext<UseItemManagerResult>({
|
||||
|
||||
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) => {
|
||||
|
||||
@ -23,9 +23,9 @@ const LeafletRefsContext = createContext<UseLeafletRefsManagerResult>({
|
||||
|
||||
function useLeafletRefsManager(initialLeafletRefs: {}): {
|
||||
leafletRefs: Record<string, LeafletRef>
|
||||
// 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(
|
||||
|
||||
@ -17,13 +17,13 @@ const PermissionContext = createContext<UsePermissionManagerResult>({
|
||||
|
||||
function usePermissionsManager(initialPermissions: Permission[]): {
|
||||
permissions: Permission[]
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
setPermissionApi: (api: ItemsApi<any>) => 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,
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
import * as React from 'react'
|
||||
import { ItemFormPopupProps } from './Components/Map/Subcomponents/ItemFormPopup'
|
||||
|
||||
|
||||
@ -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'],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user