From 278f5ed4565ad90012f336e89d95967a0808f3d2 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Tue, 16 Dec 2025 21:34:36 +0100 Subject: [PATCH] linting --- lib/src/Components/Input/Autocomplete.tsx | 20 +-- .../Profile/Subcomponents/ProfileTagsForm.tsx | 4 +- .../Subcomponents/TabsContainerForm.tsx | 8 +- .../Subcomponents/TabsContainerView.tsx | 8 +- .../Components/Profile/Templates/FlexForm.tsx | 2 + .../Components/Profile/Templates/FlexView.tsx | 2 + package-lock.json | 139 ++++-------------- 7 files changed, 53 insertions(+), 130 deletions(-) diff --git a/lib/src/Components/Input/Autocomplete.tsx b/lib/src/Components/Input/Autocomplete.tsx index 8d91a3cb..ffe92352 100644 --- a/lib/src/Components/Input/Autocomplete.tsx +++ b/lib/src/Components/Input/Autocomplete.tsx @@ -101,15 +101,10 @@ export const Autocomplete = ({ ref={inputRef} {...inputProps} type='text' -<<<<<<< refactor-tab-layout - onChange={(e) => handleChange(e)} - tabIndex={-1} -======= onChange={(e) => { handleChange(e) }} - tabIndex='-1' ->>>>>>> main + tabIndex={-1} onKeyDown={handleKeyDown} className='tw:border-none tw:focus:outline-none tw:focus:ring-0 tw:mt-5 tw:w-full' /> @@ -118,12 +113,13 @@ export const Autocomplete = ({ > {filteredSuggestions.map((suggestion, index) => (
  • handleSuggestionClick(suggestion)} + onClick={() => { + handleSuggestionClick(suggestion) + }} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault() @@ -132,14 +128,6 @@ export const Autocomplete = ({ }} > -======= - key={index} - onClick={() => { - handleSuggestionClick(suggestion) - }} - > - ->>>>>>> main
  • ))} diff --git a/lib/src/Components/Profile/Subcomponents/ProfileTagsForm.tsx b/lib/src/Components/Profile/Subcomponents/ProfileTagsForm.tsx index e5b2b595..46241269 100644 --- a/lib/src/Components/Profile/Subcomponents/ProfileTagsForm.tsx +++ b/lib/src/Components/Profile/Subcomponents/ProfileTagsForm.tsx @@ -24,13 +24,13 @@ export const ProfileTagsForm = ({ state, setState, dataField, heading, placehold + onUpdate={(tags) => { setState((prevState) => { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const updated = { ...prevState, [dataField]: tags } return updated }) - } + }} placeholder={placeholder ?? defaultPlaceholder} containerStyle='tw:bg-transparent tw:w-full tw:flex-1 tw:text-xs tw:pb-2 tw:overflow-auto' /> diff --git a/lib/src/Components/Profile/Subcomponents/TabsContainerForm.tsx b/lib/src/Components/Profile/Subcomponents/TabsContainerForm.tsx index b340ae87..3bc665a5 100644 --- a/lib/src/Components/Profile/Subcomponents/TabsContainerForm.tsx +++ b/lib/src/Components/Profile/Subcomponents/TabsContainerForm.tsx @@ -25,7 +25,9 @@ const componentMap: ComponentMap = { gallery: GalleryForm, inviteLinks: () => null, relations: () => null, // Relations are not editable in form + // eslint-disable-next-line camelcase -- Keys match external data schema tags_component: ProfileTagsForm, + // eslint-disable-next-line camelcase -- Keys match external data schema attestations_component: () => null, // Attestations are view-only } @@ -69,7 +71,7 @@ export const TabsContainerForm = ({ item, state, setState, tabs, iconAsLabels = (index: number) => { setActiveTab(index) const params = new URLSearchParams(location.search) - params.set('tab', `${index}`) + params.set('tab', String(index)) const newUrl = location.pathname + '?' + params.toString() navigate(newUrl) }, @@ -89,7 +91,9 @@ export const TabsContainerForm = ({ item, state, setState, tabs, iconAsLabels = type='button' key={tab.id} className={`tw:flex-1 tw:flex tw:items-center tw:justify-center tw:gap-2 tw:py-2 tw:px-4 tw:rounded-md tw:transition-colors tw:cursor-pointer ${activeTab === index ? 'tw:bg-primary tw:text-primary-content' : 'hover:tw:bg-base-300'}`} - onClick={() => updateActiveTab(index)} + onClick={() => { + updateActiveTab(index) + }} onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault() diff --git a/lib/src/Components/Profile/Subcomponents/TabsContainerView.tsx b/lib/src/Components/Profile/Subcomponents/TabsContainerView.tsx index 5cc139cb..c2815e42 100644 --- a/lib/src/Components/Profile/Subcomponents/TabsContainerView.tsx +++ b/lib/src/Components/Profile/Subcomponents/TabsContainerView.tsx @@ -27,7 +27,9 @@ const componentMap: ComponentMap = { crowdfundings: CrowdfundingView, inviteLinks: InviteLinkView, relations: RelationsView, + // eslint-disable-next-line camelcase -- Keys match external data schema tags_component: ProfileTagsView, + // eslint-disable-next-line camelcase -- Keys match external data schema attestations_component: AttestationsView, } @@ -69,7 +71,7 @@ export const TabsContainerView = ({ item, tabs = [], iconAsLabels = false }: Pro (index: number) => { setActiveTab(index) const params = new URLSearchParams(location.search) - params.set('tab', `${index}`) + params.set('tab', String(index)) const newUrl = location.pathname + '?' + params.toString() navigate(newUrl) }, @@ -88,7 +90,9 @@ export const TabsContainerView = ({ item, tabs = [], iconAsLabels = false }: Pro